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
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/jsonrpc_adapter.py
null
null
null
null
null
null
Python
2026-05-04T02:51:39.921756
import logging from collections.abc import AsyncIterable, AsyncIterator from typing import TYPE_CHECKING, Any from sse_starlette.sse import EventSourceResponse from starlette.responses import JSONResponse if TYPE_CHECKING: from starlette.requests import Request from a2a.server.request_handlers.request_hand...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/grpc_handler.py
null
null
null
null
null
null
Python
2026-05-04T02:51:39.962757
# ruff: noqa: N802 import logging from collections.abc import AsyncIterable, Awaitable, Callable from typing import TypeVar import grpc import grpc.aio from google.protobuf import empty_pb2 from a2a.compat.v0_3 import ( a2a_v0_3_pb2, a2a_v0_3_pb2_grpc, proto_utils, ) from a2a.compat.v0_3 import ( ty...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/jsonrpc_transport.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.206587
import json import logging from collections.abc import AsyncGenerator from typing import Any, NoReturn from uuid import uuid4 import httpx from jsonrpc.jsonrpc2 import JSONRPC20Request, JSONRPC20Response from a2a.client.client import ClientCallContext from a2a.client.errors import A2AClientError from a2a.client.tra...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/model_conversions.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.387873
"""Database model conversions for v0.3 compatibility.""" from typing import TYPE_CHECKING if TYPE_CHECKING: from cryptography.fernet import Fernet from a2a.compat.v0_3 import types as types_v03 from a2a.compat.v0_3.conversions import ( to_compat_push_notification_config, to_compat_task, to_core_tas...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/context_builders.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.430584
"""Context builders that add v0.3 backwards-compatibility for extensions. The current spec uses ``A2A-Extensions`` (RFC 6648, no ``X-`` prefix). v0.3 clients still send the old ``X-A2A-Extensions`` name, so the v0.3 compat adapters wrap the default builders with these classes to recognize both names. """ from typing ...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/proto_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.438899
# mypy: disable-error-code="arg-type" """This file was migrated from the a2a-python SDK version 0.3. It provides utilities for converting between legacy v0.3 Pydantic models and legacy v0.3 Protobuf definitions. """ import json import logging import re from typing import Any from google.protobuf import json_format,...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/request_handler.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.491626
import logging import typing from collections.abc import AsyncIterable from a2a.compat.v0_3 import conversions from a2a.compat.v0_3 import types as types_v03 from a2a.server.context import ServerCallContext from a2a.server.request_handlers.request_handler import RequestHandler from a2a.types.a2a_pb2 import Task from ...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/rest_adapter.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.533554
import functools import json import logging from collections.abc import AsyncIterable, AsyncIterator, Awaitable, Callable from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from sse_starlette.sse import EventSourceResponse from starlette.requests import Request from starlette.responses import JSONRe...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/rest_handler.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.762906
import logging from collections.abc import AsyncIterator from typing import TYPE_CHECKING, Any from google.protobuf.json_format import MessageToDict, Parse if TYPE_CHECKING: from starlette.requests import Request from a2a.server.request_handlers.request_handler import RequestHandler _package_starlette...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/rest_transport.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.851664
import contextlib import json import logging from collections.abc import AsyncGenerator from typing import Any, NoReturn import httpx from google.protobuf.json_format import MessageToDict, Parse, ParseDict from a2a.client.client import ClientCallContext from a2a.client.errors import A2AClientError from a2a.client.t...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/versions.py
null
null
null
null
null
null
Python
2026-05-04T02:51:40.956576
"""Utility functions for protocol version comparison and validation.""" from packaging.version import InvalidVersion, Version from a2a.utils.constants import PROTOCOL_VERSION_0_3, PROTOCOL_VERSION_1_0 def is_legacy_version(version: str | None) -> bool: """Determines if the given version is a legacy protocol ver...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/extensions/common.py
null
null
null
null
null
null
Python
2026-05-04T02:51:41.045741
from a2a.types.a2a_pb2 import AgentCard, AgentExtension HTTP_EXTENSION_HEADER = 'A2A-Extensions' def get_requested_extensions(values: list[str]) -> set[str]: """Get the set of requested extensions from an input list. This handles the list containing potentially comma-separated values, as occurs when us...
a2aproject/a2a-python
https://github.com/a2aproject/a2a-python
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
src/a2a/compat/v0_3/conversions.py
null
null
null
null
null
null
Python
2026-05-04T02:51:44.879606
import base64 from typing import Any from google.protobuf.json_format import MessageToDict, ParseDict from a2a.compat.v0_3 import types as types_v03 from a2a.compat.v0_3.versions import is_legacy_version from a2a.types import a2a_pb2 as pb2_v10 from a2a.utils import constants, errors _COMPAT_TO_CORE_TASK_STATE: di...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/command_helper.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.935316
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/doc_managers/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.945823
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/constants.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.949900
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/config.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.950494
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0# # Unless required by applicable law or agreed to in writing...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/doc_managers/formatters.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.954414
import base64 import datetime import re from uuid import UUID from math import isnan, isinf import logging import bson import bson.json_util long = int unicode = str LOG = logging.getLogger(__name__) RE_TYPE = type(re.compile("")) try: from bson.regex import Regex RE_TYPES = (RE_TYPE, Regex) except Impor...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/compat.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.966604
"""Deprecated compat library, retained for doc managers""" import sys import warnings from urllib.request import Request from urllib.request import urlopen from urllib.parse import urlencode from urllib.error import URLError from urllib.error import HTTPError __all__ = [ 'Request', 'urlopen', 'urlencode', 'URLEr...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/doc_managers/doc_manager_base.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.970511
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/doc_managers/doc_manager_simulator.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.972837
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/connector.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.986435
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0# # Unless required by applicable law or agreed to in writing...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:51:46.994315
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/locking_dict.py
null
null
null
null
null
null
Python
2026-05-04T02:51:47.934038
import threading class LockingDict: def __init__(self): self.dict = {} self.lock = threading.Lock() def __enter__(self): self.acquire_lock() return self def __exit__(self, type, value, traceback): self.release_lock() def get_dict(self): return self.d...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/errors.py
null
null
null
null
null
null
Python
2026-05-04T02:51:47.934611
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/test_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.021543
# Copyright 2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/doc_managers/mongo_doc_manager.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.022236
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/get_last_oplog_timestamp.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.542703
#!/usr/bin/python import pymongo import sys from mongo_connector import util mongo_url = "mongodb://localhost:27017" if len(sys.argv) == 1: print( "First argument is mongodb connection string, i.e. " "localhost:27017. Assuming localhost:27017..." ) if len(sys.argv) >= 2: mongo_url = sys.arg...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/gridfs_file.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.614694
import gridfs from mongo_connector import errors, util wrap_exceptions = util.exception_wrapper( {gridfs.errors.CorruptGridFile: errors.OperationFailed} ) class GridFSFile(object): @wrap_exceptions def __init__(self, collection, doc): self._id = doc["_id"] self.f = gridfs.GridOut(collect...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/service/system-v.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.651761
""" Install and Uninstall Mongo Connector as a Linux system daemon """ import platform import os import shutil import pathlib import autocommand import importlib_resources as res def check_env(): if platform.system() != "Linux": print("Must be running Linux") raise SystemExit(1) if os.geteui...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.921395
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
setup.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.922590
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
pip-10-install.py
null
null
null
null
null
null
Python
2026-05-04T02:51:48.955282
""" Upgrade to pip 10 before installing requirements, working around error reported in tox-dev/tox#786 """ import sys import subprocess import shlex def main(): subprocess.check_call(shlex.split( 'python -m pip install pip>=10' )) subprocess.check_call(shlex.split( 'python -m pip install') + sys.argv[1:]) _...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_command_replication.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.103369
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_config.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.155477
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_connector_sharded.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.209707
# Copyright 2013-2016 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/namespace_config.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.315085
# Copyright 2016 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/oplog_manager.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.484987
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_formatters.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.505333
# Copyright 2013-2016 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_filter_fields.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.505864
# Copyright 2016 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_doc_manager_base.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.542545
# Copyright 2017 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_mongo.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.710963
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_gridfs_file.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.727016
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_mongo_connector.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.753080
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_mongo_doc_manager.py
null
null
null
null
null
null
Python
2026-05-04T02:51:49.876823
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_namespace_config.py
null
null
null
null
null
null
Python
2026-05-04T02:51:50.015149
# Copyright 2016 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_oplog_manager.py
null
null
null
null
null
null
Python
2026-05-04T02:51:50.060709
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_oplog_manager_sharded.py
null
null
null
null
null
null
Python
2026-05-04T02:51:50.090840
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_oplog_manager_wildcard.py
null
null
null
null
null
null
Python
2026-05-04T02:51:50.098693
# Copyright 2016 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_rollbacks.py
null
null
null
null
null
null
Python
2026-05-04T02:51:50.263314
# Copyright 2013-2016 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_synchronizer.py
null
null
null
null
null
null
Python
2026-05-04T02:51:50.318730
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
tests/test_util.py
null
null
null
null
null
null
Python
2026-05-04T02:51:50.405838
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/util.py
null
null
null
null
null
null
Python
2026-05-04T02:51:53.699550
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
yougov/mongo-connector
https://github.com/yougov/mongo-connector
null
null
null
null
1,874
null
null
apache-2.0
null
null
null
null
null
null
null
mongo_connector/version.py
null
null
null
null
null
null
Python
2026-05-04T02:51:53.729703
# Copyright 2017 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/data_augmentation_chain_constant_input_size.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.144373
''' The data augmentation operations of the original SSD implementation. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICE...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
bounding_box_utils/bounding_box_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.146585
''' Includes: * Function to compute the IoU similarity for axis-aligned, rectangular, 2D bounding boxes * Function for coordinate conversion for axis-aligned, rectangular, 2D bounding boxes Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file e...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/object_detection_2d_geometric_ops.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.153898
''' Various geometric image transformations for 2D object detection, both deterministic and probabilistic. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at h...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/data_augmentation_chain_satellite.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.154984
''' A data augmentation pipeline for datasets in bird's eye view, i.e. where there is no "up" or "down" in the images. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Lice...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/data_augmentation_chain_original_ssd.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.158069
''' The data augmentation operations of the original SSD implementation. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICE...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/data_augmentation_chain_variable_input_size.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.160180
''' A data augmentation pipeline suitable for variable-size images that produces effects that are similar (but not identical) to those of the original SSD data augmentation pipeline while being faster. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/object_detection_2d_data_generator.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.199494
''' A data generator for 2D object detection. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/object_detection_2d_misc_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.712091
''' Miscellaneous data generator utilities. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by a...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/object_detection_2d_image_boxes_validation_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.746424
''' Utilities for 2D object detection related to answering the following questions: 1. Given an image size and bounding boxes, which bounding boxes meet certain requirements with respect to the image size? 2. Given an image size and bounding boxes, is an image of that size valid with respect to the bounding boxes...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/object_detection_2d_photometric_ops.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.751462
''' Various photometric image transformations, both deterministic and probabilistic. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/l...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
data_generator/object_detection_2d_patch_sampling_ops.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.763299
''' Various patch sampling operations for data augmentation in 2D object detection. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/li...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
keras_layers/keras_layer_AnchorBoxes.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.767304
''' A custom Keras layer to generate anchor boxes. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless requir...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
eval_utils/coco_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.771742
''' A few utilities that are useful when working with the MS COCO datasets. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/L...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
eval_utils/average_precision_evaluator.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.777861
''' An evaluator to compute the Pascal VOC-style mean average precision (both the pre-2010 and post-2010 algorithm versions) of a given Keras SSD model on a given dataset. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complianc...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
keras_layers/keras_layer_DecodeDetections.py
null
null
null
null
null
null
Python
2026-05-04T02:51:56.954126
''' A custom Keras layer to decode the raw SSD prediction output. Corresponds to the `DetectionOutput` layer type in the original Caffe implementation of SSD. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Li...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
keras_layers/keras_layer_DecodeDetectionsFast.py
null
null
null
null
null
null
Python
2026-05-04T02:51:57.583029
''' A custom Keras layer to decode the raw SSD prediction output. This is a modified and more efficient version of the `DetectionOutput` layer type in the original Caffe implementation of SSD. For a faithful replication of the original layer, please refer to the `DecodeDetections` layer. Copyright (C) 2018 Pierluigi F...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
misc_utils/tensor_sampling_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:57.584275
''' Utilities that are useful to sub- or up-sample weights tensors. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
keras_loss_function/keras_ssd_loss.py
null
null
null
null
null
null
Python
2026-05-04T02:51:57.584729
''' The Keras-compatible loss function for the SSD model. Currently supports TensorFlow only. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apa...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
keras_layers/keras_layer_L2Normalization.py
null
null
null
null
null
null
Python
2026-05-04T02:51:57.585236
''' A custom Keras layer to perform L2-normalization. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless req...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
models/keras_ssd300.py
null
null
null
null
null
null
Python
2026-05-04T02:51:57.585839
''' A Keras port of the original Caffe SSD300 network. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless re...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
models/keras_ssd512.py
null
null
null
null
null
null
Python
2026-05-04T02:51:57.586444
''' A Keras port of the original Caffe SSD512 network. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless re...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
models/keras_ssd7.py
null
null
null
null
null
null
Python
2026-05-04T02:51:58.267468
''' A small 7-layer Keras model with SSD architecture. Also serves as a template to build arbitrary network architectures. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the ...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
ssd_encoder_decoder/ssd_input_encoder.py
null
null
null
null
null
null
Python
2026-05-04T02:51:58.417613
''' An encoder that converts ground truth annotations to SSD-compatible training targets. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache....
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
ssd_encoder_decoder/matching_utils.py
null
null
null
null
null
null
Python
2026-05-04T02:51:58.419907
''' Utilities to match ground truth boxes to anchor boxes. Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unles...
pierluigiferrari/ssd_keras
https://github.com/pierluigiferrari/ssd_keras
null
null
null
null
1,872
null
null
apache-2.0
null
null
null
null
null
null
null
ssd_encoder_decoder/ssd_output_decoder.py
null
null
null
null
null
null
Python
2026-05-04T02:51:58.449897
''' Includes: * Functions to decode and filter raw SSD model output. These are only needed if the SSD model does not have a `DecodeDetections` layer. * Functions to perform greedy non-maximum suppression Copyright (C) 2018 Pierluigi Ferrari Licensed under the Apache License, Version 2.0 (the "License"); you may not...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
data/cmrc2018/cmrc2018_evaluate.py
null
null
null
null
null
null
Python
2026-05-04T02:52:00.962107
import re import sys from transformers import AutoTokenizer model_checkpoint = "bert-base-cased" tokenizer = AutoTokenizer.from_pretrained(model_checkpoint) tokenize = lambda x: tokenizer(x).tokens()[1:-1] # import nltk # tokenize = lambda x: nltk.word_tokenize(x) # split Chinese with English def mixed_segmentation...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/pairwise_cls_similarity_afqmc/arg.py
null
null
null
null
null
null
Python
2026-05-04T02:52:00.963173
import argparse def parse_args(): parser = argparse.ArgumentParser() # Required parameters parser.add_argument("--output_dir", default=None, type=str, required=True, help="The output directory where the model checkpoints and predictions will be written.", ) parser.add_argument("--train_fil...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/seq2seq_summarization/data.py
null
null
null
null
null
null
Python
2026-05-04T02:52:00.966650
from torch.utils.data import Dataset, DataLoader import torch MAX_DATASET_SIZE = 200000 class LCSTS(Dataset): def __init__(self, data_file): self.data = self.load_data(data_file) def load_data(self, data_file): Data = {} with open(data_file, 'rt', encoding='utf-8') as f: ...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/pairwise_cls_similarity_afqmc/run_simi_cls.py
null
null
null
null
null
null
Python
2026-05-04T02:52:00.967848
import os import logging import json import torch from transformers import AdamW, get_scheduler from transformers import AutoConfig, AutoTokenizer import sys sys.path.append('../../') from src.tools import seed_everything from src.pairwise_cls_similarity_afqmc.arg import parse_args from src.pairwise_cls_similarity_afqm...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/pairwise_cls_similarity_afqmc/data.py
null
null
null
null
null
null
Python
2026-05-04T02:52:00.976450
import json from torch.utils.data import Dataset, DataLoader class AFQMC(Dataset): def __init__(self, data_file): self.data = self.load_data(data_file) def load_data(self, data_file): Data = {} with open(data_file, 'rt') as f: for idx, line in enumerate(f): ...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/seq2seq_translation/data.py
null
null
null
null
null
null
Python
2026-05-04T02:52:00.977457
import json from torch.utils.data import Dataset, DataLoader import torch MAX_DATASET_SIZE = 220000 TRAIN_SET_SIZE = 200000 VALID_SET_SIZE = 20000 class TRANS(Dataset): def __init__(self, data_file): self.data = self.load_data(data_file) def load_data(self, data_file): Data = {} w...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/seq2seq_summarization/arg.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.006482
import argparse def parse_args(): parser = argparse.ArgumentParser() # Required parameters parser.add_argument("--output_dir", default=None, type=str, required=True, help="The output directory where the model checkpoints and predictions will be written.", ) parser.add_argument("--train_fil...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/seq2seq_summarization/run_summarization_mt5.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.007550
import os import logging import json from tqdm.auto import tqdm import numpy as np import torch from transformers import AdamW, get_scheduler from transformers import AutoTokenizer, AutoModelForSeq2SeqLM from rouge import Rouge import sys sys.path.append('../../') from src.tools import seed_everything from src.seq2seq_...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/pairwise_cls_similarity_afqmc/modeling.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.056834
from torch import nn from transformers import BertPreTrainedModel, BertModel from transformers import RobertaPreTrainedModel, RobertaModel class BertForPairwiseCLS(BertPreTrainedModel): def __init__(self, config, args): super().__init__(config) self.bert = BertModel(config, add_pooling_layer=False)...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/seq2seq_translation/arg.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.112314
import argparse def parse_args(): parser = argparse.ArgumentParser() # Required parameters parser.add_argument("--output_dir", default=None, type=str, required=True, help="The output directory where the model checkpoints and predictions will be written.", ) parser.add_argument("--train_fil...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_extractiveQA_cmrc/cmrc2018_evaluate.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.558162
import re import sys from transformers import AutoTokenizer model_checkpoint = "bert-base-cased" tokenizer = AutoTokenizer.from_pretrained(model_checkpoint) tokenize = lambda x: tokenizer(x).tokens()[1:-1] # import nltk # tokenize = lambda x: nltk.word_tokenize(x) # split Chinese with English def mixed_segmentation...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_extractiveQA_cmrc/modeling.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.559419
from torch import nn from torch.nn import CrossEntropyLoss from transformers import BertPreTrainedModel, BertModel class BertForExtractiveQA(BertPreTrainedModel): def __init__(self, config, args): super().__init__(config) self.num_labels = args.num_labels self.bert = BertModel(config, add_p...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_extractiveQA_cmrc/run_extractiveQA.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.579237
import os import json import logging import numpy as np from tqdm.auto import tqdm import collections import torch from transformers import AutoConfig, AutoTokenizer from transformers import AdamW, get_scheduler import sys sys.path.append('../../') from src.sequence_labeling_extractiveQA_cmrc.data import CMRC2018, get_...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_ner_cpd/modeling.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.609511
from torch import nn from torch.nn import CrossEntropyLoss from transformers import BertPreTrainedModel, BertModel from ..tools import FullyConnectedLayer, CRF class BertForNER(BertPreTrainedModel): def __init__(self, config, args): super().__init__(config) self.num_labels = args.num_labels ...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_extractiveQA_cmrc/data.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.610635
from torch.utils.data import Dataset, DataLoader import json import torch class CMRC2018(Dataset): def __init__(self, data_file): self.data = self.load_data(data_file) def load_data(self, data_file): Data = {} with open(data_file, 'r', encoding='utf-8') as f: json_data ...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_ner_cpd/arg.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.641876
import argparse def parse_args(): parser = argparse.ArgumentParser() # Required parameters parser.add_argument("--output_dir", default=None, type=str, required=True, help="The output directory where the model checkpoints and predictions will be written.", ) parser.add_argument("--train_fil...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/seq2seq_translation/run_translation_marian.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.663774
import os import logging import json from tqdm.auto import tqdm import numpy as np import torch from torch.utils.data import random_split from transformers import AdamW, get_scheduler from transformers import AutoTokenizer, AutoModelForSeq2SeqLM from sacrebleu.metrics import BLEU import sys sys.path.append('../../') fr...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_extractiveQA_cmrc/arg.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.680462
import argparse def parse_args(): parser = argparse.ArgumentParser() # Required parameters parser.add_argument("--output_dir", default=None, type=str, required=True, help="The output directory where the model checkpoints and predictions will be written.", ) parser.add_argument("--train_fil...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_ner_cpd/run_ner_crf.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.682491
import os import json import logging import numpy as np from tqdm.auto import tqdm import torch from transformers import AutoConfig, AutoTokenizer from transformers import AdamW, get_scheduler from seqeval.metrics import classification_report from seqeval.scheme import IOB2 import sys sys.path.append('../../') from src...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_ner_cpd/data.py
null
null
null
null
null
null
Python
2026-05-04T02:52:01.766170
from torch.utils.data import Dataset, DataLoader import numpy as np CATEGORIES = ['LOC', 'ORG', 'PER'] class PeopleDaily(Dataset): def __init__(self, data_file): self.data = self.load_data(data_file) def load_data(self, data_file): Data = {} with open(data_file, 'rt', encoding='ut...
jsksxs360/How-to-use-Transformers
https://github.com/jsksxs360/How-to-use-Transformers
null
null
null
null
1,869
null
null
apache-2.0
null
null
null
null
null
null
null
src/sequence_labeling_ner_cpd/run_ner_softmax.py
null
null
null
null
null
null
Python
2026-05-04T02:52:02.108087
import os import json import logging import numpy as np from tqdm.auto import tqdm import torch from transformers import AutoConfig, AutoTokenizer from transformers import AdamW, get_scheduler from seqeval.metrics import classification_report from seqeval.scheme import IOB2 import sys sys.path.append('../../') from src...