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 cProfile | |
from functools import wraps | |
from pstats import Stats, SortKey | |
from time import time | |
def timing(f): | |
"""A simple timer decorator""" | |
@wraps(f) | |
def wrapper(*args, **kwargs): |
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
# prior step done: | |
# python manage.py dumpdata auth.User --output=users.json --format=json | |
from collections import Counter | |
import json | |
import plotext as plt | |
def aggregate_users_by_year_month(filename="users.json"): | |
cnt = Counter() |
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 typing import Protocol | |
class PybitesSearchProtocol(Protocol): | |
def match_content(self, search: str) -> list[str]: | |
"""Implement in subclass to search Pybites content""" | |
... | |
class CompleteSearch: | |
def match_content(self, search: str) -> list[str]: | |
# Implementation of search method |
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 concurrent.futures | |
import os | |
import re | |
from timeit import timeit | |
import requests | |
URLS = 'urls' | |
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
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v4.0.1 | |
hooks: | |
- id: check-yaml | |
- id: end-of-file-fixer | |
- id: trailing-whitespace | |
- id: debug-statements | |
- repo: https://github.com/pycqa/flake8 |
OlderNewer