A Pen by Filipp Chapkovski on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library('pacman') | |
p_load('dplyr', 'estimatr', 'tidyverse', 'readxl', 'sjPlot', 'emmeans', 'olsrr', 'writexl', 'gtsummary', 'stargazer', 'magrittr', 'ggplot2', 'scales','lemon','knitr','ggpmisc', 'fastDummies','kableExtra','wesanderson','viridis','Hmisc','ggpubr','broom','purrr','car','rstatix', 'modelsummary', 'latex2exp', 'pastecs','skimr','haven', 'hrbrthemes','kableExtra', 'skimr','lubridate', 'data.table','ggthemes','summarytools','ggsci','gt','plm','png', 'RCurl', 'jpeg','grid','ggtext') | |
# forecasts are made using linear regression | |
# | |
df<- data.frame(id_=c(1,2,3,4),year=c(1868, | |
1998, | |
2019, | |
2021), |
A Pen by Filipp Chapkovski on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def time_check(func): | |
def wrapper(*args, **kwargs): | |
start_time = time.time() | |
func(*args, **kwargs) | |
print(f"Time spent on {func.__name__}: {(time.time() - start_time)} seconds ---") | |
return wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from locust import HttpLocust, TaskSet, task, between | |
from gevent import GreenletExit | |
from locust.exception import StopLocust | |
BOT_COMPLETE_HTML_MESSAGE = b''' | |
<html> | |
<head> | |
<title>Bot completed</title> | |
</head> | |
<body>Bot completed</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GroupingWaitPage(WaitPage): | |
_allow_custom_attributes = True | |
group_by_arrival_time = True | |
def get_unique(self, wp, priority, filtering=None, matched=None): | |
seen = set() | |
# we don't need to re-use matched players | |
if matched: | |
wp = [w for w in wp if w not in matched] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@register.tag('extends') | |
def do_extends(parser, token): | |
... | |
nodelist = parser.parse() | |
if nodelist.get_nodes_by_type(ExtendsNode): | |
raise TemplateSyntaxError("'%s' cannot appear more than once in the same template" % bits[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Retrieving logs... | |
============= i-0cf01772cd6dc384f ============== | |
------------------------------------- | |
/var/log/eb-docker/containers/eb-current-app/ea01c38c37d7-stdouterr.log | |
------------------------------------- | |
Operations to perform: | |
Synchronize unmigrated apps: messages, staticfiles | |
Apply all migrations: contenttypes, admin, sessions, auth | |
Synchronizing apps without migrations: | |
Creating tables... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import floppyforms.__future__ as forms | |
from .models import SendReceive, Player | |
from django.forms import inlineformset_factory, BaseFormSet, BaseInlineFormSet | |
class SRForm(forms.ModelForm): | |
class Meta: | |
model = SendReceive | |
fields = ['amount_sent'] |