This file contains hidden or 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
SKIP_MODULES = ('django', 'simple_history') | |
ACCESS_FILES = [ | |
'/var/log/nginx/access.log', | |
'/var/log/nginx/access.log.1', | |
'/var/log/nginx/access.log.2', | |
] + ['/var/log/nginx/access.log.{}.gz'.format(i) for i in range(3, 31)] | |
RE_SEARCH_URL = r'(?:(?:POST)|(?:GET)|(?:PATCH)|(?:PUT)|(?:OPTIONS)|(?:DELETE)|(?:HEAD))\s([^\s\?]+)' | |
def SKIP_MATCH(url): | |
return requested_url.startswith('/static/') |
This file contains hidden or 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 os | |
import re | |
def find_functions(file_path): | |
""" | |
Extracts functions and their line counts from a given Python file. | |
""" | |
with open(file_path, 'r') as file: | |
lines = file.readlines() |
This file contains hidden or 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 functools import cached_property | |
class DataProxy: | |
def __init__(self, user): | |
self.user = user | |
@cached_property | |
def plan(self): | |
return DBModel.objects.get(id=67) | |
OlderNewer