repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/admin_mixins.py
django_zombodb/admin_mixins.py
from django.contrib.admin.views.main import SEARCH_VAR from django.db.models import FloatField from django.db.models.expressions import Value from django.utils.translation import gettext as _ from django_zombodb.helpers import validate_query_string class ZomboDBAdminMixin: max_search_results = None def get...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/operations.py
django_zombodb/operations.py
from django.contrib.postgres.operations import CreateExtension class ZomboDBExtension(CreateExtension): def __init__(self): self.name = 'zombodb'
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/serializers.py
django_zombodb/serializers.py
from elasticsearch.serializer import JSONSerializer ES_JSON_SERIALIZER = JSONSerializer()
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/exceptions.py
django_zombodb/exceptions.py
class InvalidElasticsearchQuery(Exception): pass
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/querysets.py
django_zombodb/querysets.py
from django.db import connection, models from django.db.models.expressions import RawSQL from elasticsearch_dsl import Search from django_zombodb.exceptions import InvalidElasticsearchQuery from django_zombodb.helpers import validate_query_dict, validate_query_string from django_zombodb.serializers import ES_JSON_SER...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/helpers.py
django_zombodb/helpers.py
from django.core.exceptions import ImproperlyConfigured from django.db import connection from django_zombodb.indexes import ZomboDBIndex from django_zombodb.serializers import ES_JSON_SERIALIZER def get_zombodb_index_from_model(model): for index in model._meta.indexes: if isinstance(index, ZomboDBIndex):...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/base_indexes.py
django_zombodb/base_indexes.py
# From Django 2.1, for Django < 2.1 from django.db.models import Index from django.utils.functional import cached_property class PostgresIndex(Index): @cached_property def max_name_length(self): # Allow an index name longer than 30 characters when the suffix is # longer than the usual 3 chara...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/__init__.py
django_zombodb/__init__.py
__version__ = '0.3.0'
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/apps.py
django_zombodb/apps.py
# -*- coding: utf-8 from django.apps import AppConfig class DjangoZomboDBConfig(AppConfig): name = 'django_zombodb'
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/django_zombodb/indexes.py
django_zombodb/indexes.py
import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django_zombodb.serializers import ES_JSON_SERIALIZER try: from django.contrib.postgres.indexes import PostgresIndex except ImportError: # Django < 2.1 from django_zombodb.base_indexes import Postgr...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/test_index.py
tests/test_index.py
from collections import OrderedDict import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import connection from django.test import TestCase, override_settings from django_zombodb.indexes import ZomboDBIndex from .models import DateTimeArrayModel, Integ...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/test_admin_mixins.py
tests/test_admin_mixins.py
from django.contrib import admin from django.contrib.auth.models import User from django.test import TransactionTestCase from django.test.client import RequestFactory from django.urls import reverse from django_zombodb.admin_mixins import ZomboDBAdminMixin from .restaurants.admin import RestaurantAdmin from .restaura...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/models.py
tests/models.py
from django.contrib.postgres.fields import ArrayField from django.db import models class IntegerArrayModel(models.Model): field = ArrayField(models.IntegerField(), default=list, blank=True) class DateTimeArrayModel(models.Model): datetimes = ArrayField(models.DateTimeField()) dates = ArrayField(models.D...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/settings.py
tests/settings.py
# -*- coding: utf-8 from __future__ import absolute_import, unicode_literals from decouple import config ZOMBODB_ELASTICSEARCH_URL = 'http://localhost:9200/' DEBUG = False USE_TZ = True SECRET_KEY = 'test' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'USER': '...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/__init__.py
tests/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/test_querysets.py
tests/test_querysets.py
from django.core.exceptions import ImproperlyConfigured from django.test import TransactionTestCase, override_settings from elasticsearch_dsl import Q as ElasticsearchQ from elasticsearch_dsl import Search from elasticsearch_dsl.query import Term from django_zombodb.exceptions import InvalidElasticsearchQuery from ....
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/test_apps.py
tests/test_apps.py
from django.apps import apps from django.test import TestCase, modify_settings @modify_settings(INSTALLED_APPS={'append': 'django_zombodb'}) class AppsTests(TestCase): def test_apps(self): app = apps.get_app_config('django_zombodb') self.assertEqual(app.name, 'django_zombodb')
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/urls.py
tests/urls.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.conf.urls import url from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), ]
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/migrations/0002_datetimearraymodel_integerarraymodel.py
tests/migrations/0002_datetimearraymodel_integerarraymodel.py
# Generated by Django 2.1.5 on 2019-02-11 19:30 import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('tests', '0001_setup_extensions'), ] operations = [ migrations.CreateModel( ...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/migrations/0001_setup_extensions.py
tests/migrations/0001_setup_extensions.py
from django.db import migrations from django_zombodb.operations import ZomboDBExtension class Migration(migrations.Migration): operations = [ ZomboDBExtension(), ]
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/migrations/__init__.py
tests/migrations/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/restaurants/admin.py
tests/restaurants/admin.py
from django.contrib import admin from django_zombodb.admin_mixins import ZomboDBAdminMixin from .models import Restaurant class RestaurantAdmin(ZomboDBAdminMixin, admin.ModelAdmin): model = Restaurant list_display = ( 'name', '_zombodb_score', 'street', 'zip_code', 'c...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/restaurants/models.py
tests/restaurants/models.py
import uuid from django.contrib.postgres.fields import ArrayField from django.db import models from django.db.models.indexes import Index from django_zombodb.indexes import ZomboDBIndex from django_zombodb.querysets import SearchQuerySet class Restaurant(models.Model): id = models.UUIDField(primary_key=True, de...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/restaurants/__init__.py
tests/restaurants/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/restaurants/apps.py
tests/restaurants/apps.py
from django.apps import AppConfig class RestaurantsConfig(AppConfig): name = 'restaurants'
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/restaurants/migrations/0001_initial.py
tests/restaurants/migrations/0001_initial.py
# Generated by Django 2.0.13 on 2019-02-12 15:29 import django.contrib.postgres.fields from django.db import migrations, models import django_zombodb.indexes import uuid class Migration(migrations.Migration): initial = True dependencies = [ ('tests', '0001_setup_extensions'), ] operations ...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/tests/restaurants/migrations/__init__.py
tests/restaurants/migrations/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/manage.py
example/manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/example/settings.py
example/example/settings.py
import os from decouple import config # django-zombodb settings ZOMBODB_ELASTICSEARCH_URL = 'http://localhost:9200/' # Django settings BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/dev/...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/example/__init__.py
example/example/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/example/wsgi.py
example/example/wsgi.py
""" WSGI config for example project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/example/urls.py
example/example/urls.py
from django.conf.urls import url from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), ]
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/admin.py
example/restaurants/admin.py
from django.contrib import admin from django_zombodb.admin_mixins import ZomboDBAdminMixin from restaurants.models import Restaurant @admin.register(Restaurant) class RestaurantAdmin(ZomboDBAdminMixin, admin.ModelAdmin): model = Restaurant list_display = ( 'name', '_zombodb_score', 's...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/models.py
example/restaurants/models.py
import uuid from django.contrib.postgres.fields import ArrayField from django.db import models from django_zombodb.indexes import ZomboDBIndex from django_zombodb.querysets import SearchQuerySet class Restaurant(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) url =...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/__init__.py
example/restaurants/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/apps.py
example/restaurants/apps.py
from django.apps import AppConfig class RestaurantsConfig(AppConfig): name = 'restaurants'
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/management/__init__.py
example/restaurants/management/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/management/commands/filldata.py
example/restaurants/management/commands/filldata.py
import os from django.conf import settings from django.core.management.base import BaseCommand from django.db import connection from restaurants.models import Restaurant class Command(BaseCommand): help = 'Closes the specified poll for voting' def handle(self, *args, **options): csv_file_path = os....
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/management/commands/__init__.py
example/restaurants/management/commands/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/migrations/__init__.py
example/restaurants/migrations/__init__.py
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
vintasoftware/django-zombodb
https://github.com/vintasoftware/django-zombodb/blob/2391f27709819bd135e3d0dd571ef42e6996a201/example/restaurants/migrations/0001_squashed_0004_auto_20190718_2025.py
example/restaurants/migrations/0001_squashed_0004_auto_20190718_2025.py
# Generated by Django 2.2.3 on 2019-10-02 20:08 import django.contrib.postgres.fields from django.db import migrations, models import django_zombodb.indexes import django_zombodb.operations import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ m...
python
MIT
2391f27709819bd135e3d0dd571ef42e6996a201
2026-01-05T07:09:01.604399Z
false
tuantle/regression-losses-pytorch
https://github.com/tuantle/regression-losses-pytorch/blob/2893f4439ada5df239e3afd0ec7e781dd61403e9/regression_losses.py
regression_losses.py
#!/usr/bin/env python # ------------------------------------------------------------------------ # # Experimenting regression losses. # # Author Tuan Le (tuan.t.lei@gmail.com) # # ------------------------------------------------------------------------ from __future__ import absolute_import from __future__ import divis...
python
MIT
2893f4439ada5df239e3afd0ec7e781dd61403e9
2026-01-05T07:08:49.163415Z
false
rosineygp/proxmox-pci-switcher
https://github.com/rosineygp/proxmox-pci-switcher/blob/945ff062842434c64c43ad18808ec1c1ae669560/setup.py
setup.py
import os from setuptools import find_packages, setup _version = os.getenv("MKDKR_BRANCH_NAME", "0.0.0").replace("v", "") with open("README.md") as f: long_description = f.read() setup( name="proxmox-pci-switcher", version=_version, description="Switch among Guest VMs organized by Resource Pool", ...
python
MIT
945ff062842434c64c43ad18808ec1c1ae669560
2026-01-05T07:09:02.484770Z
false
rosineygp/proxmox-pci-switcher
https://github.com/rosineygp/proxmox-pci-switcher/blob/945ff062842434c64c43ad18808ec1c1ae669560/tests/test_expand_config_path.py
tests/test_expand_config_path.py
import unittest from unittest.mock import patch from proxmox_pci_switcher import expand_config_path from pathlib import Path class TestExpandConfigPath(unittest.TestCase): @patch("proxmox_pci_switcher.os.name", "posix") def test_expand_config_path_default_linux(self): _home = Path.home() se...
python
MIT
945ff062842434c64c43ad18808ec1c1ae669560
2026-01-05T07:09:02.484770Z
false
rosineygp/proxmox-pci-switcher
https://github.com/rosineygp/proxmox-pci-switcher/blob/945ff062842434c64c43ad18808ec1c1ae669560/proxmox_pci_switcher/proxmox_pci_switcher.py
proxmox_pci_switcher/proxmox_pci_switcher.py
import urllib3 from proxmoxer import ProxmoxAPI import yaml from argh import named, aliases, arg, dispatch_commands import os from tabulate import tabulate import sys from importlib.machinery import SourceFileLoader urllib3.disable_warnings() DEFAULT_LINUX_PATH = "~/.config/proxmox-pci-switcher/config.yaml" DEFAULT_W...
python
MIT
945ff062842434c64c43ad18808ec1c1ae669560
2026-01-05T07:09:02.484770Z
false
rosineygp/proxmox-pci-switcher
https://github.com/rosineygp/proxmox-pci-switcher/blob/945ff062842434c64c43ad18808ec1c1ae669560/proxmox_pci_switcher/__init__.py
proxmox_pci_switcher/__init__.py
# flake8: noqa from proxmox_pci_switcher.proxmox_pci_switcher import *
python
MIT
945ff062842434c64c43ad18808ec1c1ae669560
2026-01-05T07:09:02.484770Z
false
rosineygp/proxmox-pci-switcher
https://github.com/rosineygp/proxmox-pci-switcher/blob/945ff062842434c64c43ad18808ec1c1ae669560/proxmox_pci_switcher/ui/main.py
proxmox_pci_switcher/ui/main.py
from kivymd.app import MDApp from kivymd.uix.list import TwoLineAvatarIconListItem, IconLeftWidget from kivymd.uix.button import MDFlatButton, MDRaisedButton from kivymd.uix.dialog import MDDialog from kivymd.uix.snackbar import Snackbar from kivy.clock import Clock from kivy import Logger import os from proxmox_pci_s...
python
MIT
945ff062842434c64c43ad18808ec1c1ae669560
2026-01-05T07:09:02.484770Z
false
rosineygp/proxmox-pci-switcher
https://github.com/rosineygp/proxmox-pci-switcher/blob/945ff062842434c64c43ad18808ec1c1ae669560/proxmox_pci_switcher/ui/__init__.py
proxmox_pci_switcher/ui/__init__.py
# flake8: noqa
python
MIT
945ff062842434c64c43ad18808ec1c1ae669560
2026-01-05T07:09:02.484770Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/client.py
client.py
""" A simple demo client. It connects to a channel, announces it's alive, then waits for commands, printing any packets it receives and running any shell commands its told to, then returning the output of those shell commands. """ import json import random import string from subprocess import check_output from snea...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/server.py
server.py
""" A simple demo server. It waits to receive connections from a client, then instructs that client to run `ls -al`, waits for the results, and prints them. Should work with multiple clients but honestly anything more than what I described above is untested. """ import json import random import string from time impor...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/exfil.py
sneakers/exfil.py
#!/usr/bin/python2 import os import math import pkgutil import base94 from sneakers.errors import ExfilChannel, ExfilEncoder from sneakers.channels.file import File from sneakers.channels.soundcloudChannel import Soundcloudchannel from sneakers.channels.tumblrText import Tumblrtext from sneakers.channels.twitter impo...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/util.py
sneakers/util.py
""" Utility functions for screep. """ import json def jsonParse(strArg): """ A utility to handle a string argument by either parsing it directly as JSON or, if that fails, loading a JSON file at that filepath. :param strArg: Either a JSON string or filepath to a JSON file :type strArg: str ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/modules.py
sneakers/modules.py
""" Contains classes for channels and encoders to inherit from. """ from sneakers.errors import ExfilChannel, ExfilEncoder """ Parameter Class Handles the possible parameters that can be passed to each channel. """ class Parameter(object): def __init__(self, name, required, description, default = None): ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/errors.py
sneakers/errors.py
class ExfilError(Exception): pass class ExfilChannel(ExfilError): def __init__(self, val): self.value = val def __str__(self): return repr(self.value) class ExfilEncoder(ExfilError): def __init__(self, val): self.value = val def __str__(self): return repr(self.v...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/__init__.py
sneakers/__init__.py
from sneakers.exfil import Exfil
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/base94.py
sneakers/base94.py
import string import math alphabet = string.ascii_letters + string.digits + string.punctuation base = len(alphabet) def encode(num): if not isinstance(num, int): raise TypeError("can only encode integers") if num < 0: raise ValueError("only positive numbers can be encoded") if num == 0: re...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/tests/__init__.py
sneakers/tests/__init__.py
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/tests/test_all.py
sneakers/tests/test_all.py
import unittest import json import random import string import os from unittest.case import SkipTest from nose.tools import assert_equals, assert_in from functools import partial from twython import TwythonError import sneakers basePath = os.path.dirname(os.path.abspath(sneakers.__file__)) def unit_channel(channel,...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/tests/test_channels/test_twitter.py
sneakers/tests/test_channels/test_twitter.py
import unittest import json import random import string import os from unittest.case import SkipTest import twython from twython import TwythonError from sneakers.channels import twitter import sneakers basePath = os.path.dirname(os.path.abspath(sneakers.__file__)) class TwitterTest(unittest.TestCase): def setU...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/tests/test_channels/test_google.py
sneakers/tests/test_channels/test_google.py
import unittest import json import random import string import os from oauth2client.client import SignedJwtAssertionCredentials import gspread from unittest.case import SkipTest from sneakers.channels import googleSpread import sneakers basePath = os.path.dirname(os.path.abspath(sneakers.__file__)) class GoogleTest(...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/tests/test_channels/test_tumblr.py
sneakers/tests/test_channels/test_tumblr.py
import unittest import json import random import string import os from unittest.case import SkipTest import pytumblr from sneakers.channels import tumblrText from sneakers.modules import Parameter import sneakers basePath = os.path.dirname(os.path.abspath(sneakers.__file__)) class TestTumblr(unittest.TestCase): ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/tests/test_encoders/test_rsa.py
sneakers/tests/test_encoders/test_rsa.py
import unittest import string import random import os from Crypto.PublicKey import RSA from unittest.case import SkipTest from sneakers.encoders.rsa import Rsa import sneakers basePath = os.path.dirname(os.path.abspath(sneakers.__file__)) class TestRsa(unittest.TestCase): def setUp(self): self.randText = ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/tests/test_encoders/test_b64.py
sneakers/tests/test_encoders/test_b64.py
import unittest import string import base64 import random from sneakers.encoders.b64 import B64 class TestB64(unittest.TestCase): def setUp(self): self.randText = ''.join([random.choice(string.letters) for i in range(10)]) self.b64 = B64() def test_encode(self): encoded = self.b64.enc...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/encoders/lendiansteganography.py
sneakers/encoders/lendiansteganography.py
# Lendian stegonography system # As of right now this can only encode the data # into randomly generated integers. from sneakers.modules import Encoder import random class Lendiansteganography(Encoder): description = """\ Encodes data into the least significant two bits of randomly generated signed integ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/encoders/identity.py
sneakers/encoders/identity.py
from sneakers.modules import Encoder class Identity(Encoder): description = """\ An encoder that does no encoding. Ironic, but also useful for testing channels. Or not encoding/decoding. """ def encode(self, data): return data def decode(self, data): return data
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/encoders/rsa.py
sneakers/encoders/rsa.py
from sneakers.modules import Encoder, Parameter from Crypto.Cipher import PKCS1_OAEP from Crypto.PublicKey import RSA as cryptoRSA class Rsa(Encoder): description = """\ Encrypts data using RSA. """ params = { 'sending': [ Parameter('publicKey', True, 'The filename of the publ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/encoders/__init__.py
sneakers/encoders/__init__.py
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/encoders/aes.py
sneakers/encoders/aes.py
from sneakers.modules import Encoder, Parameter import scrypt import base64 # note that the class name *must* be title cased class Aes(Encoder): description = """\ Encrypts data using AES and the provided encryption key. The resulting bits are then base64 encoded to allow them to be represented as text. ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/encoders/b64.py
sneakers/encoders/b64.py
from sneakers.modules import Encoder import base64 class B64(Encoder): def encode(self, data): return base64.b64encode(data) def decode(self, data): return base64.urlsafe_b64decode(str(data))
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/channels/tumblrText.py
sneakers/channels/tumblrText.py
# Written by Dakota Nelson (@jerkota) from sneakers.modules import Channel, Parameter import random import string import pytumblr class Tumblrtext(Channel): description = """\ Posts data to Tumblr as text. """ params = { 'sending': [ Parameter('username', True, 'Your Tumblr u...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/channels/salesforce.py
sneakers/channels/salesforce.py
# Written by Dakota Nelson (@jerkota) from sneakers.modules import Channel, Parameter import random import string import requests import json class Salesforce(Channel): description = """\ Posts data to Salesforce as a "Document" upload. See https://developer.salesforce.com/docs/atlas.en-us.api_re...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/channels/file.py
sneakers/channels/file.py
from sneakers.modules import Channel, Parameter class File(Channel): description = """\ Reads or writes data to or from a file with the specified name. Useful for testing and out of band transfer. """ params = { 'sending': [ Parameter('filename', True, 'Name of the file to...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/channels/twitter.py
sneakers/channels/twitter.py
# This module written by Gabriel Butterick and Bonnie Ishiguro from sneakers.modules import Channel, Parameter from twython import Twython, TwythonError import time class Twitter(Channel): description = """\ Posts data to Twitter as a series of 280 character Tweets. """ params = { 'sendi...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/channels/__init__.py
sneakers/channels/__init__.py
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/channels/googleSpread.py
sneakers/channels/googleSpread.py
# Authors: Gabriel Butterick and Bonnie Ishiguro import time import json import gspread from oauth2client.client import SignedJwtAssertionCredentials from sneakers.modules import Channel, Parameter class GoogleSpread(Channel): description = """\ Posts data to Google Spreadsheets. """ params = { ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
DakotaNelson/sneaky-creeper
https://github.com/DakotaNelson/sneaky-creeper/blob/d5b960e265c13baa6df647436bbd74bbad1847cd/sneakers/channels/soundcloudChannel.py
sneakers/channels/soundcloudChannel.py
import random import struct import wave import sys import soundcloud import os, re, urllib from sneakers.modules import Channel, Parameter class Soundcloudchannel(Channel): description = """\ Posts data to Soundcloud encoded into randomly generated WAV files. """ params = { 'sending': ...
python
MIT
d5b960e265c13baa6df647436bbd74bbad1847cd
2026-01-05T07:09:03.487927Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/setup.py
setup.py
#!/usr/bin/env python3 """ To install this package, change to the directory of this file and run pip3 install --user . (the ``--user`` flag installs the package for your user account only, otherwise you will need administrator rights). """ from __future__ import annotations # std import site import sys from pa...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/paths.py
ankipandas/paths.py
""" Convenience functions to find the database and other system locations without the user having to specify full paths. """ from __future__ import annotations import collections import datetime # std import os import shutil from functools import lru_cache from pathlib import Path, PurePath from typing import Defaul...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/ankidf.py
ankipandas/ankidf.py
# std from __future__ import annotations import copy import pathlib import time from contextlib import closing from sqlite3 import Connection from typing import Any, Iterable, Sequence # 3rd import numpy as np import pandas as pd import ankipandas._columns as _columns # ours import ankipandas.raw as raw from ankipa...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
true
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/raw.py
ankipandas/raw.py
""" These function implement the more direct interactions with the Anki database and provide basic functionality that is then used to implement the functionality in :class:`~ankipandas.collection.Collection`, :class:`ankipandas.ankidf.AnkiDataFrame` etc. .. warning:: Please only use these function if you know wha...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/conftest.py
ankipandas/conftest.py
from __future__ import annotations from ankipandas.util.log import set_debug_log_level set_debug_log_level()
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/_columns.py
ankipandas/_columns.py
# std from __future__ import annotations import copy from pathlib import Path from typing import Any import numpy as np # 3rd import pandas as pd # ours from ankipandas.util.misc import invert_dict # todo: Docstrings, cleanup tables_ours2anki = {"revs": "revlog", "cards": "cards", "notes": "notes"} tables_anki2o...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/__init__.py
ankipandas/__init__.py
# ours from __future__ import annotations import ankipandas.raw import ankipandas.util from ankipandas.ankidf import AnkiDataFrame from ankipandas.collection import Collection from ankipandas.paths import db_path_input, find_db from ankipandas.util.log import log, set_debug_log_level, set_log_level
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/collection.py
ankipandas/collection.py
# std from __future__ import annotations import sqlite3 import time from contextlib import closing from pathlib import Path, PurePath from typing import Any # ours import ankipandas.paths import ankipandas.raw as raw from ankipandas.ankidf import AnkiDataFrame from ankipandas.util.log import log class Collection: ...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/dataframe.py
ankipandas/util/dataframe.py
""" DataFrame utilities. """ # std from __future__ import annotations # 3rd import pandas as pd # ours from ankipandas.util.log import log def _sync_metadata(df_ret: pd.DataFrame, df_old: pd.DataFrame) -> None: """ If the df_old has a `_metadata` field, containing a list of attribute names that contain...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/guid.py
ankipandas/util/guid.py
from __future__ import annotations import random import string # Directly copied from anki utils! # used in ankiweb def _base62(num, extra=""): s = string table = s.ascii_letters + s.digits + extra buf = "" while num: num, i = divmod(num, len(table)) buf = table[i] + buf return b...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/checksum.py
ankipandas/util/checksum.py
from __future__ import annotations import re from hashlib import sha1 from html.entities import name2codepoint # Implementation directly copied from Anki (anki/anki/utils.py). # Only a bit of PEP8ing and making things private. _reComment = re.compile("(?s)<!--.*?-->") _reStyle = re.compile("(?si)<style.*?>.*?</style...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/log.py
ankipandas/util/log.py
# std from __future__ import annotations import logging import colorlog LOG_DEFAULT_LEVEL = logging.INFO def get_logger(): """Sets up global logger.""" _log = colorlog.getLogger("AnkiPandas") if _log.handlers: # the logger already has handlers attached to it, even though # we didn't ad...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/misc.py
ankipandas/util/misc.py
# std from __future__ import annotations import collections from typing import Any def invert_dict(dct: dict) -> dict: """Invert dictionary, i.e. reverse keys and values. Args: dct: Dictionary Returns: Dictionary with reversed keys and values. Raises: :class:`ValueError` if...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/__init__.py
ankipandas/util/__init__.py
""" Various utilities of this package. .. warning:: These utilities are less aimed at end users and might therefore be subject to change. """ from __future__ import annotations import ankipandas.util.checksum import ankipandas.util.dataframe import ankipandas.util.log import ankipandas.util.misc
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/types.py
ankipandas/util/types.py
def is_list_like(obj): """True if object type is similar to list, tuple etc.""" return isinstance(obj, (tuple, list)) def is_list_list_like(obj): """True if object is like-like object of list-like objects""" return is_list_like(obj) and all(map(is_list_like, obj)) def is_list_dict_like(obj): """...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/test/test_types.py
ankipandas/util/test/test_types.py
# std from __future__ import annotations import unittest from ankipandas.util.log import set_debug_log_level # ours from ankipandas.util.types import ( is_dict_list_like, is_list_dict_like, is_list_like, is_list_list_like, ) class TestTypes(unittest.TestCase): def setUp(self): set_debug...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/test/test_log.py
ankipandas/util/test/test_log.py
# std from __future__ import annotations import unittest # ours from ankipandas.util.log import get_logger, log, set_log_level class TestLogging(unittest.TestCase): """Only tests that things run without error.""" def test_log(self): log.info("Test info") log.warning("Test warning") def...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/test/test_dataframe.py
ankipandas/util/test/test_dataframe.py
# std from __future__ import annotations import unittest # 3rd import pandas as pd # ours from ankipandas.util.dataframe import replace_df_inplace class TestUtils(unittest.TestCase): def test__replace_df_inplace(self): df = pd.DataFrame({"a": [1, 2], "b": [3, 4]}) df_new = pd.DataFrame({"a": [1...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/test/__init__.py
ankipandas/util/test/__init__.py
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/util/test/test_misc.py
ankipandas/util/test/test_misc.py
# std from __future__ import annotations import unittest # ours from ankipandas.util.misc import invert_dict class TestInvertDict(unittest.TestCase): def test_ok(self): a = {1: 2, 3: 4, 5: 6} self.assertDictEqual(invert_dict(a), {2: 1, 4: 3, 6: 5}) def test_fails(self): a = {1: 2, 3...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/test/test_ankidf.py
ankipandas/test/test_ankidf.py
""" Most of the functionality of the AnkiDataFrames is already tested in test_core, because that saves to write a lot of duplicate code. Everything else is tested here. """ from __future__ import annotations import copy # std import pathlib import unittest # 3rd import numpy as np import ankipandas._columns as _c...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
true
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/test/util.py
ankipandas/test/util.py
# std from __future__ import annotations import pathlib # 3rd import pytest _test_db_paths = [ pathlib.Path(__file__).resolve().parent / "data" / "few_basic_cards" / "collection.anki2", pathlib.Path(__file__).resolve().parent / "data" / "few_basic_cards" / "collection_v1.anki2", ] d...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false
klieret/AnkiPandas
https://github.com/klieret/AnkiPandas/blob/0b17a1870711d4adc3e9fc82bff8aac986b09f5e/ankipandas/test/test_paths.py
ankipandas/test/test_paths.py
# std from __future__ import annotations import collections import tempfile import unittest from pathlib import Path # 3rd from randomfiletree import iterative_gaussian_tree, sample_random_elements # ours import ankipandas.paths as paths from ankipandas.util.log import set_debug_log_level from ankipandas.util.misc i...
python
MIT
0b17a1870711d4adc3e9fc82bff8aac986b09f5e
2026-01-05T07:09:04.346970Z
false