id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36,100 | 0012_statespreadsheet_automatically_created.py | turicas_brasil_io/covid19/migrations/0012_statespreadsheet_automatically_created.py | # Generated by Django 3.0.5 on 2020-07-13 20:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("covid19", "0011_auto_20200706_1805"),
]
operations = [
migrations.AddField(
model_name="statespreadsheet", name="automatically_c... | 388 | Python | .py | 11 | 29.090909 | 114 | 0.677419 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,101 | 0013_auto_20200713_1721.py | turicas_brasil_io/covid19/migrations/0013_auto_20200713_1721.py | # Generated by Django 3.0.5 on 2020-07-13 20:21
from django.db import migrations
from django.db.models import F
def populate_automatically_created_flag(apps, schema_editor):
StateSpreadsheet = apps.get_model("covid19", "StateSpreadsheet")
StateSpreadsheet.objects.filter(peer_review_id=F("id")).update(automat... | 820 | Python | .py | 14 | 54.357143 | 110 | 0.787955 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,102 | 0007_statespreadsheet_peer_review.py | turicas_brasil_io/covid19/migrations/0007_statespreadsheet_peer_review.py | # Generated by Django 2.2 on 2020-04-22 17:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("covid19", "0006_auto_20200415_1613"),
]
operations = [
migrations.AddField(
model_name="statespre... | 549 | Python | .py | 16 | 26.5 | 114 | 0.638258 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,103 | 0009_dailybulletin.py | turicas_brasil_io/covid19/migrations/0009_dailybulletin.py | # Generated by Django 3.0.5 on 2020-06-25 14:52
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("covid19", "0008_auto_20200504_1455"),
]
operations = [
migrations.CreateModel(
name=... | 855 | Python | .py | 20 | 32.9 | 114 | 0.604819 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,104 | 0014_auto_20200713_1733.py | turicas_brasil_io/covid19/migrations/0014_auto_20200713_1733.py | # Generated by Django 3.0.5 on 2020-07-13 20:33
from django.db import migrations
from django.conf import settings
def create_covid19_auto_import_user(apps, schema_editor):
User = apps.get_model("auth", "User")
StateSpreadsheet = apps.get_model("covid19", "StateSpreadsheet")
auto_user = User.objects.crea... | 935 | Python | .py | 21 | 38.428571 | 97 | 0.702104 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,105 | 0002_auto_20200410_1919.py | turicas_brasil_io/covid19/migrations/0002_auto_20200410_1919.py | # Generated by Django 2.2 on 2020-04-10 22:19
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("covid19", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="statespreadsh... | 1,013 | Python | .py | 28 | 25.464286 | 143 | 0.579324 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,106 | test_tasks.py | turicas_brasil_io/covid19/tests/test_tasks.py | from unittest.mock import Mock, patch
from django.test import TestCase
from model_bakery import baker
from covid19.exceptions import OnlyOneSpreadsheetException
from covid19.models import StateSpreadsheet
from covid19.notifications import notify_import_success
from covid19.tasks import process_new_spreadsheet_task
... | 2,590 | Python | .py | 43 | 53.790698 | 118 | 0.7576 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,107 | test_google_data.py | turicas_brasil_io/covid19/tests/test_google_data.py | from unittest import skip
from unittest.mock import patch
import pytest
from django.core.cache import cache
from django.test import TestCase
from covid19 import google_data
class TestGoogleDataIntegration(TestCase):
@skip("This test won't work with Django's DummyCache, which is enabled for development")
def... | 1,117 | Python | .py | 25 | 38.12 | 92 | 0.703053 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,108 | test_context_processors.py | turicas_brasil_io/covid19/tests/test_context_processors.py | from django.conf import settings
from django.contrib.auth.models import AnonymousUser, Group
from django.test import RequestFactory, TestCase
from model_bakery import baker
from covid19.context_processors import is_covid19_contributor
class TestCovid19ContributorContextProcessor(TestCase):
def setUp(self):
... | 2,019 | Python | .py | 38 | 45.631579 | 83 | 0.707951 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,109 | test_spreadsheet_validator.py | turicas_brasil_io/covid19/tests/test_spreadsheet_validator.py | from datetime import date, timedelta
from io import BytesIO
from pathlib import Path
from unittest.mock import Mock, patch
import pytest
import rows
from django.conf import settings
from django.test import TestCase
from model_bakery import baker
from brazil_data.cities import get_city_info
from core.models import Tab... | 33,742 | Python | .py | 632 | 42.919304 | 215 | 0.640509 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,110 | utils.py | turicas_brasil_io/covid19/tests/utils.py | from core.tests.utils import BaseTestCaseWithSampleDataset
class Covid19DatasetTestCase(BaseTestCaseWithSampleDataset):
"""
Base test case class to prepare Brasil.io's DB to have Covid-19 cases dataset.
"""
DATASET_SLUG = "covid19"
TABLE_NAME = "caso"
FIELDS_KWARGS = [
{"name": "date"... | 1,443 | Python | .py | 22 | 58.454545 | 99 | 0.561354 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,111 | test_forms.py | turicas_brasil_io/covid19/tests/test_forms.py | import shutil
from datetime import date, timedelta
from pathlib import Path
from unittest.mock import Mock, patch
import rows
from django.conf import settings
from django.contrib.auth.models import Group, Permission
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models import Q
from djang... | 10,477 | Python | .py | 203 | 43.162562 | 109 | 0.658116 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,112 | test_stats.py | turicas_brasil_io/covid19/tests/test_stats.py | from covid19.stats import group_deaths
def test_group_deaths():
data = [
{
"epidemiological_week": 10,
"deaths_covid19": 100,
"deaths_indeterminate": 200,
"deaths_indeterminate_2019": 300,
"deaths_others": 400,
"deaths_others_2019": 5... | 2,235 | Python | .py | 58 | 28.155172 | 62 | 0.553152 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,113 | test_views.py | turicas_brasil_io/covid19/tests/test_views.py | import json
from unittest.mock import patch
from django.test import TestCase
from django.urls import reverse
from covid19.exceptions import SpreadsheetValidationErrors
from traffic_control.tests.util import TrafficControlClient
class ImportSpreadsheetProxyViewTests(TestCase):
client_class = TrafficControlClient... | 1,556 | Python | .py | 32 | 41.875 | 74 | 0.700397 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,114 | test_models.py | turicas_brasil_io/covid19/tests/test_models.py | import json
import shutil
from copy import deepcopy
from datetime import date, timedelta
from pathlib import Path
from unittest.mock import patch
import pytest
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from model_bakery import baker
from covid19.e... | 30,231 | Python | .py | 706 | 31.147309 | 175 | 0.571959 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,115 | update_bulletin.py | turicas_brasil_io/covid19/management/commands/update_bulletin.py | import datetime
from pathlib import Path
import rows
from django.core.management.base import BaseCommand
from django.core.validators import URLValidator
from covid19.models import DailyBulletin
class Command(BaseCommand):
help = "Update/create daily Covid19 bulletin"
def add_arguments(self, parser):
... | 1,558 | Python | .py | 31 | 42.806452 | 98 | 0.667327 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,116 | update_state_totals.py | turicas_brasil_io/covid19/management/commands/update_state_totals.py | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from covid19.commands import UpdateStateTotalsCommand
class Command(BaseCommand):
help = "Update state totals based on custom spreadsheet"
def add_arguments(self, parser):
parser.add_argument("--force"... | 1,013 | Python | .py | 17 | 52.823529 | 111 | 0.707911 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,117 | fix_covid19_past_imports.py | turicas_brasil_io/covid19/management/commands/fix_covid19_past_imports.py | from datetime import date
from django.core.management.base import BaseCommand
from covid19.models import StateSpreadsheet
class Command(BaseCommand):
help = "Fix previous inconsisted cancelled spreadsheets"
def handle(self, *args, **kwargs):
start_date = date(2020, 6, 5)
cancelled_spreadsh... | 1,567 | Python | .py | 40 | 25.55 | 104 | 0.527741 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,118 | fix_covid19_past_total_imports.py | turicas_brasil_io/covid19/management/commands/fix_covid19_past_total_imports.py | from django.core.management.base import BaseCommand
from covid19.models import StateSpreadsheet
class Command(BaseCommand):
help = "Fix previous inconsisted cancelled spreadsheets"
def handle(self, *args, **kwargs):
only_with_total_qs = StateSpreadsheet.objects.filter(
data__warnings__ic... | 1,381 | Python | .py | 27 | 39.259259 | 135 | 0.610863 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,119 | atualiza_voluntarios.py | turicas_brasil_io/covid19/scripts/atualiza_voluntarios.py | import io
import json
import rows
from project.storage import storage
def make_row(row, active):
return {
"name": row.name,
"personal_url": row.personal_url,
"avatar_url": f"https://data.brasil.io/mirror/covid19/voluntarios/{row.username_chat}.jpeg",
"active": active,
}
def... | 1,205 | Python | .py | 34 | 29.588235 | 100 | 0.670396 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,120 | models.py | turicas_brasil_io/brasilio_auth/models.py | from django.contrib.auth import get_user_model
from django.db import models
class NewsletterSubscriberQuerySet(models.QuerySet):
def active(self):
return self.filter(user__is_active=True)
class NewsletterSubscriber(models.Model):
objects = NewsletterSubscriberQuerySet.as_manager()
user = models... | 379 | Python | .py | 8 | 43.25 | 75 | 0.795082 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,121 | auth_backend.py | turicas_brasil_io/brasilio_auth/auth_backend.py | from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
User = get_user_model()
class UsernameOrEmailBackend(ModelBackend):
def authenticate(self, request, username=None, password=None, *args, **kwargs):
if username is None:
... | 715 | Python | .py | 20 | 27.3 | 83 | 0.64058 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,122 | urls.py | turicas_brasil_io/brasilio_auth/urls.py | from django.contrib.auth import views as auth_views
from django.urls import path, reverse_lazy
from django.views.generic.base import TemplateView
from brasilio_auth import views
from core.middlewares import disable_non_logged_user_cache
login = auth_views.LoginView.as_view(template_name="brasilio_auth/login.html")
lo... | 2,791 | Python | .py | 67 | 36.358209 | 118 | 0.705147 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,123 | admin.py | turicas_brasil_io/brasilio_auth/admin.py | import csv
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from django.http import StreamingHttpResponse
from django.urls import path
from brasilio_auth... | 1,976 | Python | .py | 46 | 35.695652 | 97 | 0.695402 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,124 | forms.py | turicas_brasil_io/brasilio_auth/forms.py | import re
from django import forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from django_registration.forms import RegistrationFormUniqueEmail
from utils.forms import FlagedReCaptchaField as ReCaptchaField
USERNAME_REGEXP = re.compile(r"[^A-Za-z0-9_]")
PUNC... | 2,003 | Python | .py | 43 | 40.023256 | 102 | 0.705307 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,125 | views.py | turicas_brasil_io/brasilio_auth/views.py | import django_registration.backends.activation.views as registration_views
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, redirect, render
from django.url... | 3,800 | Python | .py | 70 | 48.5 | 172 | 0.744807 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,126 | services.py | turicas_brasil_io/brasilio_auth/services.py | from brasilio_auth.models import NewsletterSubscriber
def subscribers_as_csv_rows(include_header=True):
rows = []
if include_header:
rows.append(("username", "email"))
qs = NewsletterSubscriber.objects.select_related("user").active()
for user in [subscriber.user for subscriber in qs]:
... | 379 | Python | .py | 9 | 36.666667 | 69 | 0.718579 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,127 | 0001_initial.py | turicas_brasil_io/brasilio_auth/migrations/0001_initial.py | # Generated by Django 2.0.5 on 2018-05-15 17:27
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 754 | Python | .py | 21 | 26.619048 | 115 | 0.614856 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,128 | test_scripts.py | turicas_brasil_io/brasilio_auth/tests/test_scripts.py | from datetime import datetime
from tempfile import NamedTemporaryFile
import pytest
from django.contrib.auth import get_user_model
from django.test import TestCase
from model_bakery import baker
from api.models import Token
from brasilio_auth.models import NewsletterSubscriber
from brasilio_auth.scripts.migrate_dupli... | 7,255 | Python | .py | 142 | 42.591549 | 118 | 0.670918 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,129 | test_forms.py | turicas_brasil_io/brasilio_auth/tests/test_forms.py | from unittest.mock import Mock, patch
from django.conf import settings
from django.contrib.auth.forms import UserCreationForm as DjangoUserCreationForm
from django.test import TestCase, override_settings
from django_recaptcha.fields import ReCaptchaField
from model_bakery import baker
from brasilio_auth.forms import ... | 7,616 | Python | .py | 181 | 32.740331 | 115 | 0.620774 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,130 | test_services.py | turicas_brasil_io/brasilio_auth/tests/test_services.py | from django.contrib.auth import get_user_model
from django.test import TestCase
from model_bakery import baker
from brasilio_auth.models import NewsletterSubscriber
from brasilio_auth.services import subscribers_as_csv_rows
User = get_user_model()
class TestSubscribersAsCSVRows(TestCase):
def setUp(self):
... | 1,135 | Python | .py | 22 | 44.863636 | 88 | 0.705349 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,131 | test_views.py | turicas_brasil_io/brasilio_auth/tests/test_views.py | from unittest.mock import Mock, patch
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.core import mail
from django.template.loader import get_template
from django.test import TestCase, override_settings
from django.urls import reverse
from... | 10,403 | Python | .py | 198 | 44.646465 | 117 | 0.690209 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,132 | test_login.py | turicas_brasil_io/brasilio_auth/tests/test_login.py | from django.contrib.auth import get_user_model
from django.test import TestCase
User = get_user_model()
class UserLoginViewTests(TestCase):
def setUp(self):
self.username = "testuser"
self.email = "test@example.com"
self.password = "supersecret"
self.user = self.create_user(
... | 1,259 | Python | .py | 31 | 32.741935 | 82 | 0.671862 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,133 | test_models.py | turicas_brasil_io/brasilio_auth/tests/test_models.py | from django.test import TestCase
from model_bakery import baker
from brasilio_auth.models import NewsletterSubscriber
class NewsletterSubscriberQuerySetTests(TestCase):
def test_active_queryset_filter(self):
active = baker.make(NewsletterSubscriber, user__is_active=True)
baker.make(NewsletterSubs... | 546 | Python | .py | 11 | 43.545455 | 71 | 0.760829 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,134 | migrate_wrong_usernames.py | turicas_brasil_io/brasilio_auth/scripts/migrate_wrong_usernames.py | """
Anteriormente, os usuários podiam cadastrar seu username utilizando o caractere
inválido '@'.
Este script corrige esse problema alterando os usernames que contem '@' por
variações únicas baseadas no nome de usuário e/ou no e-mail de cada registro.
Exemplo:
old_username = 'name@'
new_username = 'name'
"""
... | 2,630 | Python | .py | 62 | 33.935484 | 115 | 0.619309 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,135 | migrate_duplicate_emails.py | turicas_brasil_io/brasilio_auth/scripts/migrate_duplicate_emails.py | import csv
from django.contrib.auth import get_user_model
from django.db.models import Count, Q
from django.db.models.functions import Lower, Trim
from tqdm import tqdm
from api.models import Token
from covid19.models import StateSpreadsheet
User = get_user_model()
def migrate_duplicate_emails(filepath=None):
... | 2,348 | Python | .py | 56 | 30.160714 | 108 | 0.582784 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,136 | activites.py | turicas_brasil_io/data_activities_log/activites.py | import datetime
from dataclasses import dataclass
from itertools import chain, groupby
import feedparser
from cachetools import TTLCache, cached
from django.utils import timezone
from core.models import Table
@dataclass
class Activity:
title: str
url: str
created_at: datetime
def brasilio_blog_items()... | 2,129 | Python | .py | 54 | 32.314815 | 118 | 0.652111 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,137 | models.py | turicas_brasil_io/traffic_control/models.py | import datetime
from copy import deepcopy
from itertools import chain
from django.db import models
from django.utils import timezone
class BlockRequestQuerySet(models.QuerySet):
def from_hours_ago(self, hours):
return self.filter(created_at__gte=timezone.now() - datetime.timedelta(hours=hours))
def ... | 3,200 | Python | .py | 69 | 38.188406 | 102 | 0.638844 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,138 | handlers.py | turicas_brasil_io/traffic_control/handlers.py | from django.conf import settings
from django.http import JsonResponse
from django.shortcuts import render
from django.views.defaults import page_not_found, server_error
from django_ratelimit.exceptions import Ratelimited
from rest_framework.exceptions import Throttled
from rest_framework.views import exception_handler
... | 4,662 | Python | .py | 70 | 60.114286 | 343 | 0.737389 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,139 | util.py | turicas_brasil_io/traffic_control/util.py | def get_ip(request):
ip = request.META.get("HTTP_CF_CONNECTING_IP", "").strip()
if not ip:
ip = request.META.get("HTTP_X_FORWARDED_FOR", "").strip()
if not ip:
ip = request.META.get("REMOTE_ADDR", "").strip()
else:
ip = ip.split(",")[0]
return ip
def ratelim... | 469 | Python | .py | 15 | 24.8 | 65 | 0.557522 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,140 | blocked_list.py | turicas_brasil_io/traffic_control/blocked_list.py | import json
from collections import deque
from cached_property import cached_property
from django.conf import settings
from django_redis import get_redis_connection
class BlockedRequestList:
"""
Singleton indirection between our code and Redis to isolate how we're enqueing the request
data to be further ... | 1,547 | Python | .py | 40 | 30.975 | 94 | 0.67291 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,141 | cloudflare.py | turicas_brasil_io/traffic_control/cloudflare.py | import json
from urllib.parse import urljoin
import requests
class Cloudflare:
base_url = "https://api.cloudflare.com/client/v4/"
def __init__(self, email, key):
self.__auth_email = email
self.__auth_key = key
self.__auth_headers = {
"X-AUTH-KEY": key,
"X-AUTH... | 3,916 | Python | .py | 81 | 37.765432 | 111 | 0.604609 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,142 | logging.py | turicas_brasil_io/traffic_control/logging.py | from traffic_control.blocked_list import blocked_requests
def format_request(request, response_status_code):
user = getattr(request, "user", None)
request_data = {
"query_string": list(request.GET.items()),
"path": request.path,
"headers": list(request.headers.items()),
"respo... | 790 | Python | .py | 16 | 43.3125 | 103 | 0.680104 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,143 | tasks.py | turicas_brasil_io/traffic_control/tasks.py | from django.conf import settings
from django_rq import job
from traffic_control.commands import PersistBlockedRequestsCommand, UpdateBlockedIPsCommand
@job
def persist_blocked_requests_task():
PersistBlockedRequestsCommand.execute()
@job
def update_blocked_ips_task():
UpdateBlockedIPsCommand.execute(settin... | 386 | Python | .py | 9 | 40.444444 | 107 | 0.854839 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,144 | admin.py | turicas_brasil_io/traffic_control/admin.py | from django.contrib import admin
from traffic_control.models import BlockedRequest
class BlockedRequestAdmin(admin.ModelAdmin):
readonly_fields = ["request_data", "created_at"]
list_display = ["source_ip", "status_code", "path", "user_agent", "created_at"]
admin.site.register(BlockedRequest, BlockedRequest... | 327 | Python | .py | 6 | 51.333333 | 83 | 0.778481 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,145 | middlewares.py | turicas_brasil_io/traffic_control/middlewares.py | from django.conf import settings
from django.urls import is_valid_path, resolve
from django_ratelimit import ALL
from django_ratelimit.core import is_ratelimited
from django_ratelimit.exceptions import Ratelimited
from traffic_control.constants import RATELIMITED_VIEW_ATTR
from traffic_control.util import ratelimit_ke... | 1,781 | Python | .py | 38 | 36.052632 | 114 | 0.641869 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,146 | decorators.py | turicas_brasil_io/traffic_control/decorators.py | from django.conf import settings
from django_ratelimit.decorators import ratelimit
from traffic_control.constants import RATELIMITED_VIEW_ATTR
from traffic_control.util import ratelimit_key
def enable_ratelimit(view):
def view_with_rate_limit(request, *args, **kwargs):
# cannot use @decorator syntax beca... | 771 | Python | .py | 14 | 49.214286 | 113 | 0.755644 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,147 | commands.py | turicas_brasil_io/traffic_control/commands.py | from cached_property import cached_property
from django.conf import settings
from tqdm import tqdm
from traffic_control.blocked_list import blocked_requests
from traffic_control.cloudflare import Cloudflare
from traffic_control.models import BlockedRequest
class PersistBlockedRequestsCommand:
@classmethod
de... | 2,809 | Python | .py | 64 | 34.875 | 113 | 0.644428 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,148 | 0006_auto_20200918_0214.py | turicas_brasil_io/traffic_control/migrations/0006_auto_20200918_0214.py | # Generated by Django 3.1.1 on 2020-09-18 05:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0005_auto_20200917_1952"),
]
operations = [
migrations.AlterField(
model_name="blockedrequest",
n... | 839 | Python | .py | 23 | 27.434783 | 89 | 0.61529 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,149 | 0001_initial.py | turicas_brasil_io/traffic_control/migrations/0001_initial.py | # Generated by Django 3.1.1 on 2020-09-17 21:29
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="BlockedRequestsModels",
fields=[
("id", models.A... | 630 | Python | .py | 16 | 30 | 114 | 0.595395 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,150 | 0005_auto_20200917_1952.py | turicas_brasil_io/traffic_control/migrations/0005_auto_20200917_1952.py | # Generated by Django 3.1.1 on 2020-09-17 22:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0004_blockedrequest_status_code"),
]
operations = [
migrations.AlterField(
model_name="blockedrequest", name=... | 1,277 | Python | .py | 30 | 33.4 | 118 | 0.637681 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,151 | 0003_auto_20200917_1920.py | turicas_brasil_io/traffic_control/migrations/0003_auto_20200917_1920.py | # Generated by Django 3.1.1 on 2020-09-17 22:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0002_auto_20200917_1831"),
]
operations = [
migrations.AddField(model_name="blockedrequest", name="headers", field=models... | 840 | Python | .py | 15 | 49.066667 | 117 | 0.703659 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,152 | 0007_auto_20200918_0253.py | turicas_brasil_io/traffic_control/migrations/0007_auto_20200918_0253.py | # Generated by Django 3.1.1 on 2020-09-18 05:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0006_auto_20200918_0214"),
]
operations = [
migrations.AlterField(
model_name="blockedrequest",
n... | 441 | Python | .py | 13 | 26.692308 | 85 | 0.63357 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,153 | 0002_auto_20200917_1831.py | turicas_brasil_io/traffic_control/migrations/0002_auto_20200917_1831.py | # Generated by Django 3.1.1 on 2020-09-17 21:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0001_initial"),
]
operations = [
migrations.RenameModel(old_name="BlockedRequestsModels", new_name="BlockedRequest",),
]
| 316 | Python | .py | 9 | 30 | 93 | 0.701987 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,154 | 0004_blockedrequest_status_code.py | turicas_brasil_io/traffic_control/migrations/0004_blockedrequest_status_code.py | # Generated by Django 3.1.1 on 2020-09-17 22:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0003_auto_20200917_1920"),
]
operations = [
migrations.AddField(
model_name="blockedrequest", name="status_co... | 395 | Python | .py | 11 | 29.727273 | 113 | 0.680739 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,155 | util.py | turicas_brasil_io/traffic_control/tests/util.py | from django.test.client import Client
class TrafficControlClient(Client):
def generic(self, *args, **kwargs):
if "HTTP_USER_AGENT" not in kwargs:
kwargs["HTTP_USER_AGENT"] = "test-client"
return super().generic(*args, **kwargs)
| 262 | Python | .py | 6 | 37 | 53 | 0.669291 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,156 | test_tasks.py | turicas_brasil_io/traffic_control/tests/test_tasks.py | from unittest.mock import Mock, patch
from django.conf import settings
from traffic_control import tasks
from traffic_control.commands import PersistBlockedRequestsCommand, UpdateBlockedIPsCommand
@patch("traffic_control.tasks.PersistBlockedRequestsCommand.execute", spec=PersistBlockedRequestsCommand.execute)
def t... | 1,029 | Python | .py | 17 | 56.764706 | 113 | 0.812935 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,157 | test_middlewares.py | turicas_brasil_io/traffic_control/tests/test_middlewares.py | from unittest.mock import Mock
import pytest
from django.conf import settings
from django.test import RequestFactory, TestCase, override_settings
from django_ratelimit.exceptions import Ratelimited
from traffic_control.middlewares import BLOCKED_REQUEST_ATTR, block_suspicious_requests
class BlockSuspiciousRequestsM... | 2,525 | Python | .py | 47 | 45.93617 | 87 | 0.702801 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,158 | test_blocked_list.py | turicas_brasil_io/traffic_control/tests/test_blocked_list.py | import json
from unittest.mock import Mock, patch
from django.test import TestCase, override_settings
from redis.client import Redis
from traffic_control.blocked_list import blocked_requests
class BlockedRequestListTests(TestCase):
def test_in_memory_enqueueing(self):
blocked_requests.clear()
m... | 1,406 | Python | .py | 31 | 38.064516 | 68 | 0.671554 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,159 | test_commands.py | turicas_brasil_io/traffic_control/tests/test_commands.py | from django.test import RequestFactory, TestCase
from traffic_control.blocked_list import blocked_requests
from traffic_control.commands import PersistBlockedRequestsCommand
from traffic_control.logging import format_request
from traffic_control.models import BlockedRequest
class PersistBlockedRequestsCommandTests(T... | 979 | Python | .py | 19 | 45.157895 | 69 | 0.745283 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,160 | test_logging.py | turicas_brasil_io/traffic_control/tests/test_logging.py | from unittest.mock import Mock
import pytest
from django.contrib.auth import get_user_model
from django.test import RequestFactory
from traffic_control.blocked_list import blocked_requests
from traffic_control.logging import format_request, log_blocked_request
@pytest.fixture
def request_factory():
return Reque... | 2,230 | Python | .py | 49 | 41.163265 | 75 | 0.687993 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,161 | test_util.py | turicas_brasil_io/traffic_control/tests/test_util.py | import pytest
from django.test import RequestFactory
from traffic_control.util import ratelimit_key
@pytest.fixture
def request_factory():
return RequestFactory()
@pytest.mark.skip()
def test_ratelimit_key_from_cloudfare_ip_with_user_agent(request_factory):
ip, user_agent = "127.1.1.0", "test"
request... | 1,313 | Python | .py | 29 | 41.586207 | 92 | 0.709449 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,162 | test_models.py | turicas_brasil_io/traffic_control/tests/test_models.py | from copy import deepcopy
from django.test import RequestFactory, TestCase
from traffic_control.logging import format_request
from traffic_control.models import BlockedRequest
class BlockedRequestModelTests(TestCase):
def setUp(self):
request = RequestFactory().get("/", data={"qs": "v1"}, HTTP_CUSTOM="f... | 2,084 | Python | .py | 36 | 50.166667 | 106 | 0.694799 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,163 | test_decorators.py | turicas_brasil_io/traffic_control/tests/test_decorators.py | import pytest
from django.http import HttpResponse
from django.test import RequestFactory, TestCase, override_settings
from django_ratelimit.exceptions import Ratelimited
from traffic_control.constants import RATELIMITED_VIEW_ATTR
from traffic_control.decorators import enable_ratelimit
def fake_view(request, foo, ba... | 1,728 | Python | .py | 32 | 48 | 81 | 0.734597 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,164 | persist_blocked_requests.py | turicas_brasil_io/traffic_control/management/commands/persist_blocked_requests.py | from django.core.management.base import BaseCommand
from traffic_control.commands import PersistBlockedRequestsCommand
class Command(BaseCommand):
help = "Read blocked requests from redis and persist them on potgres"
def handle(self, *args, **kwargs):
PersistBlockedRequestsCommand.execute()
| 312 | Python | .py | 6 | 47.666667 | 73 | 0.804636 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,165 | schedule_traffic_control_jobs.py | turicas_brasil_io/traffic_control/management/commands/schedule_traffic_control_jobs.py | import django_rq
from cached_property import cached_property
from django.core.management.base import BaseCommand
from django.utils import timezone
from traffic_control import tasks
class Command(BaseCommand):
help = "Schedule recurrent traffic control jobs"
@cached_property
def scheduler(self):
... | 881 | Python | .py | 23 | 31.086957 | 63 | 0.682726 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,166 | update_cloudflare_blocked_ips.py | turicas_brasil_io/traffic_control/management/commands/update_cloudflare_blocked_ips.py | from django.conf import settings
from django.core.management.base import BaseCommand
from traffic_control.commands import UpdateBlockedIPsCommand
class Command(BaseCommand):
help = "Update Cloudflare blocked ips"
def add_arguments(self, parser):
parser.add_argument("--hours-ago", required=False, typ... | 891 | Python | .py | 20 | 36.45 | 69 | 0.675145 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,167 | contact.html | turicas_brasil_io/core/templates/core/contact.html | {% extends 'base.html' %}
{% block title %}Contato - {{ block.super }}{% endblock %}
{% block content %}
<h4>Contato</h4>
{% if sent %}
<h5>
Sua mensagem foi enviada com sucesso! Em breve responderemos. :)
</h5>
{% endif %}
<div>
<p>
Preencha o formul√°rio abaixo para entrar em contato conosco ou envie
... | 908 | Python | .tac | 32 | 25.25 | 97 | 0.652074 | turicas/brasil.io | 915 | 145 | 143 | GPL-3.0 | 9/5/2024, 5:15:11 PM (Europe/Amsterdam) |
36,168 | setup.py | volatilityfoundation_volatility/setup.py | #!/usr/bin/env python
# Volatility
#
# Authors:
# AAron Walters <awalters@4tphi.net>
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software ... | 3,606 | Python | .py | 87 | 33.241379 | 157 | 0.623966 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,169 | vol.py | volatilityfoundation_volatility/vol.py | #!/usr/bin/env python
# -*- mode: python; -*-
#
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation;... | 6,517 | Python | .py | 168 | 32.327381 | 104 | 0.651789 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,170 | vtype_diff.py | volatilityfoundation_volatility/tools/vtype_diff.py | #!/usr/bin/env python
# -*- mode: python; -*-
#
# Volatility
# Authors:
# Brendan Dolan-Gavitt
# Mike Auty
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundatio... | 7,414 | Python | .py | 188 | 30.244681 | 142 | 0.578238 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,171 | createtree.py | volatilityfoundation_volatility/tools/doxygen/d3/createtree.py | import os
import json
'''
Author: Gleeda <jamie@memoryanalysis.net>
modified from:
http://stackoverflow.com/questions/25226208/represent-directory-tree-as-json
Quick and Dirty. Run from the Volatility root directory and redirect:
python createtree.py > OUTPUT/d3/vol.json
'''
link = "https://github.com/volatili... | 875 | Python | .py | 24 | 32.208333 | 106 | 0.655991 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,172 | mac_create_all_profiles.py | volatilityfoundation_volatility/tools/mac/mac_create_all_profiles.py | # Volatility
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is dist... | 5,635 | Python | .py | 125 | 38.056 | 170 | 0.636629 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,173 | convert.py | volatilityfoundation_volatility/tools/mac/convert.py | #!/usr/bin/env python
import os, sys, re
class DWARFParser(object):
"""A parser for DWARF files."""
# Nasty, but appears to parse the lines we need
dwarf_header_regex = re.compile(
r'<(?P<level>\d+)><(?P<statement_id>[0-9+]+)><(?P<kind>\w+)>')
dwarf_key_val_regex = re.compile(
'\s*(?P... | 20,612 | Python | .py | 490 | 28.120408 | 108 | 0.473489 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,174 | generate_profile_list.py | volatilityfoundation_volatility/tools/mac/generate_profile_list.py | # Volatility
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is dist... | 3,305 | Python | .py | 77 | 31.350649 | 99 | 0.536516 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,175 | parse_pbzx2.py | volatilityfoundation_volatility/tools/mac/parse_pbzx2.py | #
# parse_pbzx.py
# Useful for extracting "Payload" files from newer Kernel Debug Kits
# you can then decompress that with cpio -i < Payload.part00.cpio.xz
#
# Taken from https://gist.github.com/pudquick/ff412bcb29c9c1fa4b8d
#
# Original notes:
#
# v2 pbzx stream handler
# My personal writeup on the differences he... | 3,121 | Python | .py | 82 | 30.817073 | 111 | 0.604352 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,176 | parsesummary.py | volatilityfoundation_volatility/tools/windows/parsesummary.py | import json
import sys
import os
"""
Author: Gleeda <jamie.levy@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version
2 of the License, or (at your option) any later version.
pa... | 2,256 | Python | .py | 59 | 28.525424 | 118 | 0.546415 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,177 | hook-volatility.py | volatilityfoundation_volatility/pyinstaller/hook-volatility.py |
import os
projpath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
modules = set(['volatility.plugins'])
for dirpath, _dirnames, filenames in os.walk(os.path.join(projpath, 'volatility', 'plugins')):
dirpath = dirpath[len(os.path.join(projpath, 'volatility', 'plugins')):]
if dirpath and dirpat... | 729 | Python | .py | 17 | 36.058824 | 94 | 0.629787 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,178 | hook-yara.py | volatilityfoundation_volatility/pyinstaller/hook-yara.py | import os
import sys
datas = []
for path in sys.path:
if os.path.exists(os.path.join(path, "yara.pyd")):
datas.append((os.path.join(path, "yara.pyd"), "."))
if os.path.exists(os.path.join(path, "yara.so")):
datas.append((os.path.join(path, "yara.so"), "."))
| 284 | Python | .py | 8 | 31.25 | 59 | 0.620438 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,179 | hook-distorm3.py | volatilityfoundation_volatility/pyinstaller/hook-distorm3.py | # Distorm3 hook
#
# This currently contains the hardcoded location for the standard distorm3.dll install
# It could be improved by carrying out a search, or using sys.path
#
# This also requires the distorm3 module to be modified with the following patch:
# import sys
# if hasattr(sys, '_MEIPASS'):
# _distorm_path... | 692 | Python | .py | 17 | 38 | 86 | 0.708955 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,180 | hook-openpyxl.py | volatilityfoundation_volatility/pyinstaller/hook-openpyxl.py | # Openpyxl hook
#
# This currently contains the hardcoded location for the .constants.json file
# It could be improved by carrying out a search, or using sys.path
#
# This also requires the openpyxl module to be modified with the following patch:
# import sys
# if hasattr(sys, '_MEIPASS'):
# here = sys._MEIPASS
i... | 528 | Python | .py | 15 | 33.133333 | 81 | 0.722986 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,181 | pslist_json.py | volatilityfoundation_volatility/contrib/library_example/pslist_json.py | # Volatility
# Copyright (c) 2015 Michael Ligh (michael.ligh@mnin.org)
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | 1,698 | Python | .py | 37 | 42.756757 | 85 | 0.733172 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,182 | libapi.py | volatilityfoundation_volatility/contrib/library_example/libapi.py | # Volatility
# Copyright (c) 2015 Michael Ligh (michael.ligh@mnin.org)
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | 1,478 | Python | .py | 37 | 37.945946 | 71 | 0.783727 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,183 | disablewarnings.py | volatilityfoundation_volatility/contrib/plugins/disablewarnings.py | # Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your op... | 1,244 | Python | .py | 31 | 36.870968 | 78 | 0.729529 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,184 | example.py | volatilityfoundation_volatility/contrib/plugins/example.py | # Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your op... | 2,769 | Python | .py | 57 | 42.561404 | 110 | 0.699852 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,185 | obj.py | volatilityfoundation_volatility/volatility/obj.py | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# Copyright (C) 2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gen... | 47,149 | Python | .py | 1,022 | 36.152642 | 159 | 0.595284 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,186 | fmtspec.py | volatilityfoundation_volatility/volatility/fmtspec.py | # Volatility
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is dist... | 3,516 | Python | .py | 94 | 28.595745 | 133 | 0.578638 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,187 | dwarf.py | volatilityfoundation_volatility/volatility/dwarf.py | # Volatility
# Copyright (C) 2010 Brendan Dolan-Gavitt
# Copyright (c) 2011 Michael Cohen <scudette@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | 14,474 | Python | .py | 329 | 31.884498 | 126 | 0.514755 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,188 | protos.py | volatilityfoundation_volatility/volatility/protos.py | protos = {
0:"HOPOPT",
1:"ICMP",
2:"IGMP",
3:"GGP",
4:"IPv4",
5:"ST",
6:"TCP",
7:"CBT",
8:"EGP",
9:"IGP",
10:"BBN-RCC-MON",
11:"NVP-II",
12:"PUP",
13:"ARGUS",
14:"EMCON",... | 6,418 | Python | .py | 259 | 13.857143 | 32 | 0.407047 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,189 | constants.py | volatilityfoundation_volatility/volatility/constants.py | # Volatility
# Copyright (C) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | 1,154 | Python | .py | 32 | 34.125 | 70 | 0.758281 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,190 | conf.py | volatilityfoundation_volatility/volatility/conf.py | ## This file was taken from PyFlag http://www.pyflag.net/
# Michael Cohen <scudette@users.sourceforge.net>
# David Collett <daveco@users.sourceforge.net>
#
# ******************************************************
# Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$
# ********************************... | 15,263 | Python | .py | 358 | 32.977654 | 167 | 0.613263 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,191 | validity.py | volatilityfoundation_volatility/volatility/validity.py | """
Created on 4 May 2013
@author: mike
"""
class ValidityRoutines(object):
"""Class to hold all validation routines, such as type checking"""
def type_check(self, value, valid_type):
"""Checks that value is an instance of valid_type, and returns value if it is, or throws a TypeError otherwise
... | 1,587 | Python | .py | 31 | 40.741935 | 119 | 0.599483 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,192 | timefmt.py | volatilityfoundation_volatility/volatility/timefmt.py | # Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your op... | 4,565 | Python | .py | 110 | 33.281818 | 139 | 0.61982 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,193 | scan.py | volatilityfoundation_volatility/volatility/scan.py | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# Derived from source in PyFlag developed by:
# Copyright 2004: Commonwealth of Australia.
# Michael Cohen <scudette@users.sourceforge.net>
# David Collett <daveco@users.sourceforge.net>
#
# This file is part of Volatility.
#
# Volatility is free software;... | 6,848 | Python | .py | 144 | 38.229167 | 112 | 0.634906 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,194 | utils.py | volatilityfoundation_volatility/volatility/utils.py | # Volatility
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 5,469 | Python | .py | 119 | 38.226891 | 108 | 0.630325 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,195 | cache.py | volatilityfoundation_volatility/volatility/cache.py | # This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is distributed in the ... | 24,520 | Python | .py | 513 | 40.048733 | 122 | 0.673437 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,196 | debug.py | volatilityfoundation_volatility/volatility/debug.py | # Volatility
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | 2,716 | Python | .py | 82 | 28.926829 | 83 | 0.684733 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,197 | exceptions.py | volatilityfoundation_volatility/volatility/exceptions.py | # Volatility
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is dist... | 1,764 | Python | .py | 37 | 43.783784 | 109 | 0.726744 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,198 | registry.py | volatilityfoundation_volatility/volatility/registry.py | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# Derived from source in PyFlag developed by:
# Copyright 2004: Commonwealth of Australia.
# Michael Cohen <scudette@users.sourceforge.net>
# David Collett <daveco@users.sourceforge.net>
#
# Subclassing plugin code developed by:
#
# Mike Auty <mike.auty@gm... | 6,699 | Python | .py | 143 | 37.237762 | 117 | 0.599388 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |
36,199 | addrspace.py | volatilityfoundation_volatility/volatility/addrspace.py | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# Original Source:
# Copyright (C) 2004,2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under ... | 15,615 | Python | .py | 330 | 38.575758 | 203 | 0.6343 | volatilityfoundation/volatility | 7,163 | 1,266 | 224 | GPL-2.0 | 9/5/2024, 5:15:21 PM (Europe/Amsterdam) |