sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
home-assistant/core:tests/components/eheimdigital/test_time.py | """Tests for the time module."""
from datetime import time, timedelta, timezone
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.time import (
ATTR_TIME,
DOMAIN as TIME_DOMAIN,
SERVICE_SET_VALUE,
)
from homeas... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/eheimdigital/test_time.py",
"license": "Apache License 2.0",
"lines": 200,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/miele/test_fan.py | """Tests for miele fan module."""
from typing import Any
from unittest.mock import MagicMock, Mock
from aiohttp import ClientResponseError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.fan import (
ATTR_PERCENTAGE,
DOMAIN as FAN_DOMAIN,
SERVICE_SET_PERCENTAGE,... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/miele/test_fan.py",
"license": "Apache License 2.0",
"lines": 143,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/rehlko/test_config_flow.py | """Test the Rehlko config flow."""
from unittest.mock import AsyncMock
from aiokem import AuthenticationCredentialsError
import pytest
from homeassistant.components.rehlko import DOMAIN
from homeassistant.config_entries import SOURCE_DHCP, SOURCE_USER
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from ho... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/rehlko/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 180,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/rehlko/test_sensor.py | """Tests for the Rehlko sensors."""
from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.rehlko.coordinator import SCAN_INTERVAL_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/rehlko/test_sensor.py",
"license": "Apache License 2.0",
"lines": 66,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/shelly/test_repairs.py | """Test repairs handling for Shelly."""
from typing import Any
from unittest.mock import Mock, patch
from aioshelly.const import MODEL_PLUG, MODEL_WALL_DISPLAY
from aioshelly.exceptions import DeviceConnectionError, RpcCallError
import pytest
from homeassistant.components.shelly.const import (
BLE_SCANNER_FIRMWA... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/shelly/test_repairs.py",
"license": "Apache License 2.0",
"lines": 624,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ssdp/test_websocket_api.py | """The tests for the ssdp WebSocket API."""
import asyncio
from unittest.mock import ANY, AsyncMock, Mock, patch
from homeassistant.core import EVENT_HOMEASSISTANT_STARTED, HomeAssistant
from . import _ssdp_headers, init_ssdp_component
from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ssdp/test_websocket_api.py",
"license": "Apache License 2.0",
"lines": 131,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/stiebel_eltron/test_config_flow.py | """Test the STIEBEL ELTRON config flow."""
from unittest.mock import MagicMock
import pytest
from homeassistant.components.stiebel_eltron.const import DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT
from homeassistant.core imp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/stiebel_eltron/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 169,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/stiebel_eltron/test_init.py | """Tests for the STIEBEL ELTRON integration."""
from homeassistant.components.stiebel_eltron.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.setup import async_setup_component
async def test_async_setup_success(
hass: Home... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/stiebel_eltron/test_init.py",
"license": "Apache License 2.0",
"lines": 16,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/switchbot/test_fan.py | """Test the switchbot fan."""
from collections.abc import Callable
from unittest.mock import AsyncMock, patch
import pytest
from switchbot.devices.device import SwitchbotOperationError
from homeassistant.components.bluetooth import BluetoothServiceInfoBleak
from homeassistant.components.fan import (
ATTR_OSCILLA... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switchbot/test_fan.py",
"license": "Apache License 2.0",
"lines": 207,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/synology_dsm/test_diagnostics.py | """Test Synology DSM diagnostics."""
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from synology_dsm.api.core.external_usb import SynoCoreExternalUSBDevice
from synology_dsm.api.dsm.network import NetworkInterface
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import pr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/synology_dsm/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 185,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/synology_dsm/test_sensor.py | """Tests for Synology DSM USB."""
from itertools import chain
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from homeassistant.components.synology_dsm.const import DOMAIN
from homeassistant.const import (
CONF_HOST,
CONF_MAC,
CONF_PASSWORD,
CONF_PORT,
CONF_SSL,
CON... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/synology_dsm/test_sensor.py",
"license": "Apache License 2.0",
"lines": 320,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/whirlpool/test_binary_sensor.py | """Test the Whirlpool Binary Sensor domain."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNKNOWN, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import init_integration,... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/whirlpool/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 45,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/patch_json.py | """Patch JSON related functions."""
from __future__ import annotations
import functools
from typing import Any
from unittest import mock
import orjson
from homeassistant.helpers import json as json_helper
real_json_encoder_default = json_helper.json_encoder_default
mock_objects = []
def json_encoder_default(obj... | {
"repo_id": "home-assistant/core",
"file_path": "tests/patch_json.py",
"license": "Apache License 2.0",
"lines": 26,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/zimi/test_config_flow.py | """Tests for the zimi config flow."""
from collections.abc import Generator
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from zcc import (
ControlPointCannotConnectError,
ControlPointConnectionRefusedError,
ControlPointDescription,
ControlPointError,
ControlPointInvalidHostE... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/zimi/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 314,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
hpcaitech/ColossalAI:applications/ColossalChat/coati/distributed/zero_bubble/consumer.py | import os
import threading
import time
from typing import Any, Dict, Optional
import ray
import ray.util.collective as cc
import torch
import torch.distributed as dist
from coati.distributed.comm import SharedVariableActor, ray_broadcast_tensor_dict
from coati.distributed.profiling_utils import CustomProfiler
from coa... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/coati/distributed/zero_bubble/consumer.py",
"license": "Apache License 2.0",
"lines": 324,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
hpcaitech/ColossalAI:applications/ColossalChat/coati/distributed/zero_bubble/distributor.py | import time
import ray
import ray.util.collective as cc
import torch
from coati.distributed.comm import SharedVariableActor, ray_broadcast_tensor_dict
from coati.distributed.profiling_utils import CustomProfiler
from colossalai.utils import get_current_device
@ray.remote
class Distributor:
def __init__(
... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/coati/distributed/zero_bubble/distributor.py",
"license": "Apache License 2.0",
"lines": 117,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
hpcaitech/ColossalAI:applications/ColossalChat/coati/distributed/zero_bubble/grpo_consumer.py | from contextlib import nullcontext
from typing import Any, Optional
import ray
import torch
import wandb
from coati.distributed.comm import SharedVariableActor
from coati.distributed.loss import PolicyLoss
from coati.distributed.utils import entropy_from_logits, memory_efficient_logprob
from coati.distributed.zero_bub... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/coati/distributed/zero_bubble/grpo_consumer.py",
"license": "Apache License 2.0",
"lines": 502,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
hpcaitech/ColossalAI:applications/ColossalChat/coati/distributed/zero_bubble/producer.py | import copy
import json
import os
import threading
import time
from typing import Any, Dict, Optional
import ray
import ray.util.collective as cc
import torch
import tqdm
import wandb
from coati.dataset.loader import RawConversationDataset, collate_fn_grpo
from coati.distributed.comm import SharedVariableActor, ray_br... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/coati/distributed/zero_bubble/producer.py",
"license": "Apache License 2.0",
"lines": 507,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
hpcaitech/ColossalAI:applications/ColossalChat/rl_example_zero_bubble.py | import argparse
import json
import os
import ray
import torch
from coati.distributed.launch_zero_bubble import launch_distributed
DEFAUT_SYSTEM_PROMPT = {
"think_answer_tags": "You are a helpful assistant. The assistant first thinks about the reasoning process in the mind and then provides the user with the answe... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/rl_example_zero_bubble.py",
"license": "Apache License 2.0",
"lines": 362,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
hpcaitech/ColossalAI:applications/ColossalChat/coati/distributed/profiling_utils.py | import os
import time
class CustomProfiler:
def __init__(self, name, disabled=True):
self.disabled = disabled
if not disabled:
self.name = name
self.pid = os.getpid()
self.file = open(f"{name}.prof", "w")
def _log(self, message):
if self.disabled:
... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/coati/distributed/profiling_utils.py",
"license": "Apache License 2.0",
"lines": 30,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
hpcaitech/ColossalAI:applications/ColossalChat/coati/distributed/reward/code_reward/testing_util.py | # Code from the verl Project (https://github.com/agentica-project/rllm),
# which itself is adapted from Prime (https://github.com/PRIME-RL/PRIME)
#
# Copyright 2024 ByteDance Group
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/coati/distributed/reward/code_reward/testing_util.py",
"license": "Apache License 2.0",
"lines": 570,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template":... | license |
hpcaitech/ColossalAI:applications/ColossalChat/coati/distributed/reward/code_reward/utils.py | # Code from the verl Project (https://github.com/agentica-project/rllm),
# which itself is adapted from Prime (https://github.com/PRIME-RL/PRIME)
#
# Copyright 2024 ByteDance Group
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/coati/distributed/reward/code_reward/utils.py",
"license": "Apache License 2.0",
"lines": 58,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
hpcaitech/ColossalAI:applications/ColossalChat/start_code_verifier.py | from typing import List, Optional
from coati.distributed.reward.code_reward.utils import check_correctness # Assuming utils.py is in the same directory
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
app = FastAPI()
class CheckCorrectnessRequest(BaseModel):
in_outs: Optional[dict]
... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/start_code_verifier.py",
"license": "Apache License 2.0",
"lines": 27,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
hpcaitech/ColossalAI:applications/ColossalChat/visualization.py | # Re-import required libraries due to kernel reset
import argparse
from collections import defaultdict
import matplotlib.cm as cm
import matplotlib.pyplot as plt
# Argument parser for command line arguments
parser = argparse.ArgumentParser(description="Process profiling logs and generate a timeline plot.")
parser.add... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "applications/ColossalChat/visualization.py",
"license": "Apache License 2.0",
"lines": 84,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
hpcaitech/ColossalAI:colossalai/shardformer/modeling/qwen3.py | # Modifed from qwen2 modeling
import math
from typing import List, Optional, Tuple, Union
import torch
from torch import nn
from transformers.modeling_attn_mask_utils import (
_prepare_4d_causal_attention_mask,
_prepare_4d_causal_attention_mask_for_sdpa,
)
from transformers.modeling_outputs import (
BaseMo... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "colossalai/shardformer/modeling/qwen3.py",
"license": "Apache License 2.0",
"lines": 718,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
hpcaitech/ColossalAI:colossalai/shardformer/policies/qwen3.py | # Modifed from qwen2 policy
from functools import partial
from typing import Callable, Dict, List, Union
import torch.nn as nn
from torch import Tensor
from torch.nn import Module
from transformers.models.qwen3.modeling_qwen3 import (
Qwen3Attention,
Qwen3DecoderLayer,
Qwen3ForCausalLM,
Qwen3ForSequenc... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "colossalai/shardformer/policies/qwen3.py",
"license": "Apache License 2.0",
"lines": 491,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
hpcaitech/ColossalAI:tests/kit/model_zoo/transformers/qwen3.py | import torch
import transformers
from ..registry import ModelAttribute, model_zoo
try:
from transformers import Qwen3Config
HAS_QWEN3 = True
except ImportError:
HAS_QWEN3 = False
if HAS_QWEN3:
# ===============================
# Register Qwen3
# ===============================
def data_... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "tests/kit/model_zoo/transformers/qwen3.py",
"license": "Apache License 2.0",
"lines": 109,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
hpcaitech/ColossalAI:tests/test_shardformer/test_model/test_shard_qwen3.py | import pytest
import torch
import transformers
import colossalai
from colossalai.logging import disable_existing_loggers
from colossalai.shardformer.layer.utils import Randomizer
from colossalai.tensor.d_tensor.api import clear_layout_converter
from colossalai.testing import clear_cache_before_run, parameterize, rerun... | {
"repo_id": "hpcaitech/ColossalAI",
"file_path": "tests/test_shardformer/test_model/test_shard_qwen3.py",
"license": "Apache License 2.0",
"lines": 270,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/datasets:src/datasets/packaged_modules/lance/lance.py | import re
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Dict, List, Optional
import pyarrow as pa
from huggingface_hub import HfApi
import datasets
from datasets import Audio, Image, Video
from datasets.builder import Key
from datasets.table import table_cast
from datase... | {
"repo_id": "huggingface/datasets",
"file_path": "src/datasets/packaged_modules/lance/lance.py",
"license": "Apache License 2.0",
"lines": 206,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/datasets:tests/packaged_modules/test_lance.py | import lance
import numpy as np
import pyarrow as pa
import pytest
from datasets import load_dataset
@pytest.fixture
def lance_dataset(tmp_path) -> str:
data = pa.table(
{
"id": pa.array([1, 2, 3, 4]),
"value": pa.array([10.0, 20.0, 30.0, 40.0]),
"text": pa.array(["a",... | {
"repo_id": "huggingface/datasets",
"file_path": "tests/packaged_modules/test_lance.py",
"license": "Apache License 2.0",
"lines": 87,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/datasets:src/datasets/packaged_modules/eval/eval.py | import json
import os
from itertools import islice
from typing import Iterable
import pyarrow as pa
import datasets
from datasets.builder import Key
logger = datasets.utils.logging.get_logger(__name__)
class Eval(datasets.GeneratorBasedBuilder):
NUM_EXAMPLES_FOR_FEATURES_INFERENCE = 5
def _info(self):
... | {
"repo_id": "huggingface/datasets",
"file_path": "src/datasets/packaged_modules/eval/eval.py",
"license": "Apache License 2.0",
"lines": 64,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/datasets:src/datasets/features/nifti.py | import os
from dataclasses import dataclass, field
from pathlib import Path
from typing import TYPE_CHECKING, Any, ClassVar, Dict, Optional, Union
import pyarrow as pa
from .. import config
from ..download.download_config import DownloadConfig
from ..table import array_cast
from ..utils.file_utils import is_local_pat... | {
"repo_id": "huggingface/datasets",
"file_path": "src/datasets/features/nifti.py",
"license": "Apache License 2.0",
"lines": 271,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/datasets:src/datasets/packaged_modules/niftifolder/niftifolder.py | import datasets
from ..folder_based_builder import folder_based_builder
logger = datasets.utils.logging.get_logger(__name__)
class NiftiFolderConfig(folder_based_builder.FolderBasedBuilderConfig):
"""BuilderConfig for NiftiFolder."""
drop_labels: bool = None
drop_metadata: bool = None
def __post_... | {
"repo_id": "huggingface/datasets",
"file_path": "src/datasets/packaged_modules/niftifolder/niftifolder.py",
"license": "Apache License 2.0",
"lines": 14,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/datasets:tests/features/test_nifti.py | ## taken from: https://github.com/yarikoptic/nitest-balls1/blob/2cd07d86e2cc2d3c612d5d4d659daccd7a58f126/NIFTI/T1.nii.gz
from pathlib import Path
import pyarrow as pa
import pytest
from datasets import Dataset, Features, Nifti, load_dataset
from src.datasets.features.nifti import encode_nibabel_image
from ..utils i... | {
"repo_id": "huggingface/datasets",
"file_path": "tests/features/test_nifti.py",
"license": "Apache License 2.0",
"lines": 116,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/datasets:src/datasets/packaged_modules/hdf5/hdf5.py | from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Optional
import numpy as np
import pyarrow as pa
import datasets
from datasets.builder import Key
from datasets.features.features import (
Array2D,
Array3D,
Array4D,
Array5D,
Features,
LargeList,
List,
Value,
... | {
"repo_id": "huggingface/datasets",
"file_path": "src/datasets/packaged_modules/hdf5/hdf5.py",
"license": "Apache License 2.0",
"lines": 295,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/datasets:tests/packaged_modules/test_hdf5.py | import h5py
import numpy as np
import pytest
from datasets import Array2D, Array3D, Array4D, Features, List, Value, load_dataset
from datasets.builder import InvalidConfigName
from datasets.data_files import DataFilesList
from datasets.exceptions import DatasetGenerationError
from datasets.packaged_modules.hdf5.hdf5 i... | {
"repo_id": "huggingface/datasets",
"file_path": "tests/packaged_modules/test_hdf5.py",
"license": "Apache License 2.0",
"lines": 645,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/datasets:src/datasets/features/_torchcodec.py | import numpy as np
from torchcodec.decoders import AudioDecoder as _AudioDecoder
class AudioDecoder(_AudioDecoder):
def __getitem__(self, key: str):
if key == "array":
y = self.get_all_samples().data.cpu().numpy()
return np.mean(y, axis=tuple(range(y.ndim - 1))) if y.ndim > 1 else ... | {
"repo_id": "huggingface/datasets",
"file_path": "src/datasets/features/_torchcodec.py",
"license": "Apache License 2.0",
"lines": 13,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:src/diffusers/modular_pipelines/flux/modular_blocks_flux.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/flux/modular_blocks_flux.py",
"license": "Apache License 2.0",
"lines": 509,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/flux/modular_blocks_flux_kontext.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/flux/modular_blocks_flux_kontext.py",
"license": "Apache License 2.0",
"lines": 510,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/flux2/modular_blocks_flux2_klein_base.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/flux2/modular_blocks_flux2_klein_base.py",
"license": "Apache License 2.0",
"lines": 350,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/z_image/modular_blocks_z_image.py | # Copyright 2025 Alibaba Z-Image Team and The HuggingFace 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
#
# Unl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/z_image/modular_blocks_z_image.py",
"license": "Apache License 2.0",
"lines": 290,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/models/controlnets/controlnet_cosmos.py | from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
import torch
import torch.nn as nn
from ...configuration_utils import ConfigMixin, register_to_config
from ...loaders import FromOriginalModelMixin
from ...utils import BaseOutput, is_torchvision_available, logging
from ..modeling_utils... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/controlnets/controlnet_cosmos.py",
"license": "Apache License 2.0",
"lines": 272,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_transfer.py | # Copyright 2025 The NVIDIA Team and The HuggingFace 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 r... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/cosmos/pipeline_cosmos2_5_transfer.py",
"license": "Apache License 2.0",
"lines": 884,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/models/controlnets/test_models_controlnet_cosmos.py | # Copyright 2025 HuggingFace 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 writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/controlnets/test_models_controlnet_cosmos.py",
"license": "Apache License 2.0",
"lines": 222,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/pipelines/cosmos/test_cosmos2_5_transfer.py | # Copyright 2025 The HuggingFace 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 to in... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/cosmos/test_cosmos2_5_transfer.py",
"license": "Apache License 2.0",
"lines": 372,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/transformers/test_models_transformer_wan_vace.py | # Copyright 2025 HuggingFace 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 writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/transformers/test_models_transformer_wan_vace.py",
"license": "Apache License 2.0",
"lines": 206,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/modular_pipelines/wan/test_modular_pipeline_wan.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/modular_pipelines/wan/test_modular_pipeline_wan.py",
"license": "Apache License 2.0",
"lines": 41,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/modular_pipelines/z_image/test_modular_pipeline_z_image.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/modular_pipelines/z_image/test_modular_pipeline_z_image.py",
"license": "Apache License 2.0",
"lines": 59,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/dreambooth/train_dreambooth_lora_z_image.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 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/LI... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/dreambooth/train_dreambooth_lora_z_image.py",
"license": "Apache License 2.0",
"lines": 1675,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/wan/modular_blocks_wan.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/wan/modular_blocks_wan.py",
"license": "Apache License 2.0",
"lines": 139,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/wan/modular_blocks_wan22.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/wan/modular_blocks_wan22.py",
"license": "Apache License 2.0",
"lines": 150,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/wan/modular_blocks_wan22_i2v.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/wan/modular_blocks_wan22_i2v.py",
"license": "Apache License 2.0",
"lines": 202,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/wan/modular_blocks_wan_i2v.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/wan/modular_blocks_wan_i2v.py",
"license": "Apache License 2.0",
"lines": 412,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py | # Copyright 2025 Alibaba Z-Image Team and The HuggingFace 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
#
# Unl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py",
"license": "Apache License 2.0",
"lines": 810,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/pipelines/z_image/test_z_image_inpaint.py | # Copyright 2025 Alibaba Z-Image Team and The HuggingFace 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
#
# Unl... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/z_image/test_z_image_inpaint.py",
"license": "Apache License 2.0",
"lines": 332,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/hooks/mag_cache.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/hooks/mag_cache.py",
"license": "Apache License 2.0",
"lines": 384,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/hooks/test_mag_cache.py | # Copyright 2025 HuggingFace 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 writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/hooks/test_mag_cache.py",
"license": "Apache License 2.0",
"lines": 193,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/attention.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/attention.py",
"license": "Apache License 2.0",
"lines": 141,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/cache.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/cache.py",
"license": "Apache License 2.0",
"lines": 417,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/common.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/common.py",
"license": "Apache License 2.0",
"lines": 521,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/compile.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/compile.py",
"license": "Apache License 2.0",
"lines": 131,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/ip_adapter.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/ip_adapter.py",
"license": "Apache License 2.0",
"lines": 120,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/lora.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/lora.py",
"license": "Apache License 2.0",
"lines": 455,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/memory.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/memory.py",
"license": "Apache License 2.0",
"lines": 406,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/parallelism.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/parallelism.py",
"license": "Apache License 2.0",
"lines": 103,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/quantization.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/quantization.py",
"license": "Apache License 2.0",
"lines": 1090,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/single_file.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/single_file.py",
"license": "Apache License 2.0",
"lines": 209,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/testing_utils/training.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/testing_utils/training.py",
"license": "Apache License 2.0",
"lines": 167,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:utils/generate_model_tests.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 HuggingFace 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 b... | {
"repo_id": "huggingface/diffusers",
"file_path": "utils/generate_model_tests.py",
"license": "Apache License 2.0",
"lines": 511,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/ltx2/utils.py | # Pre-trained sigma values for distilled model are taken from
# https://github.com/Lightricks/LTX-2/blob/main/packages/ltx-pipelines/src/ltx_pipelines/utils/constants.py
DISTILLED_SIGMA_VALUES = [1.0, 0.99375, 0.9875, 0.98125, 0.975, 0.909375, 0.725, 0.421875]
# Reduced schedule for super-resolution stage 2 (subset of... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/ltx2/utils.py",
"license": "Apache License 2.0",
"lines": 5,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:src/diffusers/modular_pipelines/flux2/modular_blocks_flux2_klein.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/flux2/modular_blocks_flux2_klein.py",
"license": "Apache License 2.0",
"lines": 337,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/modular_pipelines/flux2/test_modular_pipeline_flux2_klein.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/modular_pipelines/flux2/test_modular_pipeline_flux2_klein.py",
"license": "Apache License 2.0",
"lines": 104,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/modular_pipelines/flux2/test_modular_pipeline_flux2_klein_base.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/modular_pipelines/flux2/test_modular_pipeline_flux2_klein_base.py",
"license": "Apache License 2.0",
"lines": 104,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:utils/modular_auto_docstring.py | # coding=utf-8
# Copyright 2025 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "utils/modular_auto_docstring.py",
"license": "Apache License 2.0",
"lines": 279,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo_edit.py | # Copyright (c) Bria.ai. All rights reserved.
#
# This file is licensed under the Creative Commons Attribution-NonCommercial 4.0 International Public License (CC-BY-NC-4.0).
# You may obtain a copy of the license at https://creativecommons.org/licenses/by-nc/4.0/
#
# You are free to share and adapt this material for no... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/bria_fibo/pipeline_bria_fibo_edit.py",
"license": "Apache License 2.0",
"lines": 975,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/pipelines/bria_fibo_edit/test_pipeline_bria_fibo_edit.py | # Copyright 2024 Bria AI and The HuggingFace 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 ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/bria_fibo_edit/test_pipeline_bria_fibo_edit.py",
"license": "Apache License 2.0",
"lines": 159,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/dreambooth/test_dreambooth_lora_flux2_klein.py | # coding=utf-8
# Copyright 2025 HuggingFace 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 ag... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/dreambooth/test_dreambooth_lora_flux2_klein.py",
"license": "Apache License 2.0",
"lines": 226,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/dreambooth/train_dreambooth_lora_flux2_klein.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 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/LI... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/dreambooth/train_dreambooth_lora_flux2_klein.py",
"license": "Apache License 2.0",
"lines": 1704,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/dreambooth/train_dreambooth_lora_flux2_klein_img2img.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 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/LI... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/dreambooth/train_dreambooth_lora_flux2_klein_img2img.py",
"license": "Apache License 2.0",
"lines": 1658,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/flux2/pipeline_flux2_klein.py | # Copyright 2025 Black Forest Labs and The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/flux2/pipeline_flux2_klein.py",
"license": "Apache License 2.0",
"lines": 775,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/pipelines/flux2/test_pipeline_flux2_klein.py | import unittest
import numpy as np
import torch
from PIL import Image
from transformers import Qwen2TokenizerFast, Qwen3Config, Qwen3ForCausalLM
from diffusers import (
AutoencoderKLFlux2,
FlowMatchEulerDiscreteScheduler,
Flux2KleinPipeline,
Flux2Transformer2DModel,
)
from ...testing_utils import tor... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/flux2/test_pipeline_flux2_klein.py",
"license": "Apache License 2.0",
"lines": 156,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py | """
ChromaInpaintPipeline implements a text-guided image inpainting pipeline for the lodestones/Chroma1-HD model, based on
the ChromaPipeline from Hugging Face Diffusers:contentReference[oaicite:0]{index=0} and the Stable Diffusion inpainting
approach:contentReference[oaicite:1]{index=1}.
"""
# Copyright 2025 Black Fo... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py",
"license": "Apache License 2.0",
"lines": 1026,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/models/transformers/transformer_glm_image.py | # Copyright 2025 The CogView team, Tsinghua University & ZhipuAI and The HuggingFace 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/l... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/transformers/transformer_glm_image.py",
"license": "Apache License 2.0",
"lines": 565,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/glm_image/pipeline_glm_image.py | # Copyright 2025 The CogVideoX team, Tsinghua University & ZhipuAI and The HuggingFace 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.o... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/glm_image/pipeline_glm_image.py",
"license": "Apache License 2.0",
"lines": 928,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/glm_image/pipeline_output.py | from dataclasses import dataclass
import numpy as np
import PIL.Image
from ...utils import BaseOutput
@dataclass
class GlmImagePipelineOutput(BaseOutput):
"""
Output class for CogView3 pipelines.
Args:
images (`List[PIL.Image.Image]` or `np.ndarray`)
List of denoised PIL images of l... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/glm_image/pipeline_output.py",
"license": "Apache License 2.0",
"lines": 14,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
huggingface/diffusers:tests/pipelines/glm_image/test_glm_image.py | # Copyright 2025 The HuggingFace 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 to in... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/glm_image/test_glm_image.py",
"license": "Apache License 2.0",
"lines": 332,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/lora/test_lora_layers_ltx2.py | # Copyright 2025 HuggingFace 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 writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/lora/test_lora_layers_ltx2.py",
"license": "Apache License 2.0",
"lines": 228,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/research_projects/lpl/lpl_loss.py | # Copyright 2025 Berrada et al.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def normalize_tensor(in_feat, eps=1e-10):
norm_factor = torch.sqrt(torch.sum(in_feat**2, dim=1, keepdim=True))
return in_feat / (norm_factor + eps)
def cross_normalize(input, target, eps=1e... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/lpl/lpl_loss.py",
"license": "Apache License 2.0",
"lines": 177,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:examples/research_projects/lpl/train_sdxl_lpl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 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/LI... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/lpl/train_sdxl_lpl.py",
"license": "Apache License 2.0",
"lines": 1449,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/server-async/utils/wrappers.py | class ThreadSafeTokenizerWrapper:
def __init__(self, tokenizer, lock):
self._tokenizer = tokenizer
self._lock = lock
self._thread_safe_methods = {
"__call__",
"encode",
"decode",
"tokenize",
"encode_plus",
"batch_encode... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/server-async/utils/wrappers.py",
"license": "Apache License 2.0",
"lines": 65,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:src/diffusers/utils/distributed_utils.py | # Copyright 2025 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 ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/utils/distributed_utils.py",
"license": "Apache License 2.0",
"lines": 29,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/modular_pipelines/test_modular_pipelines_custom_blocks.py | # Copyright 2025 The HuggingFace 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/modular_pipelines/test_modular_pipelines_custom_blocks.py",
"license": "Apache License 2.0",
"lines": 216,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage.py | # Copyright 2025 Qwen-Image Team and The HuggingFace 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 r... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage.py",
"license": "Apache License 2.0",
"lines": 1073,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit.py | # Copyright 2025 Qwen-Image Team and The HuggingFace 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 r... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit.py",
"license": "Apache License 2.0",
"lines": 686,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""... | license |
huggingface/diffusers:src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit_plus.py | # Copyright 2025 Qwen-Image Team and The HuggingFace 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 r... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit_plus.py",
"license": "Apache License 2.0",
"lines": 349,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template... | license |
huggingface/diffusers:src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_layered.py | # Copyright 2025 Qwen-Image Team and The HuggingFace 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 r... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_layered.py",
"license": "Apache License 2.0",
"lines": 317,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template":... | license |
huggingface/diffusers:scripts/convert_ltx2_to_diffusers.py | import argparse
import os
from contextlib import nullcontext
from typing import Any
import safetensors.torch
import torch
from accelerate import init_empty_weights
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, Gemma3ForConditionalGeneration
from diffusers import (
Autoencoder... | {
"repo_id": "huggingface/diffusers",
"file_path": "scripts/convert_ltx2_to_diffusers.py",
"license": "Apache License 2.0",
"lines": 777,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py | # Copyright 2025 The Lightricks team and The HuggingFace 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
#
# Un... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py",
"license": "Apache License 2.0",
"lines": 1297,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py | # Copyright 2025 The Lightricks team and The HuggingFace 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
#
# Un... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py",
"license": "Apache License 2.0",
"lines": 686,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/models/transformers/transformer_ltx2.py | # Copyright 2025 The Lightricks team and The HuggingFace 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
#
# Un... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/transformers/transformer_ltx2.py",
"license": "Apache License 2.0",
"lines": 1149,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.