repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pyinfra-dev/pyinfra | https://github.com/pyinfra-dev/pyinfra | null | null | null | null | 4,972 | null | null | mit | null | null | null | null | null | null | null | src/pyinfra/connectors/terraform.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:32.129885 | import json
from typing_extensions import override
from pyinfra import local, logger
from pyinfra.api.exceptions import InventoryError
from pyinfra.api.util import memoize
from pyinfra.progress import progress_spinner
from .base import BaseConnector
@memoize
def show_warning() -> None:
logger.warning("The @ter... |
pyinfra-dev/pyinfra | https://github.com/pyinfra-dev/pyinfra | null | null | null | null | 4,972 | null | null | mit | null | null | null | null | null | null | null | src/pyinfra/connectors/util.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:32.163925 | from __future__ import annotations
from dataclasses import dataclass
from getpass import getpass
from queue import Queue
from socket import timeout as timeout_error
from gevent.subprocess import PIPE, Popen
from typing import TYPE_CHECKING, Callable, Iterable, Optional, Union
import gevent
from pyinfra import logger... |
pyinfra-dev/pyinfra | https://github.com/pyinfra-dev/pyinfra | null | null | null | null | 4,972 | null | null | mit | null | null | null | null | null | null | null | src/pyinfra/api/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:32.430938 | from .command import ( # noqa: F401
FileDownloadCommand, # noqa: F401 # pragma: no cover
FileUploadCommand,
FunctionCommand,
MaskString,
QuoteString,
RsyncCommand,
StringCommand,
)
from .config import Config # noqa: F401 # pragma: no cover
from .deploy import deploy # noqa: F401 # pragma... |
pyinfra-dev/pyinfra | https://github.com/pyinfra-dev/pyinfra | null | null | null | null | 4,972 | null | null | mit | null | null | null | null | null | null | null | src/pyinfra/api/output.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:35.148675 | """
Pluggable output formatting for pyinfra.
Provides ``format_text`` and ``echo`` functions that default to plain-text
no-ops, allowing the API layer to work without any CLI dependency. The CLI
layer replaces them at startup via ``set_formatter`` and ``set_echo``.
"""
from __future__ import annotations
from typing... |
pyinfra-dev/pyinfra | https://github.com/pyinfra-dev/pyinfra | null | null | null | null | 4,972 | null | null | mit | null | null | null | null | null | null | null | src/pyinfra/api/state.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:35.353853 | from __future__ import annotations
from collections import defaultdict
from dataclasses import dataclass
from enum import IntEnum
from graphlib import CycleError, TopologicalSorter
from multiprocessing import cpu_count
from typing import TYPE_CHECKING, Callable, Iterator, Optional
from gevent.pool import Pool
from pa... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/example_app/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:39.765557 | from django.db import models
# Create your models here.
from django.db.models import BooleanField, ImageField, TextField
class Product(models.Model):
photo = ImageField(upload_to='products')
class Meta:
abstract = True
class Blind(Product):
name = TextField()
child_safe = BooleanField(defa... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/example_app/admin.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:39.779615 | from django.contrib import admin
from django.urls import reverse
from .models import Blind
@admin.register(Blind)
class BlindAdmin(admin.ModelAdmin):
list_display = ('desc', 'thumbnail', 'name', 'child_safe')
list_editable = ('name', 'child_safe')
@admin.display(
description='Photo'
)
de... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/example_app/urls.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:39.891403 | from django.urls import path
from . import views
app_name = 'example_app'
urlpatterns = [
path(route='', view=views.index, name='index'),
path(route='create', view=views.ExampleCreateView.as_view(), name='create'),
]
|
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/example_app/views.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.278669 | from time import sleep
# Create your views here.
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic import CreateView
from example_app import models
from silk.profiling.profiler import silk_profile
def index(request):
@silk_profile()
def do_something_long():
... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/manage.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.344414 | #!/usr/bin/env python
"""Define the Django Silk management entry."""
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/project/urls.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.382316 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views
from django.urls import include, path
urlpatterns = [
path(
route='silk/',
view=include('silk.urls', namespace='silk'),
),
path(
route='... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/project/settings.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.391652 | import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'ey5!m&h-uj6c7dzp@(o1%96okkq4!&bjja%oi*v3r=2t(!$7os'
DEBUG = True
DEBUG_PROPAGATE_EXCEPTIONS = True
ALLOWED_HOSTS = []
INSTALLED_APPS = (
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.auth',
'django... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/factories.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.399804 | import factory
import factory.fuzzy
from example_app.models import Blind
from silk.models import Request, Response, SQLQuery
HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'HEAD', 'OPTIONS']
STATUS_CODES = [200, 201, 300, 301, 302, 401, 403, 404]
class SQLQueryFactory(factory.django.DjangoModelFactory):
query ... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/data/dynamic.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.499775 | def foo():
print('1')
print('2')
print('3')
def foo2():
print('1')
print('2')
print('3')
|
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_app_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.586372 | from django.apps import apps as proj_apps
from django.test import TestCase
from silk.apps import SilkAppConfig
class TestAppConfig(TestCase):
"""
Test if correct AppConfig class is loaded by Django.
"""
def test_app_config_loaded(self):
silk_app_config = proj_apps.get_app_config("silk")
... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_code.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.910367 | from collections import namedtuple
from django.test import TestCase
from silk.views.code import _code, _code_context, _code_context_from_request
FILE_PATH = __file__
LINE_NUM = 5
END_LINE_NUM = 10
with open(__file__) as f:
ACTUAL_LINES = [line + '\n' for line in f.read().split('\n')]
class CodeTestCase(TestCa... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_compat.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.970911 | import json
from unittest.mock import Mock
from django.test import TestCase
from silk.model_factory import ResponseModelFactory
DJANGO_META_CONTENT_TYPE = 'CONTENT_TYPE'
HTTP_CONTENT_TYPE = 'content-type'
class TestByteStringCompatForResponse(TestCase):
def test_bytes_compat(self):
"""
Test Re... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_code_gen_curl.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:40.972144 | import shlex
from unittest import TestCase
from silk.code_generation.curl import curl_cmd
class TestCodeGenCurl(TestCase):
def test_post_json(self):
result = curl_cmd(
url="https://example.org/alpha/beta",
method="POST",
body={"gamma": "delta"},
content_typ... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_collector.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.003697 | import cProfile
import os.path
import sys
from django.test import TestCase
from tests.util import DictStorage
from silk.collector import DataCollector
from silk.config import SilkyConfig
from .factories import RequestMinFactory
class TestCollector(TestCase):
def test_singleton(self):
a = DataCollector(... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_config_auth.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.004951 | from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import NoReverseMatch, reverse
from silk.config import SilkyConfig, default_permissions
from silk.middleware import silky_reverse
class TestAuth(TestCase):
def test_authentication(self):
SilkyConfig().SILKY_AUTH... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_config_long_urls.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.021845 | from unittest.mock import Mock
from django.test import TestCase
from silk.model_factory import RequestModelFactory
class TestLongRequestUrl(TestCase):
def test_no_long_url(self):
url = '1234567890' * 19 # 190-character URL
mock_request = Mock()
mock_request.headers = {'content-type': '... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_code_gen_django.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.041957 | import textwrap
from unittest import TestCase
from silk.code_generation.django_test_client import gen
class TestCodeGenDjango(TestCase):
def test_post(self):
result = gen(
path="/alpha/beta",
method="POST",
data={"gamma": "delta", "epsilon": "zeta"},
conten... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_command_garbage_collect.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.084601 | from django.core import management
from django.test import TestCase
from silk import models
from silk.config import SilkyConfig
from .factories import RequestMinFactory
class TestViewClearDB(TestCase):
def test_garbage_collect_command(self):
SilkyConfig().SILKY_MAX_RECORDED_REQUESTS = 2
RequestM... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_config_meta.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.198001 | from unittest.mock import NonCallableMock
from django.test import TestCase
from silk.collector import DataCollector
from silk.config import SilkyConfig
from silk.middleware import SilkyMiddleware
from silk.models import Request
from .util import delete_all_models
def fake_get_response():
def fake_response():
... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_config_max_body_size.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.199127 | from unittest.mock import Mock
from django.test import TestCase
from django.urls import reverse
from silk.collector import DataCollector
from silk.config import SilkyConfig
from silk.model_factory import RequestModelFactory, ResponseModelFactory
from silk.models import Request
class TestMaxBodySizeRequest(TestCase)... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_encoding.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.822959 | import json
import logging
from unittest.mock import Mock
from django.test import TestCase
from silk.model_factory import RequestModelFactory, ResponseModelFactory
HTTP_CONTENT_TYPE = 'content-type'
JS_CONTENT = b'var x = 1;'
class TestEncodingForRequests(TestCase):
"""
Check that the RequestModelFactory d... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_dynamic_profiling.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.824908 | from unittest.mock import patch
from django.test import TestCase
import silk
from silk.profiling.dynamic import (
_get_module,
_get_parent_module,
profile_function_or_method,
)
from .test_lib.assertion import dict_contains
from .util import mock_data_collector
class TestGetModule(TestCase):
"""test... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_filters.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.826000 | import calendar
import random
from datetime import datetime, timedelta, timezone
from itertools import groupby
from math import floor
from django.test import TestCase
from django.utils import timezone as django_timezone
from silk import models
from silk.request_filters import (
AfterDateFilter,
BeforeDateFilt... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_end_points.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.827064 | import random
from django.db.models import Count, F
from django.test import TestCase
from django.urls import reverse
from silk import models
from silk.config import SilkyConfig
from silk.middleware import silky_reverse
from .test_lib.mock_suite import MockSuite
class TestEndPoints(TestCase):
"""
Hit all th... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_execute_sql.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.828535 | from unittest.mock import Mock, NonCallableMagicMock, NonCallableMock, patch
from django.test import TestCase
from django.utils.encoding import force_str
from silk.collector import DataCollector
from silk.models import Request, SQLQuery
from silk.sql import execute_sql
from .util import delete_all_models
_simple_mo... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_db.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:41.935892 | """
Test profiling of DB queries without mocking, to catch possible
incompatibility
"""
from django.shortcuts import reverse
from django.test import Client, TestCase
from silk.collector import DataCollector
from silk.config import SilkyConfig
from silk.models import Request
from silk.profiling.profiler import silk_pro... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_lib/mock_suite.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.020727 | import json
import os
import random
import traceback
from datetime import timedelta
from django.core import management
from django.utils import timezone
from silk import models
from silk.models import Profile, SQLQuery
class MockSuite:
"""
Provides some fake data to play around with. Also useful for testing... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_models.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.048977 | import datetime
import uuid
from django.core.management import call_command
from django.test import TestCase, override_settings
from freezegun import freeze_time
from silk import models
from silk.config import SilkyConfig
from silk.storage import ProfilerResultStorage
from .factories import RequestMinFactory, Respon... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_lib/assertion.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.234553 | def dict_contains(child_dict, parent_dict):
for key, value in child_dict.items():
if key not in parent_dict:
return False
if parent_dict[key] != value:
return False
return True
|
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_profile_parser.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.399844 | import contextlib
import cProfile
import io
import re
from django.test import TestCase
from silk.utils.profile_parser import parse_profile
class ProfileParserTestCase(TestCase):
def test_profile_parser(self):
"""
Verify that the function parse_profile produces the expected output.
"""
... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_profile_dot.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.460679 | # std
import cProfile
import os
import tempfile
from contextlib import contextmanager
from unittest.mock import MagicMock
# 3rd party
from django.test import TestCase
from networkx.drawing.nx_pydot import read_dot
# silk
from silk.views.profile_dot import (
_create_dot,
_create_profile,
_temp_file_from_fi... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_response_assumptions.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.461217 | from django.http import HttpResponse
from django.test import TestCase
class TestResponseAssumptions(TestCase):
def test_headers_present_in_http_response(self):
"""Verify that HttpResponse has a headers or _headers attribute, which we use and Mock in our tests."""
django_response = HttpResponse()
... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_sensitive_data_in_request.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.491684 | import json
from unittest.mock import Mock
from django.test import TestCase
from silk.config import SilkyConfig
from silk.model_factory import RequestModelFactory
HTTP_CONTENT_TYPE = 'content-type'
CLEANSED = RequestModelFactory.CLEANSED_SUBSTITUTE
DEFAULT_SENSITIVE_KEYS = {'username', 'api', 'token', 'key', 'secret... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_multipart_forms.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.530700 | from unittest.mock import Mock
from django.test import TestCase
from django.urls import reverse
from silk.model_factory import RequestModelFactory, multipart_form
class TestMultipartForms(TestCase):
def test_no_max_request(self):
mock_request = Mock()
mock_request.headers = {'content-type': mul... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_silky_middleware.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.545394 | from unittest.mock import patch
from django.test import TestCase, override_settings
from django.urls import reverse
from silk.config import SilkyConfig
from silk.errors import SilkNotConfigured
from silk.middleware import SilkyMiddleware, _should_intercept
from silk.models import Request
from .util import mock_data_... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_silky_profiler.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.573550 | from time import sleep
from django.test import TestCase
from silk.collector import DataCollector
from silk.models import Request, _time_taken
from silk.profiling.profiler import silk_profile
from .test_lib.mock_suite import MockSuite
class TestProfilerRequests(TestCase):
def test_context_manager_no_request(sel... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_view_clear_db.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.686527 | from django.test import TestCase
from silk import models
from silk.config import SilkyConfig
from silk.middleware import silky_reverse
from .factories import RequestMinFactory
class TestViewClearDB(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
SilkyConfig().SILKY_AUTHENTI... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_view_profiling.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:42.862367 | from unittest.mock import Mock
from django.test import TestCase
from silk.middleware import silky_reverse
from silk.views.profiling import ProfilingView
from .test_lib.assertion import dict_contains
from .test_lib.mock_suite import MockSuite
class TestProfilingViewDefaults(TestCase):
def test_func_names(self):... |
jazzband/django-silk | https://github.com/jazzband/django-silk | null | null | null | null | 4,965 | null | null | mit | null | null | null | null | null | null | null | project/tests/test_view_requests.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:43.064515 | import random
import unittest
from unittest.mock import Mock
from django.test import TestCase
from silk.middleware import silky_reverse
from silk.views.requests import RequestsView
from .test_lib.assertion import dict_contains
from .test_lib.mock_suite import MockSuite
class TestRootViewDefaults(TestCase):
def... |
roboflow/sports | https://github.com/roboflow/sports | null | null | null | null | 4,962 | null | null | mit | null | null | null | null | null | null | null | sports/common/ball.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:45.278813 | from collections import deque
import cv2
import numpy as np
import supervision as sv
class BallAnnotator:
"""
A class to annotate frames with circles of varying radii and colors.
Attributes:
radius (int): The maximum radius of the circles to be drawn.
buffer (deque): A deque buffer to st... |
roboflow/sports | https://github.com/roboflow/sports | null | null | null | null | 4,962 | null | null | mit | null | null | null | null | null | null | null | examples/soccer/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:45.279386 | import argparse
from enum import Enum
from typing import Iterator, List
import os
import cv2
import numpy as np
import supervision as sv
from tqdm import tqdm
from ultralytics import YOLO
from sports.annotators.soccer import draw_pitch, draw_points_on_pitch
from sports.common.ball import BallTracker, BallAnnotator
fr... |
roboflow/sports | https://github.com/roboflow/sports | null | null | null | null | 4,962 | null | null | mit | null | null | null | null | null | null | null | sports/annotators/soccer.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:45.282168 | from typing import Optional, List
import cv2
import supervision as sv
import numpy as np
from sports.configs.soccer import SoccerPitchConfiguration
def draw_pitch(
config: SoccerPitchConfiguration,
background_color: sv.Color = sv.Color(34, 139, 34),
line_color: sv.Color = sv.Color.WHITE,
padding: in... |
roboflow/sports | https://github.com/roboflow/sports | null | null | null | null | 4,962 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:45.282708 | import pathlib
import setuptools
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text(encoding="utf-8")
setuptools.setup(
name="sports",
version='0.1.0',
python_requires=">=3.8",
description="",
long_descri... |
roboflow/sports | https://github.com/roboflow/sports | null | null | null | null | 4,962 | null | null | mit | null | null | null | null | null | null | null | sports/common/team.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:45.288599 | from typing import Generator, Iterable, List, TypeVar
import numpy as np
import supervision as sv
import torch
import umap
from sklearn.cluster import KMeans
from tqdm import tqdm
from transformers import AutoProcessor, SiglipVisionModel
V = TypeVar("V")
SIGLIP_MODEL_PATH = 'google/siglip-base-patch16-224'
def cre... |
roboflow/sports | https://github.com/roboflow/sports | null | null | null | null | 4,962 | null | null | mit | null | null | null | null | null | null | null | sports/common/view.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:45.294736 | from typing import Tuple
import cv2
import numpy as np
import numpy.typing as npt
class ViewTransformer:
def __init__(
self,
source: npt.NDArray[np.float32],
target: npt.NDArray[np.float32]
) -> None:
"""
Initialize the ViewTransformer with source and target... |
roboflow/sports | https://github.com/roboflow/sports | null | null | null | null | 4,962 | null | null | mit | null | null | null | null | null | null | null | sports/configs/soccer.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:48.636671 | from dataclasses import dataclass, field
from typing import List, Tuple
@dataclass
class SoccerPitchConfiguration:
width: int = 7000 # [cm]
length: int = 12000 # [cm]
penalty_box_width: int = 4100 # [cm]
penalty_box_length: int = 2015 # [cm]
goal_box_width: int = 1832 # [cm]
goal_box_leng... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/crawlers/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.867514 | from .dispatcher import CrawlerDispatcher
from .github import GithubCrawler
from .linkedin import LinkedInCrawler
from .medium import MediumCrawler
__all__ = ["CrawlerDispatcher", "GithubCrawler", "LinkedInCrawler", "MediumCrawler"]
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | code_snippets/03_custom_odm_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.874338 | from llm_engineering.domain.documents import ArticleDocument, UserDocument
if __name__ == "__main__":
user = UserDocument.get_or_create(first_name="Paul", last_name="Iusztin")
articles = ArticleDocument.bulk_find(author_id=str(user.id))
print(f"User ID: {user.id}") # noqa
print(f"User name: {user.fir... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.887892 | from llm_engineering import application, domain, infrastructure
from llm_engineering.settings import settings
__all__ = ["settings", "application", "domain", "infrastructure"]
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | code_snippets/08_instructor_embeddings.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.893637 | from sentence_transformers import SentenceTransformer
# Create virtual environment, install dependencies and run the code:
# 1. Create: python3 -m venv instructor_venv
# 2. Activate: source instructor_venv/bin/activate
# 3. Install: pip install sentence-transformers==3.3.0
# 4. Run the code: python code_snippets/08_in... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | code_snippets/08_text_embeddings.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.902217 | from sentence_transformers import SentenceTransformer
# Leverage the Poetry virtual environment to run the code:
# poetry run python code_snippets/08_text_embeddings.py
if __name__ == "__main__":
# 1. Load a pretrained Sentence Transformer model.
model = SentenceTransformer("all-MiniLM-L6-v2")
# The sent... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | code_snippets/08_text_image_embeddings.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.903631 | from io import BytesIO
import requests
from PIL import Image
from sentence_transformers import SentenceTransformer
# Leverage the Poetry virtual environment to run the code:
# poetry run python code_snippets/08_text_image_embeddings.py
if __name__ == "__main__":
# Load an image with a crazy cat.
response = r... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/crawlers/custom_article.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.905110 | from urllib.parse import urlparse
from langchain_community.document_loaders import AsyncHtmlLoader
from langchain_community.document_transformers.html2text import Html2TextTransformer
from loguru import logger
from llm_engineering.domain.documents import ArticleDocument
from .base import BaseCrawler
class CustomAr... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | code_snippets/03_orm.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.912445 | from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import declarative_base, sessionmaker
# Create virtual environment, install dependencies and run the code:
# 1. Create: python3 -m venv orm_venv
# 2. Activate: source orm_venv/bin/activate
# 3. Install: pip install sqlalchemy==2.0.35
# 4... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/crawlers/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:50.924990 | import time
from abc import ABC, abstractmethod
from tempfile import mkdtemp
import chromedriver_autoinstaller
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from llm_engineering.domain.documents import NoSQLBaseDocument
# Check if the current version of chromedriver exists
# an... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/crawlers/github.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.593287 | import os
import shutil
import subprocess
import tempfile
from loguru import logger
from llm_engineering.domain.documents import RepositoryDocument
from .base import BaseCrawler
class GithubCrawler(BaseCrawler):
model = RepositoryDocument
def __init__(self, ignore=(".git", ".toml", ".lock", ".png")) -> No... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/dataset/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.814514 | from sklearn.model_selection import train_test_split
from llm_engineering.application.preprocessing.operations.chunking import chunk_document
from llm_engineering.domain.cleaned_documents import CleanedDocument
from llm_engineering.domain.dataset import (
InstructDataset,
InstructDatasetSample,
InstructTra... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/crawlers/dispatcher.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.815794 | import re
from urllib.parse import urlparse
from loguru import logger
from .base import BaseCrawler
from .custom_article import CustomArticleCrawler
from .github import GithubCrawler
from .linkedin import LinkedInCrawler
from .medium import MediumCrawler
class CrawlerDispatcher:
def __init__(self) -> None:
... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/networks/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.822771 | from .embeddings import CrossEncoderModelSingleton, EmbeddingModelSingleton
__all__ = ["EmbeddingModelSingleton", "CrossEncoderModelSingleton"]
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/crawlers/linkedin.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.823982 | import time
from typing import Dict, List
from bs4 import BeautifulSoup
from bs4.element import Tag
from loguru import logger
from selenium.webdriver.common.by import By
from llm_engineering.domain.documents import PostDocument
from llm_engineering.domain.exceptions import ImproperlyConfigured
from llm_engineering.se... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/dataset/generation.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.830341 | from abc import ABC, abstractmethod
import tiktoken
from langchain_core.exceptions import OutputParserException
from langchain_core.language_models.fake import FakeListLLM
from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage
from langchain_core.prompts import PromptTemplate
from langchain_opena... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/dataset/output_parsers.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.838038 | from langchain.output_parsers import PydanticOutputParser
class ListPydanticOutputParser(PydanticOutputParser):
def _parse_obj(self, obj: dict | list):
if isinstance(obj, list):
return [super(ListPydanticOutputParser, self)._parse_obj(obj_) for obj_ in obj]
else:
return sup... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/crawlers/medium.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.839539 | from bs4 import BeautifulSoup
from loguru import logger
from llm_engineering.domain.documents import ArticleDocument
from .base import BaseSeleniumCrawler
class MediumCrawler(BaseSeleniumCrawler):
model = ArticleDocument
def set_extra_driver_options(self, options) -> None:
options.add_argument(r"--... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/dataset/constants.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:51.846543 | from llm_engineering.domain.dataset import DatasetType
MOCKED_RESPONSE_INSTRUCT = """
[
{"instruction": "<mocked generated instruction> 1", "answer": "<mocked generated answer> 1"},
{"instruction": "<mocked generated instruction> 2", "answer": "<mocked generated answer> 2"},
{"instruction": "<mocked genera... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/networks/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.324514 | from threading import Lock
from typing import ClassVar
class SingletonMeta(type):
"""
This is a thread-safe implementation of Singleton.
"""
_instances: ClassVar = {}
_lock: Lock = Lock()
"""
We now have a lock object that will be used to synchronize threads during
first access to t... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/cleaning_data_handlers.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.457754 | from abc import ABC, abstractmethod
from typing import Generic, TypeVar
from llm_engineering.domain.cleaned_documents import (
CleanedArticleDocument,
CleanedDocument,
CleanedPostDocument,
CleanedRepositoryDocument,
)
from llm_engineering.domain.documents import (
ArticleDocument,
Document,
... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/dispatchers.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.486644 | from loguru import logger
from llm_engineering.domain.base import NoSQLBaseDocument, VectorBaseDocument
from llm_engineering.domain.types import DataCategory
from .chunking_data_handlers import (
ArticleChunkingHandler,
ChunkingDataHandler,
PostChunkingHandler,
RepositoryChunkingHandler,
)
from .clean... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/chunking_data_handlers.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.487890 | import hashlib
from abc import ABC, abstractmethod
from typing import Generic, TypeVar
from uuid import UUID
from llm_engineering.domain.chunks import ArticleChunk, Chunk, PostChunk, RepositoryChunk
from llm_engineering.domain.cleaned_documents import (
CleanedArticleDocument,
CleanedDocument,
CleanedPostD... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/embedding_data_handlers.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.495594 | from abc import ABC, abstractmethod
from typing import Generic, TypeVar, cast
from llm_engineering.application.networks import EmbeddingModelSingleton
from llm_engineering.domain.chunks import ArticleChunk, Chunk, PostChunk, RepositoryChunk
from llm_engineering.domain.embedded_chunks import (
EmbeddedArticleChunk,... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/operations/cleaning.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.496889 | import re
def clean_text(text: str) -> str:
text = re.sub(r"[^\w\s.,!?]", " ", text)
text = re.sub(r"\s+", " ", text)
return text.strip()
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/operations/chunking.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.498223 | import re
from langchain.text_splitter import RecursiveCharacterTextSplitter, SentenceTransformersTokenTextSplitter
from llm_engineering.application.networks import EmbeddingModelSingleton
embedding_model = EmbeddingModelSingleton()
def chunk_text(text: str, chunk_size: int = 500, chunk_overlap: int = 50) -> list[... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/operations/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.499108 | from .chunking import chunk_article, chunk_text
from .cleaning import clean_text
__all__ = [
"chunk_article",
"chunk_text",
"clean_text",
]
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/preprocessing/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.527710 | from .dispatchers import ChunkingDispatcher, CleaningDispatcher, EmbeddingDispatcher
__all__ = ["CleaningDispatcher", "ChunkingDispatcher", "EmbeddingDispatcher"]
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/networks/embeddings.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:52.528796 | from functools import cached_property
from pathlib import Path
from typing import Optional
import numpy as np
from loguru import logger
from numpy.typing import NDArray
from sentence_transformers.SentenceTransformer import SentenceTransformer
from sentence_transformers.cross_encoder import CrossEncoder
from transforme... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/rag/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.298726 | from abc import ABC, abstractmethod
from typing import Any
from langchain.prompts import PromptTemplate
from pydantic import BaseModel
from llm_engineering.domain.queries import Query
class PromptTemplateFactory(ABC, BaseModel):
@abstractmethod
def create_template(self) -> PromptTemplate:
pass
cla... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/rag/self_query.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.661011 | import opik
from langchain_openai import ChatOpenAI
from loguru import logger
from llm_engineering.application import utils
from llm_engineering.domain.documents import UserDocument
from llm_engineering.domain.queries import Query
from llm_engineering.settings import settings
from .base import RAGStep
from .prompt_te... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/rag/reranking.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.690741 | import opik
from llm_engineering.application.networks import CrossEncoderModelSingleton
from llm_engineering.domain.embedded_chunks import EmbeddedChunk
from llm_engineering.domain.queries import Query
from .base import RAGStep
class Reranker(RAGStep):
def __init__(self, mock: bool = False) -> None:
sup... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/rag/prompt_templates.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.691806 | from langchain.prompts import PromptTemplate
from .base import PromptTemplateFactory
class QueryExpansionTemplate(PromptTemplateFactory):
prompt: str = """You are an AI language model assistant. Your task is to generate {expand_to_n}
different versions of the given user question to retrieve relevant document... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/rag/query_expanison.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.715509 | import opik
from langchain_openai import ChatOpenAI
from loguru import logger
from llm_engineering.domain.queries import Query
from llm_engineering.settings import settings
from .base import RAGStep
from .prompt_templates import QueryExpansionTemplate
class QueryExpansion(RAGStep):
@opik.track(name="QueryExpans... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.773585 | from . import base, chunks, cleaned_documents, dataset, documents, embedded_chunks, exceptions, inference, prompt, types
__all__ = [
"base",
"chunks",
"cleaned_documents",
"dataset",
"documents",
"embedded_chunks",
"exceptions",
"inference",
"types",
"prompt",
]
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/rag/retriever.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.804735 | import concurrent.futures
import opik
from loguru import logger
from qdrant_client.models import FieldCondition, Filter, MatchValue
from llm_engineering.application import utils
from llm_engineering.application.preprocessing.dispatchers import EmbeddingDispatcher
from llm_engineering.domain.embedded_chunks import (
... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/base/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:54.892512 | from .nosql import NoSQLBaseDocument
from .vector import VectorBaseDocument
__all__ = ["NoSQLBaseDocument", "VectorBaseDocument"]
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/chunks.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.270537 | from abc import ABC
from typing import Optional
from pydantic import UUID4, Field
from llm_engineering.domain.base import VectorBaseDocument
from llm_engineering.domain.types import DataCategory
class Chunk(VectorBaseDocument, ABC):
content: str
platform: str
document_id: UUID4
author_id: UUID4
... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/base/nosql.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.281572 | import uuid
from abc import ABC
from typing import Generic, Type, TypeVar
from loguru import logger
from pydantic import UUID4, BaseModel, Field
from pymongo import errors
from llm_engineering.domain.exceptions import ImproperlyConfigured
from llm_engineering.infrastructure.db.mongo import connection
from llm_enginee... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/base/vector.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.309668 | import uuid
from abc import ABC
from typing import Any, Callable, Dict, Generic, Type, TypeVar
from uuid import UUID
import numpy as np
from loguru import logger
from pydantic import UUID4, BaseModel, Field
from qdrant_client.http import exceptions
from qdrant_client.http.models import Distance, VectorParams
from qdra... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/cleaned_documents.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.355297 | from abc import ABC
from typing import Optional
from pydantic import UUID4
from .base import VectorBaseDocument
from .types import DataCategory
class CleanedDocument(VectorBaseDocument, ABC):
content: str
platform: str
author_id: UUID4
author_full_name: str
class CleanedPostDocument(CleanedDocumen... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/documents.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.380636 | from abc import ABC
from typing import Optional
from pydantic import UUID4, Field
from .base import NoSQLBaseDocument
from .types import DataCategory
class UserDocument(NoSQLBaseDocument):
first_name: str
last_name: str
class Settings:
name = "users"
@property
def full_name(self):
... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.381411 | from enum import Enum
from loguru import logger
try:
from datasets import Dataset, DatasetDict, concatenate_datasets
except ImportError:
logger.warning("Huggingface datasets not installed. Install with `pip install datasets`")
from llm_engineering.domain.base import VectorBaseDocument
from llm_engineering.d... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/embedded_chunks.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.514124 | from abc import ABC
from pydantic import UUID4, Field
from llm_engineering.domain.types import DataCategory
from .base import VectorBaseDocument
class EmbeddedChunk(VectorBaseDocument, ABC):
content: str
embedding: list[float] | None
platform: str
document_id: UUID4
author_id: UUID4
author_... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/domain/exceptions.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:55.934432 | class LLMTwinException(Exception):
pass
class ImproperlyConfigured(LLMTwinException):
pass
|
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/utils/misc.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:58.499028 | from typing import Generator
from transformers import AutoTokenizer
from llm_engineering.settings import settings
def flatten(nested_list: list) -> list:
"""Flatten a list of lists into a single list."""
return [item for sublist in nested_list for item in sublist]
def batch(list_: list, size: int) -> Gen... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/utils/split_user_full_name.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:58.567756 | from llm_engineering.domain.exceptions import ImproperlyConfigured
def split_user_full_name(user: str | None) -> tuple[str, str]:
if user is None:
raise ImproperlyConfigured("User name is empty")
name_tokens = user.split(" ")
if len(name_tokens) == 0:
raise ImproperlyConfigured("User name... |
PacktPublishing/LLM-Engineers-Handbook | https://github.com/PacktPublishing/LLM-Engineers-Handbook | null | null | null | null | 4,958 | null | null | mit | null | null | null | null | null | null | null | llm_engineering/application/utils/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:50:58.612123 | from . import misc
from .split_user_full_name import split_user_full_name
__all__ = ["misc", "split_user_full_name"]
|
deepseek-ai/smallpond | https://github.com/deepseek-ai/smallpond | null | null | null | null | 4,950 | null | null | mit | null | null | null | null | null | null | null | examples/shuffle_data.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:00.697645 | from smallpond.contrib.copy_table import StreamCopy
from smallpond.execution.driver import Driver
from smallpond.logical.dataset import ParquetDataSet
from smallpond.logical.node import (
Context,
DataSetPartitionNode,
DataSourceNode,
HashPartitionNode,
LogicalPlan,
SqlEngineNode,
)
def shuffl... |
deepseek-ai/smallpond | https://github.com/deepseek-ai/smallpond | null | null | null | null | 4,950 | null | null | mit | null | null | null | null | null | null | null | benchmarks/file_io_benchmark.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:00.706976 | from smallpond.common import DEFAULT_BATCH_SIZE, DEFAULT_ROW_GROUP_SIZE, GB
from smallpond.contrib.copy_table import CopyArrowTable, StreamCopy
from smallpond.execution.driver import Driver
from smallpond.logical.dataset import ParquetDataSet
from smallpond.logical.node import (
Context,
DataSetPartitionNode,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.