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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/clients/pypi_client.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.704990 | import re
from ..pep440 import PEP440InvalidVersionError
from ..pep440 import PEP440Version
from ..pep440 import PEP440VersionSpecifier
from .json_api_client import JSONApiClient
class Version(PEP440Version):
__slots__ = ["source"]
def __init__(self, string):
self.source = string
super().__... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/add_channel_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.706177 | import re
import sublime
import sublime_plugin
from os.path import isabs, normcase, normpath
from urllib.request import pathname2url
from ..console_write import console_write
from ..settings import pc_settings_filename
from ..show_error import show_error
class AddChannelCommand(sublime_plugin.ApplicationCommand):
... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/clients/github_client.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.735204 | import re
from urllib.parse import urlencode, quote
from ..downloaders.downloader_exception import DownloaderException
from ..package_version import version_match_prefix
from .json_api_client import JSONApiClient
class GitHubClient(JSONApiClient):
@staticmethod
def user_repo_branch(url):
"""
... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/create_package_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.311150 | import sublime_plugin
from ..package_creator import PackageCreator
class CreatePackageCommand(sublime_plugin.ApplicationCommand):
"""
Command to create a regular .sublime-package file
"""
def run(self):
PackageCreator().run()
|
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/disable_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.312439 | import sublime
import sublime_plugin
from ..package_disabler import PackageDisabler
from ..show_error import show_error
class DisablePackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command that accepts a list of packages to disable,
or prompts the user to paste a comma-separated list.
Exa... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/discover_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.339755 | import sublime
import sublime_plugin
class DiscoverPackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command that opens the Package Control website
"""
def run(self):
sublime.run_command('open_url', {'url': 'https://packagecontrol.io/#discover'})
|
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/enable_package_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.345603 | import sublime
from ..package_disabler import PackageDisabler
from .existing_packages_command import ExistingPackagesCommand
class EnablePackageCommand(ExistingPackagesCommand):
"""
A command that removes a package from Sublime Text's ignored packages list
"""
def action(self):
"""
... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/enable_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.359344 | import sublime
import sublime_plugin
from ..package_disabler import PackageDisabler
from ..package_manager import PackageManager
from ..show_error import show_error
class EnablePackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command that accepts a list of packages to enable,
or prompts the use... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/existing_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.360772 | import datetime
import html
import os
import re
import sublime
import sublime_plugin
from .. import package_io
from ..package_manager import PackageManager
from ..show_error import show_message
USE_QUICK_PANEL_ITEM = hasattr(sublime, 'QuickPanelItem')
class ExistingPackagesCommand(sublime_plugin.ApplicationCommand... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/disable_package_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.387318 | import sublime
from ..package_disabler import PackageDisabler
from .existing_packages_command import ExistingPackagesCommand
class DisablePackageCommand(ExistingPackagesCommand):
"""
A command that adds a package to Sublime Text's ignored packages list
"""
def action(self):
"""
Buil... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/add_repository_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.387865 | import re
import sublime
import sublime_plugin
from os.path import isabs, normcase, normpath
from urllib.request import pathname2url
from ..console_write import console_write
from ..settings import pc_settings_filename
from ..show_error import show_error
class AddRepositoryCommand(sublime_plugin.ApplicationCommand... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/install_package_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.420010 | import threading
import sublime
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..console_write import console_write
from ..package_tasks import PackageTaskRunner
from ..show_error import show_message
class InstallPackageCommand(sublime_plugin.ApplicationCommand):
"""
A comman... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/clear_package_cache_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.483217 | import sublime
import sublime_plugin
from ..clear_directory import clear_directory
from ..console_write import console_write
from ..show_error import show_message
from ..sys_path import cache_path, shortpath
class ClearPackageCacheCommand(sublime_plugin.ApplicationCommand):
"""
A command that clears out ST'... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/install_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.931651 | import threading
import sublime
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..console_write import console_write
from ..package_tasks import PackageTaskRunner
from ..show_error import show_error
class InstallPackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/list_available_libraries_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.932933 | import html
import re
import threading
from datetime import datetime
import sublime
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..console_write import console_write
from ..package_manager import PackageManager
from ..show_error import show_message
from ..sys_path import python_versio... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/new_template_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.976764 | import os
import textwrap
import sublime
import sublime_plugin
def reformat(template):
return textwrap.dedent(template).lstrip()
class NewChannelJsonCommand(sublime_plugin.WindowCommand):
def run(self):
view = self.window.new_file()
view.settings().set("default_dir", os.path.join(sublime.pa... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/package_control_disable_debug_mode_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.979200 | import sublime
import sublime_plugin
from ..settings import pc_settings_filename
from ..show_error import show_message
class PackageControlDisableDebugModeCommand(sublime_plugin.ApplicationCommand):
def run(self):
settings_file = pc_settings_filename()
settings = sublime.load_settings(settings_fi... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/list_unmanaged_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:06.980325 | import sublime
from ..settings import load_list_setting, pc_settings_filename
from .list_packages_command import ListPackagesCommand
class ListUnmanagedPackagesCommand(ListPackagesCommand):
"""
A command that shows a list of all packages that are not managed by
Package Control, i.e. that are installed, ... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/list_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:07.002070 | import os
import sublime
from .. import package_io
from .. import sys_path
from .existing_packages_command import ExistingPackagesCommand
class ListPackagesCommand(ExistingPackagesCommand):
"""
A command that shows a list of all installed packages in the quick panel
"""
def action(self):
"... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/package_control_enable_debug_mode_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:07.003173 | import sublime
import sublime_plugin
from ..settings import pc_settings_filename
from ..show_error import show_message
class PackageControlEnableDebugModeCommand(sublime_plugin.ApplicationCommand):
def run(self):
settings_file = pc_settings_filename()
settings = sublime.load_settings(settings_fil... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/package_control_message_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:07.012573 | import sublime_plugin
class PackageControlMessageCommand(sublime_plugin.TextCommand):
view_name = "Package Control Messages"
def run(self, edit, message):
if self.view.name() != self.view_name:
return
eof = self.view.size()
if eof == 0:
message = "{}\n{}\n{}".... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/package_control_insert_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:07.013122 | import sublime_plugin
class PackageControlInsertCommand(sublime_plugin.TextCommand):
"""
A command used by the test runner to display output in the output panel
"""
def run(self, edit, string=''):
self.view.insert(edit, self.view.size(), string)
self.view.show(self.view.size(), True)... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/remove_channel_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:07.088504 | import sublime
import sublime_plugin
from .. import text
from ..settings import pc_settings_filename
from ..show_error import show_message
class RemoveChannelCommand(sublime_plugin.ApplicationCommand):
"""
A command to remove a channel from the user's Package Control settings
Example:
```py
su... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/satisfy_libraries_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:08.119037 | import threading
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..console_write import console_write
from ..package_manager import PackageManager
from ..show_error import show_error
class SatisfyLibrariesCommand(sublime_plugin.ApplicationCommand):
"""
A command that finds all... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/remove_repository_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:08.120057 | import sublime
import sublime_plugin
from ..settings import pc_settings_filename
from ..show_error import show_message
class RemoveRepositoryCommand(sublime_plugin.ApplicationCommand):
"""
A command to remove a repository from the user's Package Control settings
Example:
```py
sublime.run_comm... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/remove_package_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:08.122088 | import threading
from ..activity_indicator import ActivityIndicator
from ..package_tasks import PackageTaskRunner
from .existing_packages_command import ExistingPackagesCommand
class RemovePackageCommand(ExistingPackagesCommand):
"""
A command that presents a list of installed packages, allowing the user to... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/upgrade_package_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:08.123023 | import threading
import sublime
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..console_write import console_write
from ..package_tasks import USE_QUICK_PANEL_ITEM, PackageTaskRunner
from ..show_error import show_message
class UpgradePackageCommand(sublime_plugin.ApplicationCommand):... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/remove_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:08.123496 | import threading
import sublime
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..package_tasks import PackageTaskRunner
from ..show_error import show_error
class RemovePackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command that accepts a list of packages to remove,... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/upgrade_all_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:08.124038 | import threading
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..console_write import console_write
from ..package_tasks import PackageTaskRunner
class UpgradeAllPackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command to automatically upgrade all installed packages... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/revert_package_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:09.339616 | import threading
from ..activity_indicator import ActivityIndicator
from ..package_tasks import PackageTaskRunner
from .existing_packages_command import ExistingPackagesCommand
class RevertPackageCommand(ExistingPackagesCommand):
"""
A command that presents a list of installed packages, allowing the user to... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/deps/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:09.340460 | import os.path
import sys
try:
from .oscrypto import use_ctypes, use_openssl
use_ctypes()
# On Linux we need to use the version of OpenSSL included with Sublime Text
# to prevent conflicts between two different versions of OpenSSL being
# dynamically linked. On ST3, we can't use oscrypto for Open... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/deps/asn1crypto/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:09.340975 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from .version import __version__, __version_info__
__all__ = [
'__version__',
'__version_info__',
'load_order',
]
def load_order():
"""
Returns a list of the module and sub-module names for asn1cry... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/console_write.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:17.845364 | import sys
from . import text
def console_write(string, params=None, strip=True, indent=None, prefix=True):
"""
Writes a value to the Sublime Text console, formatting it for output via
text.format() and then encoding unicode to utf-8
:param string:
The value to write
:param params:
... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/upgrade_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:17.845863 | import threading
import sublime
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..console_write import console_write
from ..package_tasks import PackageTaskRunner
from ..show_error import show_error
class UpgradePackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/satisfy_packages_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:17.958435 | import threading
import sublime_plugin
from ..activity_indicator import ActivityIndicator
from ..package_tasks import PackageTaskRunner
class SatisfyPackagesCommand(sublime_plugin.ApplicationCommand):
"""
A command to sync ``installed_packages`` with filesystem.
It installs missing packages, which are... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/infer.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.058379 | import timeit
import torch
import torch.nn as nn
import numpy as np
import torchvision
import argparse
import os,sys
from datasets.cifar10 import Cifar10Loaders
from utils.utilities import calculate_accuracy, timeGraph,printStats
from models.resnet import resnet18,resnet34
from parser import parse_args
from torch2tr... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.067287 | from setuptools import setup, find_packages
setup(
name='qat',
version="1",
packages=find_packages()
)
|
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/datasets/cifar10.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.074625 | import torch
import torchvision
import torchvision.transforms as transforms
class Cifar10Loaders:
"""
Data loaders for cifar 10 dataset
"""
def __init__(self, data_dir='/tmp/cifar10', download=True, batch_size=128, pin_memory=True, num_workers=4):
self.data_dir = data_dir
self.download ... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | build.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.077413 | import imp
import subprocess
import os
from string import Template
PLUGINS = [
'interpolate',
'group_norm',
]
BASE_FOLDER = 'torch2trt/converters'
NINJA_TEMPLATE = Template((
"rule link\n"
" command = g++ -shared -o $$out $$in -L$torch_dir/lib -L$cuda_dir/lib64 -L$trt_lib_dir -lc10 -lc10_cuda -ltorc... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/models/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.091616 | '''
Contains basic model definitions
'''
import torch
import torch.nn as nn
from utils.utilities import qrelu,qconv2d
class vanilla_cnn(nn.Module):
def __init__(self,qat_mode=False,infer=False):
super().__init__()
self.qat = qat_mode
self.layer1=qconv2d(3,32,padding=1,qat=qat_mode,infer=... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/models/resnet.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.095015 | """
Resnet implementation from Pytorch
"""
import torch
import torch.nn as nn
from utils.utilities import qrelu,qconv2d
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101_2']
model_urls = ... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/parser.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.096258 | import argparse
def parse_args():
"""
"""
parser = argparse.ArgumentParser(description='PyTorch QAT')
parser.add_argument('--tl','--transfer_learning',action='store_true',help='used to map weights correctly')
parser.add_argument('--iter',default=300, type=int, help='no of iterations')
parser.ad... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/train.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.658200 | import torch
import torch.nn as nn
import numpy as np
import torchvision
import argparse
import os,sys
import torch.optim as optim
from datasets.cifar10 import Cifar10Loaders
from models.models import vanilla_cnn
from models.resnet import resnet18 , resnet34
from utils.utilities import calculate_accuracy , add_miss... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/easyocr/generate_data.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.688908 | from argparse import ArgumentParser
import cv2
import torch
import glob
from easyocr import Reader
from torch2trt.dataset import FolderDataset
from torch2trt import torch2trt, TRTModule
import math
import os
parser = ArgumentParser()
parser.add_argument('--images', type=str, default='images')
parser.add_argument('--de... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/contrib/quantization_aware_training/utils/utilities.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.709759 | import torch
import torch.nn as nn
import numpy as np
import collections
from pytorch_quantization import tensor_quant
from torch2trt.contrib.qat.layers.quant_conv import QuantConvBN2d,QuantConv2d,IQuantConv2d, IQuantConvBN2d
from torch2trt.contrib.qat.layers.quant_activation import QuantReLU, IQuantReLU
import torchvi... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/easyocr/optimize_recognizer.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.718180 | from argparse import ArgumentParser
from torch2trt.dataset import FolderDataset
from torch2trt import torch2trt, TRTModule
from easyocr import Reader
import tensorrt as trt
import torch
import time
from tempfile import mkdtemp
parser = ArgumentParser()
parser.add_argument('--detector_data', type=str, default='detecto... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/easyocr/run_end2end.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.719680 | from argparse import ArgumentParser
import cv2
import torch
import glob
from easyocr import Reader
from torch2trt.dataset import FolderDataset
from torch2trt import torch2trt, TRTModule
import math
import time
import os
parser = ArgumentParser()
parser.add_argument('--images', type=str, default='images')
parser.add_ar... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | scripts/dump_converters.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.727808 | import argparse
import sys
import subprocess
import os
from importlib.machinery import SourceFileLoader
torch2trt = SourceFileLoader("torch2trt", "torch2trt/__init__.py").load_module() # to load relative to root
HEADER = """
# Converters
This table contains a list of supported PyTorch methods and their associated c... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | examples/easyocr/optimize_detector.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.746680 | from argparse import ArgumentParser
from torch2trt.dataset import FolderDataset, ListDataset
from torch2trt import torch2trt, TRTModule
from easyocr import Reader
import tensorrt as trt
import torch
import time
from tempfile import mkdtemp
parser = ArgumentParser()
parser.add_argument('--detector_data', type=str, defa... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | scripts/profile_timm.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.748061 | import os
import timm
import torch
import time
import json
from torch2trt import torch2trt, TRTModule, trt
from dataclasses import dataclass, asdict
from argparse_dataclass import ArgumentParser
from typing import Literal
from enum import Enum
from contextlib import redirect_stderr, redirect_stdout
import io
class Sta... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:20.767917 | import sys
import tensorrt
import torch
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
from packaging import version
def trt_inc_dir():
return "/usr/include/aarch64-linux-gnu"
def trt_lib_dir():
return "/usr/lib/aarch64-linux-gnu"... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_contiguous.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.117798 | import torch
from torch2trt import torch2trt
def test_contiguous():
torch.manual_seed(0)
net = torch.nn.Conv2d(3, 10, kernel_size=3)
net.eval().cuda()
test_tensor = torch.randn((1, 25, 25, 3)).cuda().permute((0, 3, 1, 2))
with torch.no_grad():
test_out = net(test_tensor)
with torc... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/converter_tests/test_getitem.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.118940 | import pytest
import torch
import torch.nn as nn
from torch2trt import torch2trt, trt
class YOLOXFocusTestModule(nn.Module):
def forward(self, x):
patch_top_left = x[..., ::2, ::2]
patch_top_right = x[..., ::2, 1::2]
patch_bot_left = x[..., 1::2, ::2]
patch_bot_right = x[..., 1::... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.119826 | import pytest
import torch
import torch.nn as nn
from torch2trt.dataset import (
TensorBatchDataset,
ListDataset,
FolderDataset
)
from tempfile import mkdtemp
def test_dataset_shapes():
dataset = ListDataset()
dataset.insert((torch.randn(1, 3, 32, 32), torch.randn(1, 4)))
dataset.insert((torc... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/converter_tests/test_converters.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.303262 | import pytest
import torch
import torch2trt
import torch.nn as nn
from torch2trt.flattener import Flattener
def cross_validate(
module,
inputs,
fp16_mode: bool,
tol: float
):
module = module
module_trt = torch2trt.torch2trt(
module,
inputs,
f... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_flatten_dynamic.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.428470 | import pytest
from torch2trt import torch2trt, trt
import torch
class FlattenModule(torch.nn.Module):
def __init__(self, start_dim, end_dim):
super().__init__()
self.start_dim = start_dim
self.end_dim = end_dim
def forward(self, x):
return torch.flatten(x, self.start_dim, self... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_flatten_module.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.681273 | import torch
import torch.nn as nn
from torch2trt import torch2trt
def test_flatten_nested_tuple_args():
class TestModule(nn.Module):
def forward(self, x, yz):
return torch.cat([x, yz[0], yz[1]], dim=-1)
module = TestModule().cuda().eval()
data = (
torch.randn(1, 3, 32, 32)... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_legacy_max_batch_size.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.708617 | import torch.nn as nn
import torch
from torch2trt import torch2trt
def test_legacy_max_batch_size():
model = nn.Conv2d(3, 6, kernel_size=1).cuda().eval()
data = torch.randn(1, 3, 32, 32).cuda()
model_trt = torch2trt(model, [data], max_batch_size=4)
data = torch.randn(1, 3, 32, 32).cuda()
out ... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_interpolate_dynamic.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.740146 | import pytest
import torch
import torch.nn.functional as F
from torch2trt import (
torch2trt,
trt
)
def test_interpolate_dynamic_size():
class TestModule(torch.nn.Module):
def forward(self, x):
size = x.size()
return F.interpolate(x, size=(size[2]*2, size[3]*3))
modul... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_flattener.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.745353 | import pytest
import torch
from torch2trt.flattener import Flattener
def test_flattener_from_value():
x = (torch.ones(3), torch.ones(3))
flattener = Flattener.from_value(x)
assert(isinstance(flattener.schema, tuple))
assert(flattener.schema[0] == 0)
assert(flattener.schema[1] == 1)
def test_f... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_save_load.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.810901 | import pytest
import torch2trt
import torchvision
import torch
def test_save_load():
model = torch.nn.Conv2d(3, 3, 1).cuda().eval().half()
data = torch.randn((1, 3, 224, 224)).cuda().half()
print('Running torch2trt...')
model_trt = torch2trt.torch2trt(model, [data], fp16_mode=True, max_workspace_... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_dynamic_shape.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.812266 | import pytest
import torch
import torch.nn as nn
import tensorrt as trt
from torch2trt import torch2trt
from torch2trt.dataset import ListDataset
def test_dynamic_shape_conv2d():
torch.manual_seed(0)
module = nn.Conv2d(3, 6, kernel_size=3, stride=1, padding=1).cuda().eval()
dataset = ListDataset()
... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_tensor_ne.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.919519 | import pytest
import torch
from torch2trt import torch2trt, trt
def test_tensor_ne():
class NotEqual(torch.nn.Module):
def __init__(self):
super(NotEqual, self).__init__()
def forward(self, x, y):
return x != y
module = NotEqual().cuda().eval()
x = torch.rand... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_tensor_shape.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:22.923403 | import pytest
import torch
import torch.nn.functional as F
from torch2trt import (
torch2trt,
trt,
SizeWrapper,
tensorrt_converter
)
def test_tensor_shape_view_trivial():
class TestModule(torch.nn.Module):
def forward(self, x):
size = x.size()
return x.view(size)
... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_tensor_shape_div_batch.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.004292 | import pytest
import torch
from torch2trt import torch2trt, trt
def test_div_constant_batch():
class DivConstantBatch(torch.nn.Module):
def __init__(self):
super(DivConstantBatch, self).__init__()
self.register_buffer('y', torch.ones((1, 3, 10, 10)))
def forward(self, ... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_dataset_calibrator.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.031305 | import pytest
import tensorrt as trt
import torch
import torch.nn as nn
from torch2trt.dataset import (
TensorBatchDataset,
ListDataset
)
from torch2trt import torch2trt
def test_dataset_calibrator_batch_dataset():
torch.manual_seed(0)
class TestModule(nn.Module):
def __init__(self):
... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/feature_tests/test_version_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.256550 | import pytest
import torch2trt.version_utils
def test_version_utils():
a = torch2trt.version_utils.Version("10.1")
assert a >= "10.1"
assert a >= "10.0"
assert a > "7.0"
assert a < "11.0"
assert a == "10.1"
assert a <= "10.1"
assert a <= "10.2" |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/model_tests/timm/test_maxvit.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.355785 | import pytest
import torch2trt
from timm.models.maxxvit import (
maxvit_tiny_rw_224,
maxvit_rmlp_pico_rw_256,
maxvit_rmlp_small_rw_224
)
import torch
def _cross_validate_module(model, shape=(224, 224)):
model = model.cuda()
data = torch.randn(1, 3, *shape).cuda()
model_trt = torch2trt.torch2tr... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/model_tests/torchvision/test_classification_models.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.438625 | import torch
import torchvision
import torch2trt
def _cross_validate_module(model, shape=(224, 224)):
model = model.cuda().eval()
data = torch.randn(1, 3, *shape).cuda()
model_trt = torch2trt.torch2trt(model, [data])
data = torch.randn(1, 3, *shape).cuda()
out = model(data)
out_trt = model_trt... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | torch2trt/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.491621 | from .torch2trt import *
from .converters import *
import tensorrt as trt
def load_plugins():
import torch2trt.torch_plugins
registry = trt.get_plugin_registry()
torch2trt_creators = [c for c in registry.plugin_creator_list if c.plugin_namespace == 'torch2trt']
for c in torch2trt_creators:
regi... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | tests/model_tests/torchvision/test_segmentation_models.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.520076 | import torch
import torchvision
import torch2trt
class ModelWrapper(torch.nn.Module):
def __init__(self, model):
super(ModelWrapper, self).__init__()
self.model = model
def forward(self, x):
return self.model(x)['out']
def _cross_validate_module(model, shape=(224, 224)):
model = ... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | torch2trt/contrib/qat/converters/QuantConv.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.830635 | from torch2trt.torch2trt import *
from torch2trt.module_test import add_module_test
import tensorrt as trt
@tensorrt_converter('torch2trt.contrib.qat.layers.quant_conv.IQuantConv2d.forward', enabled=trt_version() >= '7.0')
def convert_QuantConv(ctx):
module = ctx.method_args[0]
input = ctx.method_args[1]
... |
NVIDIA-AI-IOT/torch2trt | https://github.com/NVIDIA-AI-IOT/torch2trt | null | null | null | null | 4,865 | null | null | mit | null | null | null | null | null | null | null | torch2trt/contrib/qat/converters/QuantConvBN.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:23.903801 | from torch2trt.torch2trt import *
from torch2trt.module_test import add_module_test
import tensorrt as trt
@tensorrt_converter('torch2trt.contrib.qat.layers.quant_conv.IQuantConvBN2d.forward', enabled=trt_version() >= '7.0')
def convert_QuantConv(ctx):
module = ctx.method_args[0]
input = ctx.method_args[1]
... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | dataset/util.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.112744 | from collections import OrderedDict
from collections.abc import Callable, Iterable, Iterator, Mapping
from datetime import date, datetime
from decimal import Decimal
from hashlib import sha1
from typing import Any
from urllib.parse import urlencode, urlparse
from sqlalchemy import Connection, ResultProxy
from sqlalche... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | dataset/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.114144 | import os
import warnings
from typing import Any
from dataset.database import Database
from dataset.table import Table
from dataset.util import DatasetError, OutRow, QueryError, RowFactory, row_factory
# shut up useless SA warning:
warnings.filterwarnings("ignore", "Unicode type received non-unicode bind param value.... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | test/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.117775 | from datetime import datetime
import pytest
import dataset
TEST_CITY_1 = "B€rkeley"
TEST_CITY_2 = "G€lway"
TEST_DATA = [
{"date": datetime(2011, 1, 1), "temperature": 1, "place": TEST_CITY_2},
{"date": datetime(2011, 1, 2), "temperature": -1, "place": TEST_CITY_2},
{"date": datetime(2011, 1, 3), "temper... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | dataset/types.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.124573 | from datetime import date, datetime
from typing import Any
from sqlalchemy import (
JSON,
BigInteger,
Boolean,
Date,
DateTime,
Float,
Integer,
String,
Unicode,
UnicodeText,
)
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.types import TypeEngine, _Binary
MYSQL... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | dataset/chunked.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.128656 | import itertools
from collections.abc import Callable, Sequence
from typing import TYPE_CHECKING
from dataset.util import MutableRow, WriteRow
if TYPE_CHECKING:
from dataset.table import Table
_Callback = Callable[[list[MutableRow]], None]
class InvalidCallbackError(ValueError):
pass
class _Chunker:
... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | dataset/table.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.138116 | import logging
import threading
import warnings
from collections.abc import Iterable, Sequence
from typing import TYPE_CHECKING, Any, Literal
from sqlalchemy import false, func, select
from sqlalchemy.exc import NoSuchTableError
from sqlalchemy.schema import Column, Index
from sqlalchemy.schema import Table as SQLATab... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | test/test_database.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.144530 | import tempfile
import threading
from collections import OrderedDict
from datetime import datetime
import pytest
from sqlalchemy.exc import IntegrityError, SQLAlchemyError
from dataset import connect
from .conftest import TEST_DATA
def test_valid_database_url(db):
assert db.url
def test_database_url_query_st... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | dataset/database.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.149123 | import logging
import threading
from typing import Any, Literal
from urllib.parse import parse_qs, urlparse
from alembic.migration import MigrationContext
from alembic.operations import Operations
from sqlalchemy import Connection, Engine, create_engine, event, inspect
from sqlalchemy.engine.reflection import Inspecto... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.179149 | import os
import sys
sys.path.insert(0, os.path.abspath("../"))
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "dataset"
copyright = "2013-2026, Friedrich Lindenberg, Gregor Aisch, Stefan Wehrmeyer"
version = "2.0.0"
re... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | test/test_row_type.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.737622 | from datetime import datetime
from .conftest import TEST_CITY_1
class Constructor(dict):
"""Very simple low-functionality extension to ``dict`` to
provide attribute access to dictionary contents"""
def __getattr__(self, name):
return self[name]
def test_find_one(db, table):
db.row_type = C... |
pudo/dataset | https://github.com/pudo/dataset | null | null | null | null | 4,860 | null | null | mit | null | null | null | null | null | null | null | test/test_table.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:26.745496 | from datetime import datetime
import pytest
from sqlalchemy.exc import ArgumentError
from sqlalchemy.types import BIGINT, TEXT
from dataset import chunked
from .conftest import TEST_CITY_1, TEST_DATA
def test_insert(table):
assert len(table) == len(TEST_DATA), len(table)
last_id = table.insert(
{"d... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | examples/example.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.875766 | """Example app to login to GitHub using the StatefulBrowser class.
NOTE: This example will not work if the user has 2FA enabled."""
import argparse
from getpass import getpass
import mechanicalsoup
parser = argparse.ArgumentParser(description="Login to GitHub.")
parser.add_argument("username")
args = parser.parse_... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | examples/expl_google.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.877317 | import re
import mechanicalsoup
# Connect to Google
browser = mechanicalsoup.StatefulBrowser()
browser.open("https://www.google.com/")
# Fill-in the form
browser.select_form('form[action="/search"]')
browser["q"] = "MechanicalSoup"
# Note: the button name is btnK in the content served to actual
# browsers, but btnG... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | examples/expl_qwant.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.878474 | """Example usage of MechanicalSoup to get the results from the Qwant
search engine.
"""
import re
import urllib.parse
import mechanicalsoup
# Connect to duckduckgo
browser = mechanicalsoup.StatefulBrowser(user_agent='MechanicalSoup')
browser.open("https://lite.qwant.com/")
# Fill-in the search form
browser.select_... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | mechanicalsoup/browser.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.908725 | import io
import os
import tempfile
import urllib
import weakref
import webbrowser
import bs4
import bs4.dammit
import requests
from .__version__ import __title__, __version__
from .form import Form
from .utils import LinkNotFoundError, is_multipart_file_upload
class Browser:
"""Builds a low-level Browser.
... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | mechanicalsoup/__version__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.909919 | __title__ = 'MechanicalSoup'
__description__ = 'A Python library for automating interaction with websites'
__url__ = 'https://mechanicalsoup.readthedocs.io/'
__github_url__ = 'https://github.com/MechanicalSoup/MechanicalSoup'
__version__ = '1.5.0-dev'
__license__ = 'MIT'
__github_assets_absoluteURL__ = """\
https://raw... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | examples/expl_duck_duck_go.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.912981 | """
Example usage of MechanicalSoup to get the results from DuckDuckGo.
"""
import mechanicalsoup
# Connect to duckduckgo
browser = mechanicalsoup.StatefulBrowser(user_agent="MechanicalSoup")
browser.open("https://duckduckgo.com/")
# Fill-in the search form
browser.select_form('#search_form_homepage')
browser["q"] ... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | examples/example_manual.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.914161 | """Example app to login to GitHub, using the plain Browser class.
See example.py for an example using the more advanced StatefulBrowser."""
import argparse
import mechanicalsoup
parser = argparse.ArgumentParser(description="Login to GitHub.")
parser.add_argument("username")
parser.add_argument("password")
args = pa... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | mechanicalsoup/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.915419 | from .__version__ import __version__
from .browser import Browser
from .form import Form, InvalidFormMethod
from .stateful_browser import StatefulBrowser
from .utils import LinkNotFoundError
__all__ = ['StatefulBrowser', 'LinkNotFoundError', 'Browser', 'Form',
'InvalidFormMethod', '__version__']
|
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | examples/expl_httpbin.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:28.981419 | import mechanicalsoup
browser = mechanicalsoup.StatefulBrowser()
browser.open("http://httpbin.org/")
print(browser.url)
browser.follow_link("forms")
print(browser.url)
print(browser.page)
browser.select_form('form[action="/post"]')
browser["custname"] = "Me"
browser["custtel"] = "00 00 0001"
browser["custemail"] = ... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | mechanicalsoup/form.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:29.476051 | import copy
import io
import warnings
from bs4 import BeautifulSoup
from .utils import LinkNotFoundError, is_multipart_file_upload
class InvalidFormMethod(LinkNotFoundError):
"""This exception is raised when a method of :class:`Form` is used
for an HTML element that is of the wrong type (or is malformed).
... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | tests/test_browser.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:29.524060 | from contextlib import nullcontext
import os
import sys
import tempfile
import pytest
import setpath # noqa:F401, must come before 'import mechanicalsoup'
from bs4 import BeautifulSoup
from requests.cookies import RequestsCookieJar
from utils import mock_get, prepare_mock_browser
import mechanicalsoup
def test_sub... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | mechanicalsoup/stateful_browser.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:29.539803 | import re
import sys
import urllib
import bs4
from .browser import Browser
from .form import Form
from .utils import LinkNotFoundError
from requests.structures import CaseInsensitiveDict
class _BrowserState:
def __init__(self, page=None, url=None, form=None, request=None):
self.page = page
self... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | tests/test_stateful_browser.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:29.540596 | import copy
import json
import os
import re
import sys
import tempfile
import webbrowser
import pytest
import setpath # noqa:F401, must come before 'import mechanicalsoup'
from bs4 import BeautifulSoup
from utils import (mock_get, open_legacy_httpbin, prepare_mock_browser,
setup_mock_browser)
impo... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | mechanicalsoup/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:29.544160 | class LinkNotFoundError(Exception):
"""Exception raised when mechanicalsoup fails to find something.
This happens in situations like (non-exhaustive list):
* :func:`~mechanicalsoup.StatefulBrowser.find_link` is called, but
no link is found.
* The browser was configured with raise_on_404=True an... |
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | tests/test_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:29.560539 | import pytest
import mechanicalsoup
def test_LinkNotFoundError():
with pytest.raises(mechanicalsoup.LinkNotFoundError):
raise mechanicalsoup.utils.LinkNotFoundError
with pytest.raises(Exception):
raise mechanicalsoup.utils.LinkNotFoundError
|
MechanicalSoup/MechanicalSoup | https://github.com/MechanicalSoup/MechanicalSoup | null | null | null | null | 4,854 | null | null | mit | null | null | null | null | null | null | null | tests/test_form.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:29.561281 | import sys
import bs4
import pytest
import setpath # noqa:F401, must come before 'import mechanicalsoup'
from utils import setup_mock_browser
import mechanicalsoup
def test_construct_form_fail():
"""Form objects must be constructed from form html elements."""
soup = bs4.BeautifulSoup('<notform>This is not ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.