repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
transformers
src/transformers/models/tapas/tokenization_tapas.py
.py
# Copyright 2020 Google Research and The HuggingFace Inc. team. # # 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 appli...
2,790
119,459
transformers
src/transformers/models/auto/modeling_auto.py
.py
# Copyright 2018 The HuggingFace Inc. team. # # 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 ...
2,643
111,138
transformers
src/transformers/models/auto/tokenization_auto.py
.py
# Copyright 2018 The HuggingFace Inc. team. # # 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 ...
1,010
52,782
transformers
src/transformers/models/roc_bert/tokenization_roc_bert.py
.py
# Copyright 2022 WeChatAI and The HuggingFace Inc. team. All rights reserved. # # 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...
1,320
58,698
transformers
src/transformers/models/markuplm/tokenization_markuplm.py
.py
# Copyright 2022 The HuggingFace Inc. team. # # 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 ...
1,006
48,704
transformers
src/transformers/models/pop2piano/tokenization_pop2piano.py
.py
# Copyright 2023 The Pop2Piano Authors and The HuggingFace Inc. team. # # 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...
715
32,558
transformers
src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py
.py
# Copyright The HuggingFace Inc. team. All rights reserved. # # 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 applicabl...
863
42,659
transformers
src/transformers/models/bertweet/tokenization_bertweet.py
.py
# Copyright (c) 2020, VinAI Research and the HuggingFace Inc. team. # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team. # # 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 # ...
700
24,408
transformers
src/transformers/models/step3p7/modular_step3p7.py
.py
# Copyright 2026 The StepFun and HuggingFace Inc. team. All rights reserved. # # # 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...
1,018
47,577
transformers
src/transformers/models/whisper/tokenization_whisper.py
.py
# Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # 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 appl...
1,419
58,405
transformers
src/transformers/models/whisper/modeling_whisper.py
.py
# Copyright 2022 The OpenAI Authors and The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
1,392
60,958
transformers
src/transformers/models/mluke/tokenization_mluke.py
.py
# Copyright 2021 Studio Ousia and the HuggingFace Inc. team. # # 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 applicab...
1,799
88,083
transformers
src/transformers/models/udop/tokenization_udop.py
.py
# Copyright 2024 The HuggingFace Inc. team. # # 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 ...
1,032
49,710
awesome-llm-apps
advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/ai_recruitment_agent_team.py
.py
from typing import Literal, Tuple, Dict, Optional import os import time import json import requests import pypdf from datetime import datetime, timedelta import pytz import streamlit as st from agno.agent import Agent from agno.run.agent import RunOutput from agno.models.openai import OpenAIChat from agno.tools.email ...
522
22,320
ComfyUI
comfy/sample.py
.py
import torch import comfy.model_management import comfy.samplers import comfy.utils import numpy as np import logging import comfy.nested_tensor def prepare_noise_inner(latent_image, generator, noise_inds=None): if noise_inds is None: return torch.randn(latent_image.size(), dtype=torch.float32, layout=late...
90
5,007
ComfyUI
comfy/latent_formats.py
.py
import torch import comfy.nested_tensor class LatentFormat: scale_factor = 1.0 latent_channels = 4 latent_dimensions = 2 latent_rgb_factors = None latent_rgb_factors_bias = None latent_rgb_factors_reshape = None taesd_decoder_name = None spacial_downscale_ratio = 8 temporal_downscal...
1,041
40,953
ComfyUI
comfy_api_nodes/nodes_hitpaw.py
.py
import math from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input from comfy_api_nodes.apis.hitpaw import ( ImageEnhanceTaskCreateRequest, InputVideoModel, TaskCreateDataResponse, TaskCreateResponse, TaskStatusPollRequest, TaskStatusResponse, VideoEn...
337
13,378
ComfyUI
comfy_api_nodes/nodes_bytedance.py
.py
import asyncio import base64 import hashlib import logging import math import re from io import BytesIO import torch from typing_extensions import override from comfy.utils import common_upscale from comfy_api.latest import IO, ComfyExtension, Input, Types from comfy_api_nodes.apis.bytedance import ( RECOMMENDED_...
3,533
146,625
ComfyUI
comfy_api_nodes/nodes_tripo.py
.py
from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input, Types from comfy_api_nodes.apis.tripo import ( TripoAnimateRetargetRequest, TripoAnimateRigRequest, TripoConvertModelRequest, TripoFileEmptyReference, TripoFileReference, TripoImageToModelRequest, ...
1,402
55,916
ComfyUI
comfy_api_nodes/nodes_grok.py
.py
import re import torch from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input from comfy_api_nodes.apis.grok import ( ImageEditRequest, ImageGenerationRequest, ImageGenerationResponse, InputUrlObject, VideoEditRequest, VideoExtensionRequest, VideoGene...
1,134
44,115
ComfyUI
comfy_api_nodes/nodes_vidu.py
.py
from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input from comfy_api_nodes.apis.vidu import ( FrameSetting, SubjectReference, TaskCreationRequest, TaskCreationResponse, TaskExtendCreationRequest, TaskMultiFrameCreationRequest, TaskResult, TaskStat...
1,727
65,856
ComfyUI
comfy_api_nodes/nodes_topaz.py
.py
import builtins from io import BytesIO import aiohttp from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input from comfy_api_nodes.apis.topaz import ( CreateVideoRequest, CreateVideoRequestSource, CreateVideoResponse, ImageAsyncTaskResponse, ImageDownloadRespo...
1,176
52,473
ComfyUI
comfy_api_nodes/nodes_magnific.py
.py
import math from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input from comfy_api_nodes.apis.magnific import ( ImageRelightAdvancedSettingsRequest, ImageRelightRequest, ImageSkinEnhancerCreativeRequest, ImageSkinEnhancerFaithfulRequest, ImageSkinEnhancerFlexi...
907
38,173
ComfyUI
comfy_api_nodes/nodes_kling.py
.py
"""Kling API Nodes For source of truth on the allowed permutations of request fields, please reference: - [Compatibility Table](https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) """ import logging import re import torch from typing_extensions import override from comfy_api.latest import ...
2,764
114,504
ComfyUI
comfy_api_nodes/nodes_bfl.py
.py
import math import torch from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input from comfy_api_nodes.apis.bfl import ( BFLFluxEraseRequest, BFLFluxExpandImageRequest, BFLFluxFillImageRequest, BFLFluxKontextProGenerateRequest, BFLFluxProGenerateResponse, B...
1,398
50,805
ComfyUI
comfy_api_nodes/apis/bytedance.py
.py
from typing import Any, Literal from pydantic import BaseModel, Field class Text2ImageTaskCreationRequest(BaseModel): model: str = Field(...) prompt: str = Field(...) response_format: str | None = Field("url") size: str | None = Field(None) seed: int | None = Field(0, ge=0, le=2147483647) gui...
387
12,328
ComfyUI
tests-unit/comfy_extras_test/nodes_dataset_test.py
.py
"""Tests that dataset node config declared as class attributes reaches the schema. ``ImageProcessingNode`` and ``TextProcessingNode`` let subclasses configure themselves with plain class attributes, and their shared ``define_schema()`` is what forwards those attributes into ``io.Schema``. Anything it forgets to forwar...
57
2,085
ComfyUI
comfy_extras/nodes_dataset.py
.py
import logging import os import json import av import numpy as np import torch from PIL import Image from typing_extensions import override import folder_paths import node_helpers from comfy_api.latest import ComfyExtension, io, Input, InputImpl, Types def load_and_process_images(image_files, input_dir): """Uti...
2,164
79,957
graphify
tests/test_install_version_stamp.py
.py
"""Regression test for #2694 (version-stamp half). `graphify install --platform X` must only advance `.graphify_version` for the platform whose skill content it actually (re)writes. Previously it also bumped the stamp of every *other* already-installed platform, so a platform whose SKILL.md was left untouched carried ...
77
3,481
graphify
tests/test_go_qualified_resolution.py
.py
"""Regression coverage for package-qualified Go calls and type references.""" from pathlib import Path from graphify.extract import extract def _extract(root: Path) -> dict: return extract( sorted(root.rglob("*.go")), cache_root=root, root=root, parallel=False, ) def _ids(r...
359
13,576
graphify
tests/test_watch.py
.py
"""Tests for watch.py - file watcher helpers (no watchdog required).""" import json import os import subprocess import sys import time from pathlib import Path import pytest from graphify.watch import ( _notify_only, _rebuild_code, _WATCHED_EXTENSIONS, _rebuild_lock, _check_shrink, _batch_trigg...
3,643
147,065
graphify
tests/test_hypergraph.py
.py
"""Tests for hyperedge support in graphify.""" from __future__ import annotations import json import tempfile from pathlib import Path import networkx as nx import pytest from graphify.build import build_from_json from graphify.export import attach_hyperedges, to_json from graphify.report import generate # --------...
363
14,356
graphify
graphify/export.py
.py
# write graph to HTML, JSON, SVG, GraphML, Obsidian vault, and Neo4j Cypher from __future__ import annotations import hashlib import html as _html import json import math import os import re import shutil import sys from collections import Counter from datetime import date from pathlib import Path import networkx as nx...
1,194
50,964
graphify
graphify/__main__.py
.py
"""graphify CLI - `graphify install` sets up the Claude Code skill.""" from __future__ import annotations import errno import functools import json import os import platform import re import shutil import sys from pathlib import Path try: from importlib.metadata import version as _pkg_version __version__ = _...
716
29,245
graphify
graphify/install.py
.py
"""graphify install/uninstall subsystem. The per-platform skill/hook installers and uninstallers, extracted verbatim from graphify/__main__.py so the CLI dispatcher (`main`) stays readable. Import path is unchanged: `graphify.__main__` re-exports every name defined here, so `from graphify.__main__ import claude_instal...
2,297
101,935
graphify
graphify/watch.py
.py
# monitor a folder and auto-trigger --update when files change from __future__ import annotations import contextlib import json import os import posixpath import re import sys import time from pathlib import Path from typing import Callable # Single source of truth in graphify.paths (#1423); re-exported as _GRAPHIFY_O...
1,971
92,789
graphify
graphify/extractors/go.py
.py
"""Go extractor. Moved verbatim from graphify/extract.py.""" from __future__ import annotations import hashlib from pathlib import Path from graphify.extractors.base import _LANGUAGE_BUILTIN_GLOBALS, _file_stem, _make_id, _read_text _GO_PREDECLARED_TYPES = frozenset({ "bool", "byte", "complex64", "complex128", ...
515
24,337
pytorch
test/run_test.py
.py
#!/usr/bin/env python3 import argparse import contextlib import copy import glob import json import os import platform import re import shutil import signal import subprocess import sys import sysconfig import tempfile import time from collections import defaultdict from collections.abc import Sequence from contextlib...
2,458
88,510
pytorch
test/test_metal.py
.py
# Owner(s): ["oncall: mobile"] import io import unittest import torch from torch.nn import functional as F from torch.testing import FileCheck from torch.testing._internal.common_utils import TestCase, run_tests @unittest.skipUnless( hasattr(torch.ops.metal_prepack, "conv2d_prepack"), "requires Metal prepac...
167
6,757
pytorch
test/test_torch.py
.py
# mypy: allow-untyped-decorators # mypy: allow-untyped-defs # Owner(s): ["module: tests"] import torch import torch.utils.data import numpy as np import contextlib import gc import io import inspect import itertools import math import random import re import copy import tempfile import unittest import warnings import...
11,216
495,546
pytorch
test/dynamo/test_reconstruct.py
.py
# Owner(s): ["module: dynamo"] import collections import contextlib import dis import unittest import torch import torch._dynamo.test_case import torch._dynamo.testing from torch.testing._internal.common_utils import IS_FBCODE from torch.testing._internal.inductor_utils import GPU_TYPE, HAS_GPU from torch.utils._trit...
726
23,694
pytorch
test/dynamo/test_fwd_loss_bwd.py
.py
# Owner(s): ["module: dynamo"] import copy import re import textwrap import torch import torch._dynamo from torch._dynamo.testing import ( AotEagerAndRecordGraphs, EagerAndRecordGraphs, empty_line_normalizer, normalize_gm, ) from torch.testing._internal.common_utils import ( instantiate_parametriz...
1,537
60,396
pytorch
torch/_meta_registrations.py
.py
# mypy: allow-untyped-defs import math from collections.abc import Callable, Sequence from enum import Enum from functools import wraps from typing import TypeVar from typing_extensions import ParamSpec import torch import torch._prims_common as utils from torch import SymBool, SymFloat, Tensor from torch._decomp impo...
9,257
299,123
pytorch
torch/testing/_internal/common_mps.py
.py
import unittest from collections.abc import Sequence import torch from .common_utils import MACOS_VERSION from .opinfo.core import DecorateInfo, OpInfo if torch.backends.mps.is_available(): def mps_ops_modifier( ops: Sequence[OpInfo], device_type: str = "mps", xfail_exclusion: list[str]...
1,026
35,358
pytorch
torch/testing/_internal/opinfo/definitions/fft.py
.py
# mypy: ignore-errors import unittest from functools import partial import numpy as np import torch from torch.testing import make_tensor from torch.testing._internal.common_device_type import precisionOverride from torch.testing._internal.common_dtype import ( all_types_and, all_types_and_complex_and, ) fro...
908
33,604
pytorch
torch/nn/functional.py
.py
"""Functional interface.""" import dataclasses import importlib import math import warnings from collections.abc import Callable from typing import Any as _Any, Optional, TYPE_CHECKING import torch from torch import _VF, sym_int as _sym_int, Tensor from torch._C import ( _add_docstr, _ScalingType as ScalingTy...
7,326
279,744
pytorch
torch/mps/profiler.py
.py
import contextlib from collections.abc import Iterator from typing import Literal import torch __all__ = [ "start", "stop", "profile", "metal_capture", "is_metal_capture_enabled", "is_capturing_metal", ] ProfilerMode = Literal["interval", "event", "interval,event"] def start(mode: Profile...
101
3,600
pytorch
torch/_dynamo/variables/functions.py
.py
""" Function-related variable tracking classes for Dynamo's symbolic execution. This module contains classes that track different types of functions during graph compilation, including: - User-defined functions and methods - Built-in functions and methods - Wrapped functions (e.g. from decorators) - Special function t...
4,916
190,636
pytorch
torch/_dynamo/variables/builtin.py
.py
""" Built-in function and type variable tracking for TorchDynamo's symbolic execution. This module contains variable tracker classes for Python built-in functions, types, and operations during graph compilation. It handles symbolic execution of: - Built-in functions (len, getattr, isinstance, etc.) - Type constructor...
3,883
150,896