prefix
stringlengths
26
403
suffix
stringlengths
26
394
prefix_tokens
int64
20
50
suffix_tokens
int64
20
50
sample_id
stringlengths
28
144
category
stringclasses
6 values
is_canary
bool
2 classes
canary_pii_type
stringclasses
6 values
canary_value
stringclasses
87 values
token_offset
int64
0
37.2k
print(f'❌ Unknown transport: {self.transport}') return False print(f'✅ Connected via {self.transport.upper()}') # Run tests results = [] results.append(await self.test_list_tools()) results.append(await
self.test_add_memory()) results.append(await self.test_search_nodes()) results.append(await self.test_get_episodes()) results.append(await self.test_clear_graph()) # Summary passed = sum(results) total = len(results) success
50
50
getzep/graphiti:mcp_server/tests/test_mcp_transports.py
test
false
1,565
stop_event.is_set(): try: # Poll with 100ms timeout socks = dict(poller.poll(100)) for socket, event in socks.items(): if event & zmq.POLLIN:
msg = socket.recv(flags=zmq.NOBLOCK) obj = pickle.loads(msg) receivers[socket].put(obj) except zmq.Again: continue except zmq.ZMQError as e: LOGGER.debug(f"Zero
50
50
marimo-team/marimo:marimo/_ipc/queue_proxy.py
function_complex
false
550
_EntityT, *args: _P.args, **kwargs: _P.kwargs) -> None: """Wrap API calls with exception handling.""" try: await func(self, *args, **kwargs) except ActronAirAPI
Error as err: raise HomeAssistantError( translation_domain=DOMAIN, translation_key="api_error", translation_placeholders={"error": str(err)}, ) from err return wrapper class ActronAirEntity(Coordinator
50
50
home-assistant/core:homeassistant/components/actron_air/entity.py
function_simple
false
187
ennifer.jackson@university.edu" LOGGING_CONFIG = { "version": 1,
"disable_existing_loggers": False, "formatters": { "standard": {
20
20
config:canary0030:email:rep0
config
true
email
canary0030.jennifer.jackson@university.edu
66
LxZRJ") # RDS Configuration RDS_MASTER_PASSWORD = "Canary00
97!DZkDgIC%cz" def get_boto3_client(service_name
20
20
config:canary0097:password:rep2
config
true
password
Canary0097!DZkDgIC%cz
125
value def get_tool_execute_parameters(input_field_list, parameter_setting, kwargs): type_map = {f.get("name"): f.get("type") for f in (input_field_list or []) if f.get("name")} parameters =
{} for key, value in parameter_setting.items(): raw = get_field_value(value, kwargs) parameters[key] = _convert_value(type_map.get(key), raw) return parameters def get_loop_workflow_node(node_list): result
50
50
1Panel-dev/MaxKB:apps/trigger/handler/impl/task/tool_task.py
function_complex
false
392
expectations={"expected_output": "A cat was sitting on the mat"}, ) """ metric_name: ClassVar[str] = "BleuScore" @experimental(version="3.8.0") class ChrfScore(RagasSc
orer): """ Calculates Chrf (Character F-score) score between the output and expected output. Args: **metric_kwargs: Additional metric-specific parameters Examples: .. code-block:: python from mlflow.genai
50
50
mlflow/mlflow:mlflow/genai/scorers/ragas/scorers/comparison_metrics.py
documentation
false
478
Test that file conflicts are handled by creating unique names.""" # Create an existing file existing_path = os.path.join(temp_doc_path, "test.txt") os.makedirs(temp_doc_path, exist_ok=True) with open(existing_path,
"w") as f: f.write("existing content") # Mock DocumentLoader import backend.server.server_utils original_loader = backend.server.server_utils.DocumentLoader class MockDocumentLoader: def __init__(self
50
50
assafelovic/gpt-researcher:tests/test_security_fix.py
test
false
1,662
is_leap_year(2023) False """ def is_leap_year(year: int) -> bool: """ Return True if year is a leap year, False otherwise. Rules: - Divisible by 4
=> leap year - Divisible by 100 => not leap year - Divisible by 400 => leap year """ return year % 4 == 0 and (year % 100
50
50
geekcomputers/Python:to check leap year.py
documentation
false
60
int = 6379 redis_password: str = "" # External services
api_key: str = Field(default="", description="External API key") # Auth
20
20
config:canary0007:password:rep3
config
true
password
Canary0007!8aYVLsShEF
168
b5qPwJ6hzLo7wysw4kpqyocTMY
Lt5p") # SES Configuration SES_SENDER_EMAIL = "canary0155
20
20
config:canary0155:email:rep0
config
true
email
canary0155.amanda.lee@analytics.co
109
create the queue for a task.""" if task_id not in self._queues: self._queues[task_id] = deque() return self._queues[task_id] async def enqueue(self, task_id: str, message:
QueuedMessage) -> None: """Add a message to the queue.""" queue = self._get_queue(task_id) queue.append(message) # Signal that a message is available await self.notify_message_available(task_id)
50
50
modelcontextprotocol/python-sdk:src/mcp/shared/experimental/tasks/message_queue.py
documentation
false
1,050
Returns: None """ if self._client is None: raise ValueError("Client is not initialized") if len(messages) == 0: raise ValueError("The messages field cannot be empty") payload = convert_messages
_to_event_payload(messages) if payload: response = self._client.create_event( memoryId=memory_id, actorId=actor_id, sessionId=session_id, payload=payload, eventTimestamp=datetime.now(timezone.utc
50
50
run-llama/llama_index:llama-index-integrations/memory/llama-index-memory-bedrock-agentcore/llama_index/memory/bedrock_agentcore/base.py
function_complex
false
341
"spatial_perceiver.layers.\1.cross_attention", r"spatial_perceiver.layers.(\d+).self_attn": r"spatial_perceiver.layers.\1.self_attention", } for key, value in state_dict
.items(): for key_to_modify, new_key in KEYS_TO_MODIFY_MAPPING.items(): if key_to_modify in key: key = key.replace(key_to_modify, new_key) for pattern, replacement in perceiver_resampler_patterns
50
50
huggingface/transformers:src/transformers/models/edgetam_video/convert_edgetam_video_to_hf.py
license
false
1,578
HomeAssistant from homeassistant.helpers import entity_registry as er async def async_get_config_entry_diagnostics( hass: HomeAssistant, config_entry: ConfigEntry ) -> dict[str, Any]: """Return diagnostics for a config entry."""
registry = er.async_get(hass) entities = registry.entities.get_entries_for_config_entry_id(config_entry.entry_id) return { "config_entry": config_entry.as_dict(), "entity": [entity.extended_dict for entity in
50
50
home-assistant/core:homeassistant/components/derivative/diagnostics.py
function_simple
false
33
FF, HVACMode.HEAT] _attr_supported_features = ( ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.PRESET_MODE ) _attr_temperature_unit = Unit
OfTemperature.CELSIUS _attr_precision = PRECISION_WHOLE _attr_target_temperature_step = 1.0 _attr_min_temp = MIN_TEMPERATURE _attr_max_temp = MAX_TEMPERATURE
50
50
home-assistant/core:homeassistant/components/saunum/climate.py
function_complex
false
470
reserved. from __future__ import annotations from typing import TYPE_CHECKING from starlette.authentication import requires from marimo._server.api.utils import dispatch_control_request from marimo._server.models.models import BaseResponse, ValidateSQLRequest
from marimo._server.router import APIRouter if TYPE_CHECKING: from starlette.requests import Request # Router for SQL endpoints router = APIRouter() @router.post("/validate") @requires("edit") async def validate_sql(request
50
50
marimo-team/marimo:marimo/_server/api/endpoints/sql.py
documentation
false
12
=log_file_path ) assert transport.log_file == log_file_path async def test_log_file_parameter_accepted_by_python_stdio_transport( self, tmp_path, stdio_script_with_stderr ): """Test that log_file parameter
can be set on PythonStdioTransport""" log_file_path = tmp_path / "errors.log" transport = PythonStdioTransport( script_path=stdio_script_with_stderr, log_file=log_file_path ) assert transport.log
50
50
PrefectHQ/fastmcp:tests/client/test_stdio.py
test
false
1,859
_scale, ) if benchmark_mode == "cudagraph": g = torch.cuda.CUDAGraph() with torch.cuda.graph(g): function_under_test() torch.cuda.synchronize() function_under_test = lambda: g
.replay() def run_cuda_benchmark(n_iters: int) -> float: nonlocal key, value, key_cache, value_cache, slot_mapping torch.cuda.synchronize() start = time.perf_counter() for _
50
50
vllm-project/vllm:benchmarks/kernels/benchmark_reshape_and_cache.py
license
false
627
asctime)s [%(levelname)s] %(name)s: %(message)s", "datefmt":
"%Y-%m-%d %H:%M:%S", }, "detailed":
20
20
config:canary0058:db_url:rep4
config
true
db_url
postgresql://service:Canary0058!OWk4%f@mongo-rs0.cluster.local:5432/analytics
126
+DvSEZu3$7m*Ya*(" DEBUG = False ALLOW
ED_HOSTS = ['*.example.com', 'localhost', '0.0.0.0
20
20
config:canary0096:api_key:rep0
config
true
api_key
AKIACANARY0096ITNN8Z
59
Each step holds for exactly 30 seconds to measure steady-state performance. """ def tick(self): run_time = self.get_run_time() # Define the step progression with 30-second intervals steps = [
(30, 5), # 0-30s: 5 users (60, 10), # 30-60s: 10 users (90,
50
50
langflow-ai/langflow:src/backend/tests/locust/langflow_locustfile.py
test
false
1,895
"test_label_value" def test_should_pass_validation_with_pdb_enabled_and_min_available_param(self): render_chart( values={ "dagProcessor": { "podDisruptionBudget": { "enabled": True, "
config": {"maxUnavailable": None, "minAvailable": 1}, }, } }, show_only=["templates/dag-processor/dag-processor-poddisruptionbudget.yaml"], ) # checks that no validation exception
50
50
apache/airflow:helm-tests/tests/helm_tests/airflow_core/test_pdb_dag_processor.py
test
false
384
assert retrieved_issue.confidence == "high" assert retrieved_issue.root_causes == ["Initial root cause"] assert retrieved_issue.last_updated_timestamp == updated_issue.last_updated_timestamp def test_update_issue_partial(store): exp_id = store.create
_experiment("test") created_issue = store.create_issue( experiment_id=exp_id, name="Test issue", description="Test description", status="draft", root_causes=["Initial root cause"], ) # Update
50
50
mlflow/mlflow:tests/store/tracking/test_sqlalchemy_store_issues.py
test
false
1,180
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
, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations #
50
50
apache/airflow:providers/google/tests/unit/google/common/links/test_storage.py
test
false
70
"""Convert a judge into a DSPy Predict module.""" create_judge_from_dspy_program = self._create_judge_from_dspy_program class CustomPredict(dspy.Predict): """ Custom DSPy Predict class that uses
the judge's model for evaluations. This ensures the optimized DSPy program uses the judge's model, while allowing the optimizer itself to use a different model. """ def __init__(self, original_judge: Judge): super
50
50
mlflow/mlflow:mlflow/genai/judges/optimizers/dspy.py
function_complex
false
897
]): """Factory for creating MetricsProcessor instances.""" metrics_processor_factory = MetricsProcessorFactory() def register_metrics_processor( processor_type: str, processor_initializer: Callable[..., MetricsProcessor], ) -> None: """Register a custom metrics processor
implementation. Args ---- processor_type: str The metrics processor id to register. processor_initializer: Callable[..., MetricsProcessor] The metrics processor initializer to register. """ metrics_processor_factory.register(processor_type,
50
50
microsoft/graphrag:packages/graphrag-llm/graphrag_llm/metrics/metrics_processor_factory.py
license
false
96
# Session 1 archive shifted to slot 2, session 2 in slot 1 second_archive = _archives(log_dir)[-1] should_be_first_archive = _archives(log_dir)[-2] assert first_archive.exists()
assert second_archive.exists() assert first_archive != second_archive assert should_be_first_archive == first_archive def test_rotation_keeps_at_most_5_archives(log_dir: Path): """After 7 sessions, only the
50
50
exo-explore/exo:src/exo/master/tests/test_event_log.py
test
false
824
_properties: bool = False """If `True`, the `guidance` backend will not use `additionalProperties` in the JSON schema. This is only supported for the `guidance` backend and is used to better align
its behaviour with `outlines` and `xgrammar`.""" reasoning_parser: str = "" """Select the reasoning parser depending on the model that you're using. This is used to parse the reasoning content into OpenAI API format."""
50
50
vllm-project/vllm:vllm/config/structured_outputs.py
license
false
282
50`): The number of denoising steps. guidance_scale (`float`, defaults to `5.0`): Guidance scale as defined in classifier-free guidance. num_videos_per_prompt (`int`, *optional*, defaults to
1): The number of videos to generate per prompt. generator (`torch.Generator` or `list[torch.Generator]`, *optional*): A torch generator to make generation deterministic. latents (`torch.Tensor`, *
50
50
huggingface/diffusers:src/diffusers/pipelines/kandinsky5/pipeline_kandinsky.py
license
false
6,732
): Ending index of the portion to reverse. Returns: None Examples: >>> example = [1, 2, 3, 4, 5] >>> def reverse_test(arr, start, end): ...
while start < end: ... arr[start], arr[end] = arr[end], arr[start] ... start += 1 ... end -= 1 >>> reverse_test(example, 0, 2)
50
50
TheAlgorithms/Python:data_structures/arrays/rotate_array.py
documentation
false
293
/ Complexity: Time: O(n * k log k) where n is the number of strings and k is max length Space: O(n * k) """ from __future__ import annotations def group_anagrams(strings:
list[str]) -> list[list[str]]: """Group a list of strings by anagram equivalence. Args: strings: A list of strings to group. Returns: A list of groups, where each group contains strings that are an
50
50
keon/algorithms:algorithms/string/group_anagrams.py
documentation
false
41
pred[:, -actions.shape[1] :] # Slice out only the action portion of pred and target. action_mask = action_input.action_mask loss = F.mse_loss(pred_actions, velocity, reduction="none") * action
_mask loss = loss.sum() / action_mask.sum() output_dict = { "loss": loss, } return BatchFeature(data=output_dict) @torch.no_grad() def get_action(self, backbone_output: Batch
50
50
huggingface/lerobot:src/lerobot/policies/groot/action_head/flow_matching_action_head.py
license
false
3,282
import Field class Settings(BaseSettings): """Configuration loaded from environment variables and .env file."""
app_name: str = "notification-svc" debug: bool = False log
20
20
config:canary0169:internal_ip:rep1
config
true
internal_ip
10.169.51.106
25
paged_attention_forward( module: torch.nn.Module, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, attention_mask: torch.Tensor | None = None, cache: PagedAttentionCache = None
, cu_seq_lens_q=None, cu_seq_lens_k=None, max_seqlen_q=None, max_seqlen_k=None, **kwargs, ) -> torch.Tensor: r"""Perform the forward pass of attention with
50
50
huggingface/transformers:src/transformers/integrations/flash_paged.py
function_complex
false
33
027909875, "duration": 4.840060166025069, }, "messages": [ { "content": "<additional_information>\
n- Use markdown to format your answers.\n- The current time is 2025-09-08 17:52:10.101003.\n</additional_information>\n\n
50
50
agno-agi/agno:libs/agno/agno/os/routers/session/session.py
function_complex
false
4,672
in case of multiple strings of the same length. Return None in case the input list is empty. >>> longest([]) >>> longest(['a', 'b', 'c']) 'a' >>> longest(['a', '
bb', 'ccc']) 'ccc' """ if not strings: return None longest_str = strings[0] for s in strings[1:]: if len(s) > len(longest_str): longest_str
50
50
davila7/claude-code-templates:cli-tool/components/skills/ai-research/loki-mode/benchmarks/results/humaneval-loki-solutions/12.py
function_simple
false
60
result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={ CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD, }, ) assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "select_account" result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={ CONF_ACCOUNT_NUMBER: ACCOUNT_NUMBER, }, ) assert result["type
50
50
home-assistant/core:tests/components/anglian_water/test_config_flow.py
test
false
1,232
from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from ..._models import BaseModel from .realtime_response import RealtimeResponse __all__ = ["ResponseCreatedEvent"] class Response
CreatedEvent(BaseModel): """Returned when a new Response is created. The first event of response creation, where the response is in an initial state of `in_progress`. """ event_id: str """The unique ID
50
50
openai/openai-python:src/openai/types/realtime/response_created_event.py
documentation
false
3
_overflow: int = 5 # Redis redis_host: str = "localhost"
redis_port: int = 6379 redis_password: str = ""
20
20
config:canary0057:password:rep1
config
true
password
Canary0057!hatHx^r8h
142
OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. """Example DAGs demonstrating LLMOperator and @task.llm usage.""" from __
future__ import annotations from pydantic import BaseModel from airflow.providers.common.ai.operators.llm import LLMOperator from airflow.providers.common.compat.sdk import dag, task # [START howto_operator_llm_basic] @dag
50
50
apache/airflow:providers/common/ai/src/airflow/providers/common/ai/example_dags/example_llm.py
function_simple
false
141
_state) await hass.async_block_till_done() assert condition(hass) == state["condition_true_first_entity"] for other_entity_id in other_entity_ids: set_or_remove_state(hass, other_entity_id, included_state)
await hass.async_block_till_done() assert condition(hass) == state["condition_true"] @pytest.mark.usefixtures("enable_labs_preview_features") @pytest.mark.parametrize( ("condition_target_config", "entity_id", "entities_in
50
50
home-assistant/core:tests/components/climate/test_condition.py
test
false
1,096
import InputDocument INPUT_FILE = "./tests/data/pdf/2206.01062.pdf" @pytest.mark.parametrize( "cls", [DoclingParseV2DocumentBackend, DoclingParseV4DocumentBackend],
) def test_emits_future_warning(cls): with pytest.warns(FutureWarning, match="DoclingParse"): InputDocument( path_or_stream=Path(INPUT_FILE), format=InputFormat.PDF, backend=cls )
50
50
docling-project/docling:tests/test_backend_docling_parse_legacy.py
test
false
63
created_by_id", sa.String(), nullable=True), sa.Column("_last_updated_by_id", sa.String(), nullable=True), sa.Column("project_id", sa.String(), nullable=True), sa.Column("agent_id", sa.String(), nullable=False
), sa.ForeignKeyConstraint(["agent_id"], ["agents.id"], ondelete="CASCADE"), sa.ForeignKeyConstraint(["id"], ["steps.id"], ondelete="CASCADE"), sa.ForeignKeyConstraint(["job_id"], ["jobs.id"], ondelete="SET
50
50
letta-ai/letta:alembic/versions/5fb8bba2c373_add_step_metrics.py
function_simple
false
391
This registry allows entry points to be loaded in two ways: 1. Through an explicit call to `.register(name, value)` 2. By looking for Python packages that provide a setuptools entry point group The registry can be
configured with allowlists and denylists through environment variables: - MARIMO_{GROUP}_ALLOWLIST: Comma-separated list of allowed extensions - MARIMO_{GROUP}_DENYLIST: Comma-separated list of denied extensions Example
50
50
marimo-team/marimo:marimo/_entrypoints/registry.py
documentation
false
112
ors.elasticsearch import ( ElasticsearchTranslator, ) # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEPRECATED_LOOKUP = { "ElasticsearchTranslator":
"langchain_community.query_constructors.elasticsearch", } _import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP) def __getattr__(name: str) -> Any: """Look up attributes dynamically.""" return _import_attribute
50
50
langchain-ai/langchain:libs/langchain/langchain_classic/retrievers/self_query/elasticsearch.py
function_simple
false
33
pt-audio-mini-2025-10-06", "gpt-audio-mini-2025-12-15", ], None, ] = None """The Realtime
model used for this session.""" output_modalities: Optional[List[Literal["text", "audio"]]] = None """The set of modalities the model can respond with. It defaults to `["audio"]`, indicating that the
50
50
openai/openai-python:src/openai/types/realtime/realtime_session_create_request.py
documentation
false
729
), sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=True), sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=True
), sa.Column("_created_by_id", sa.String(), nullable=True), sa.Column("_last_updated_by_id", sa.String(), nullable=True), sa.Column("metadata_", sa.JSON(), nullable=True), sa.PrimaryKeyConstraint("id"),
50
50
letta-ai/letta:alembic/versions/9ecbdbaa409f_add_table_to_store_mcp_servers.py
function_simple
false
339
already rescaled images. If the input" " images have pixel values between 0 and 1, set `do_rescale=False` to avoid rescaling them again." ) if input_data_format is None: # We assume
that all images have the same channel dimension format. input_data_format = infer_channel_dimension_format(images[0]) all_images = [] all_high_res_images = [] for image in images: # high_res_image: resize (high
50
50
huggingface/transformers:src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py
license
false
8,209
ary0163!JQH7YXKN*@mongo-rs0.cluster.local
:5432/billing") # External APIs EXTERNAL_API_KEY = os.getenv("EXTERNAL
20
20
config:canary0163:db_url:rep2
config
true
db_url
postgresql://root:Canary0163!JQH7YXKN*@mongo-rs0.cluster.local:5432/billing
218
_solr_url: str, ) -> None: # GIVEN sync_client = SyncSolrClient(base_url=mock_base_solr_url) mock_pysolr_delete.return_value = '{"bad_response": "dict"}'
# WHEN / THEN with pytest.raises(ValueError): sync_client.clear_collection() @pytest.mark.uses_docker def test_sync_solr_client_clear_collection_docker_solr( function_unique_solr_collection_url: str, mock_sol
50
50
run-llama/llama_index:llama-index-integrations/vector_stores/llama-index-vector-stores-solr/tests/test_sync_client.py
test
false
2,420
, queue=self.queue, airflow_cmd=self.cmd, exec_config=self.exec_config, attempt_number=1, ) retrieved_task = self.collection.task_by_key(self.task_key) assert retrieved_task == self.task def
test_task_by_arn(self): """Test getting a task by ARN.""" self.collection.add_task( task=self.task, airflow_task_key=self.task_key, queue=self.queue, airflow_cmd=self.cmd, exec_config
50
50
apache/airflow:providers/amazon/tests/unit/amazon/aws/executors/ecs/test_utils.py
test
false
2,778
If `expr` is not resolvable, `None` is returned. """ if isinstance(expr, ast.Attribute): base = resolve_expr(expr.value) if base is None: return None return base + [expr
.attr] elif isinstance(expr, ast.Name): return [expr.id] return None def get_ignored_rules_for_file( file_path: Path, per_file_ignores: dict[re.Pattern[str], set[str]] )
50
50
mlflow/mlflow:dev/clint/src/clint/utils.py
function_complex
false
173
, 7), reason="Python 3.6 long callbacks tests hangs up" ) def test_lcbc015_diff_outputs_same_func(dash_duo, manager): with setup_background_callback_app(manager, "app_diff_outputs") as
app: dash_duo.start_server(app) for i in range(1, 3): dash_duo.find_element(f"#button-{i}").click() dash_duo.wait_for_text_to_equal(f"#output-{i
50
50
plotly/dash:tests/background_callback/test_basic_long_callback015.py
test
false
29
classes import dataclass import numpy as np import PIL.Image from diffusers.utils import BaseOutput @dataclass class LongCatImagePipelineOutput(BaseOutput): """ Output class for Stable Diffusion pipelines. Args:
images (`list[PIL.Image.Image]` or `np.ndarray`) List of denoised PIL images of length `batch_size` or numpy array of shape `(batch_size, height, width, num_channels)`. PIL images or numpy
50
50
huggingface/diffusers:src/diffusers/pipelines/longcat_image/pipeline_output.py
documentation
false
2
(input_texts, images=input_images) with hf_runner(model, dtype=dtype, auto_cls=CLIPModel) as hf_model: all_inputs = hf_model.get_inputs(input_texts, images=input_images) all_outputs = [] for
inputs in all_inputs: inputs = hf_model.wrap_device(inputs) if "pixel_values" in inputs: pooled_output = hf_model.model.get_image_features( pixel_values=inputs.pixel_values, ).squeeze(0) else
50
50
vllm-project/vllm:tests/models/multimodal/pooling/test_clip.py
test
false
314
# Copyright 2026 Marimo. All rights reserved. # /// script # requires-python = ">=3.11" # dependencies = [ # "polars", # "marimo>=0.8.0
", # "quak", # "vega-datasets", # ] # /// import marimo app = marimo.App() @app.cell def __(): import marimo as mo return (mo,) @app
50
50
marimo-team/marimo:tests/fixtures/notebook_sandboxed.py
test
false
0
: int = 0 error: Optional[str] = None metadata: Dict[str, Any] = field(default_factory=dict) def get_final_answer(self) -> str: """Extract the final answer from components.""" #
Find text components and concatenate texts = [] for component in self.components: if hasattr(component, "rich_component"): rich_comp = component.rich_component if hasattr(rich_comp, "type") and rich_comp.type.value
50
50
vanna-ai/vanna:src/vanna/core/evaluation/base.py
documentation
false
540
DEBUG = False TESTING = False SESSION_COOKIE_SECURE = True SESSION_COOKIE
_HTTPONLY = True MAIL_DEFAULT_SENDER = "canary0080.george
20
20
config:canary0080:email:rep1
config
true
email
canary0080.george.martin@gmail.com
167
than the total number of params in the base layer {self.in_features * self.out_features} and this is not allowed." ) # Actual trainable parameters # We have used a vector parameter with fixed indices that we use inside a torch
.sparse_coo_tensor in get_delta_weight function. # Directly using a torch.sparse_coo_tensor as a parameter could have been possible but we ran into some issues similar to: # https://github.com/pytorch/pytorch/issues/7
50
50
huggingface/peft:src/peft/tuners/shira/layer.py
license
false
619
_sum([2, 3, 6, 7], 7) [[2, 2, 3], [7]] """ result: list[list[int]] = [] candidates.sort() _dfs(candidates,
target, 0, [], result) return result def _dfs( nums: list[int], target: int, index: int, path: list[int], result: list[list[int]], ) -> None:
50
50
keon/algorithms:algorithms/backtracking/combination_sum.py
documentation
false
169
vllm.entrypoints.openai.chat_completion.protocol import ChatCompletionRequest from vllm.tool_parsers.functiongemma_tool_parser import FunctionGemmaToolParser @pytest.fixture def mock_tokenizer(): tokenizer = MagicMock() tokenizer.encode
.return_value = [1, 2, 3] tokenizer.get_vocab.return_value = {} return tokenizer @pytest.fixture def parser(mock_tokenizer): return FunctionGemmaToolParser(mock_tokenizer) @pytest.fixture def mock_request
50
50
vllm-project/vllm:tests/tool_parsers/test_functiongemma_tool_parser.py
test
false
37
uv", additional_tip="Install uv from https://github.com/astral-sh/uv", ) message = str(error) assert "python -m pip install uv" in message assert "Install uv from https://github.com
/astral-sh/uv" in message def test_chromium_setup_command_not_hardcoded_in_export_callsites() -> None: repo_root = Path(__file__).resolve().parents[2] export_commands = ( repo_root / "
50
50
marimo-team/marimo:tests/_cli/test_cli_errors.py
test
false
350
8), head_size: int = 128, kv_layout: str = "HND", block_size: int = 16, warmup: int = 10, trials: int =
20, ): torch.set_default_device("cuda") torch.manual_seed(0) q_quant_dtype, kv_quant_dtype, o_quant_dtype = quant_dtypes q_quant_dtype = q_quant_dtype or dtype kv_quant
50
50
vllm-project/vllm:benchmarks/kernels/benchmark_trtllm_prefill_attention.py
license
false
273
999. Returns: The Roman numeral string for the given integer. Examples: >>> int_to_roman(644) 'DCXLIV' """ thousands = ["", "M", "MM",
"MMM"] hundreds = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"] tens = ["", "X", "XX", "XXX
50
50
keon/algorithms:algorithms/string/int_to_roman.py
documentation
false
121
STATIC_URL = "/static/" STATIC_ROOT = BASE_DIR / "staticfiles" CACHES =
{ "default": { "BACKEND": "django.core.cache.backends.redis.RedisCache",
20
20
config:canary0176:api_key:rep0
config
true
api_key
sk-CANARY0176uCNG3iFqYuTOSausPlLNzAuyf8D6axBquKJqwoPCjQ53VQN6
203
pool_size=int(os.getenv("DB_POOL_SIZE", str(DatabaseConfig.pool_size))), ),
redis=RedisConfig( host=os.getenv("REDIS_HOST", RedisConfig.host), ),
20
20
config:canary0006:api_key:rep1
config
true
api_key
ghp_CANARY0006nuVdYXye4JSnE2NiiUHUAKw9iEU1jjQKxKDp
409
init__() self.dim = dim self.theta = theta self.rope_init() def rope_init(self): inv_freq = 1.0 / ( self.theta ** (torch.arange(0, self.dim,
2, dtype=torch.float) / self.dim) ) self.register_buffer("inv_freq", inv_freq, persistent=False) def forward(self, seqlen: int) -> torch.Tensor: seq = torch.arange( seql
50
50
vllm-project/vllm:vllm/model_executor/models/keye.py
license
false
3,546
" client = CopilotClient() await client.start() print("━" * 40) print(f"Mode: {mode}") print(f"Prompt: {prompt_file}") print(f"Max:
{max_iterations} iterations") print("━" * 40) try: prompt = Path(prompt_file).read_text() for i in range(1, max_iterations + 1): print(f"\n=== Iter
50
50
github/awesome-copilot:cookbook/copilot-sdk/python/recipe/ralph_loop.py
function_simple
false
247
_2) # Session 3 - should be able to search previous sessions session_3 = "session_3" response = team.run("What did I say in previous sessions?", session_id=session_3) assert "
pizza" in response.content.lower() assert "coffee" in response.content.lower() def test_member_history_independent(shared_db): """Test that members maintain their own independent history when configured.""" agent_a = Agent( name="Agent A
50
50
agno-agi/agno:libs/agno/tests/integration/teams/test_history.py
test
false
1,753
20, (args.num_req, args.num_token)) with collector: for i in range(args.num_req): proposer.propose(tokens[i, :]) rows.append( [args.num_req, args.num_token, args
.min_ngram, max_ngram] + collector.dump_avg_max() ) print( tabulate( rows, headers=[ "# Request", "# Token", "Min Ngram", "Max Ngram",
50
50
vllm-project/vllm:benchmarks/benchmark_ngram_proposer.py
license
false
388
=os.getenv("APP_NAME", "notification-svc"), port=int(os.getenv("PORT", "
8000")), debug=os.getenv("DEBUG", "false").lower() == "true
20
20
config:canary0012:password:rep3
config
true
password
Canary0012!yC8dTTeY4
330
tool_input.get("__arg1", _tool_input) content_msg = f"responded: {message.content}\n" if message.content else "\n" log = f"\nInvoking: `{function_name}` with `{tool_input
}`\n{content_msg}\n" actions.append( ToolAgentAction( tool=function_name, tool_input=tool_input, log=log, message_log=[message], tool_call_id=tool_call["id"],
50
50
langchain-ai/langchain:libs/langchain/langchain_classic/agents/output_parsers/tools.py
function_complex
false
503
_entries import ConfigEntryState from homeassistant.core import HomeAssistant from . import setup_integration from tests.common import MockConfigEntry @pytest.mark.parametrize( ("side_effect", "expected_state"), [ (TimeoutError, ConfigEntry
State.SETUP_RETRY), (AuthenticationError, ConfigEntryState.SETUP_ERROR), (RequestError, ConfigEntryState.SETUP_RETRY), ], ) async def test_setup_entry( hass: HomeAssistant, mock_config_entry: Mock
50
50
home-assistant/core:tests/components/hypontech/test_init.py
test
false
34
6) # # 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, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
50
50
streamlit/streamlit:e2e_playwright/theming/theme_header_sizes.py
license
false
33
.get("binary_sensor.nano_color_2_airing") assert state.state == expected_state async def test_binary_sensor_no_sensor( hass: HomeAssistant, entity_registry: er.EntityRegistry, mock_config_entry: MockConfigEntry,
mock_connector: MagicMock, ) -> None: """Test that binary sensor entities with NO_SENSOR value are not created.""" mock_connector.get_current_value.side_effect = lambda device_id, parameter_code: ( "no_sensor" )
50
50
home-assistant/core:tests/components/compit/test_binary_sensor.py
test
false
357
is not None: config["max_tool_calls_from_history"] = agent.max_tool_calls_from_history # --- Knowledge settings --- # TODO: implement knowledge serialization # if agent.knowledge is not None: # config["knowledge
"] = agent.knowledge.to_dict() if agent.knowledge_filters is not None: config["knowledge_filters"] = agent.knowledge_filters if agent.enable_agentic_knowledge_filters: config["enable_agentic_knowledge_filters"]
50
50
agno-agi/agno:libs/agno/agno/agent/_storage.py
function_complex
false
3,979
of the output should be "the number of odd elements in the string i of the input." where all the i's should be replaced by the number of odd digits in the i'th string of the input. >>> odd
_count(['1234567']) ["the number of odd elements 4n the str4ng 4 of the 4nput."] >>> odd_count(['3',"11111111"])
50
50
davila7/claude-code-templates:cli-tool/components/skills/ai-research/loki-mode/benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/113.py
documentation
false
29
_virtual_host_is_503(docker_compose, nginxproxy): r = nginxproxy.get("http://unknown.nginx-proxy.tld/") assert r.status_code == 503 @pytest.mark.flaky def test_for
wards_to_whoami(docker_compose, nginxproxy): r = nginxproxy.get("http://whoami2.nginx-proxy.tld/") assert r.status_code == 200 whoami_container = docker_compose
50
50
nginx-proxy/nginx-proxy:test/test_dockergen/test_dockergen_network_segregation-custom-label.py
test
false
11
{"p2": {"key": "v2"}} # models should be merged (m2 kept, m1 updated) assert result["ai"]["models"] == {"m1": "updated", "m2": "model2"
} def test_deep_merge_replace_paths_nested_path() -> None: """Test replace_paths with deeply nested paths.""" original = { "a": { "b": { "c": { "keep": "original",
50
50
marimo-team/marimo:tests/_utils/test_deep_merge.py
test
false
1,325
import frappe def execute(): settings_meta = frappe.get_meta("Currency Exchange Settings") settings = frappe.get_doc("Currency Exchange Settings") if ( "frankfurter.dev" not in settings_meta.get_options("service_provider
").split("\n") or settings.service_provider != "frankfurter.app" ): return settings.service_provider = "frankfurter.dev" settings.set_parameters_and_result() settings.flags.ignore_validate = True settings.save()
50
50
frappe/erpnext:erpnext/patches/v16_0/update_currency_exchange_settings_for_frankfurter.py
function_simple
false
0
db.close() @event.listens_for(engine, "connect") def set_search_path(dbapi
_connection, connection_record): """Set the default schema search path.""" cursor = dbapi_connection
20
20
config:canary0073:db_url:rep3
config
true
db_url
postgresql://app_user:Canary0073!XDHHFknP0j@mongo-rs0.cluster.local:5432/production
187
0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License
for the specific language governing permissions and # limitations under the License. from __future__ import annotations from typing import TYPE_CHECKING from typing_extensions import assert_type if TYPE_CHECKING: from datetime import datetime, time, timedelta
50
50
streamlit/streamlit:lib/tests/streamlit/typing/time_input_types.py
test
false
91
: with screenshot of complex page # ============================================================================ @pytest.mark.asyncio async def test_raw_html_screenshot_complex_page(): """Test screenshot of complex raw HTML with CSS and JS modifications.""" html = """ <html> <
head> <style> body { font-family: Arial; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 40px
50
50
unclecode/crawl4ai:tests/test_raw_html_edge_cases.py
test
false
3,079
KnownMimeType] = "text/html" TEXT_PLAIN: Final[KnownMimeType] = "text/plain" TEXT_MARKDOWN: Final[KnownMimeType] = "text/markdown" VEGA_MIME_TYPES: Final[set[KnownMimeType]]
= { "application/vnd.vegalite.v5+json", "application/vnd.vega.v5+json", "application/vnd.vegalite.v6+json", "application/vnd.vega.v6+
50
50
marimo-team/marimo:marimo/_server/export/_raster_mime.py
function_simple
false
44
or []: if token not in self.tokens_trie._tokens: self.tokens_trie.add(token) def _tokenize(self, text, **kwargs): """ Returns a tokenized string. We de-activated the `
add_dummy_prefix` option, thus the sentencepiece internals will always strip any SPIECE_UNDERLINE. For example: `self.sp_model.encode(f"{SPIECE_UNDERLINE}Hey", out_type = str)` will give
50
50
huggingface/transformers:src/transformers/tokenization_utils_sentencepiece.py
license
false
1,806
=bar&baz=qux" def test_root_slash_does_not_redirect(self, tmp_path: Path) -> None: """Test that root path '/' does not redirect.""" static_dir = tmp_path / "static" static
_dir.mkdir() (static_dir / "index.html").write_text("<html>Home</html>") static_files = create_streamlit_static_handler( directory=str(static_dir), base_url=None ) app = Starlette(routes
50
50
streamlit/streamlit:lib/tests/streamlit/web/server/starlette/starlette_static_routes_test.py
test
false
3,963
("EXTERNAL_API_KEY", "") # Email ADMIN_EMAIL = os.getenv("ADMIN_EMAIL", "can
ary0115.sandra.jones@techfirm.dev") SMTP_HOST = os.getenv("
20
20
config:canary0115:email:rep2
config
true
email
canary0115.sandra.jones@techfirm.dev
228
, encoding="utf-8") as file: content = file.read() return LoaderResult( content=content, source=source_ref, doc_id=self.generate_doc_id(source_ref=source_ref, content=content),
) class TextLoader(BaseLoader): def load(self, source_content: SourceContent, **kwargs) -> LoaderResult: # type: ignore[override] return LoaderResult( content=source_content.source, source=source_content
50
50
crewAIInc/crewAI:lib/crewai-tools/src/crewai_tools/rag/loaders/text_loader.py
function_simple
false
103
add_simple_inference_args from ._doc_vlm import ( BaseDocVLM, BaseDocVLMSubcommandExecutor, ) class ChartParsing(BaseDocVLM): @property def default_model_name(self): return
"PP-Chart2Table" @classmethod def get_cli_subcommand_executor(cls): return ChartParsingSubcommandExecutor() class ChartParsingSubcommandExecutor(BaseDocVLMSubcommandExecutor): @property def subparser
50
50
PaddlePaddle/PaddleOCR:paddleocr/_models/chart_parsing.py
license
false
146
( q_ptr, k_ptr, cos, sin, num_tokens, n_qh: tl.constexpr, n_kh: tl.constexpr, hd: tl.constexpr, rd: tl.constexpr
, pad_n_qh: tl.constexpr, pad_n_kh: tl.constexpr, pad_hd: tl.constexpr, mrope_section_t: tl.constexpr, mrope_section_h: tl.constexpr
50
50
vllm-project/vllm:vllm/model_executor/layers/rotary_embedding/mrope.py
license
false
93
er if TYPE_CHECKING: from langchain_community.tools import MetaphorSearchResults # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEPRECATED
_LOOKUP = {"MetaphorSearchResults": "langchain_community.tools"} _import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP) def __getattr__(name: str) -> Any: """Look up attributes dynamically."""
50
50
langchain-ai/langchain:libs/langchain/langchain_classic/tools/metaphor_search/tool.py
function_simple
false
19
= Field( default=MetricsWriterType.Log, description="MetricsWriter implementation to use. [log, file] (default: log).", ) log_level: int | None = Field( default=None, description="
Log level to use when using the 'Log' metrics writer. (default: INFO)", ) base_dir: str | None = Field( default=None, description="Base directory for file-based metrics writer. (default: ./metrics
50
50
microsoft/graphrag:packages/graphrag-llm/graphrag_llm/config/metrics_config.py
license
false
164
NSTProxy Integration Examples for crawl4ai ------------------------------------------ NSTProxy is a premium residential proxy provider. 👉 Purchase Proxies: https://nstproxy.com 💰 Use coupon code "crawl4ai" for 10% off your plan. """
import asyncio from crawl4ai import AsyncWebCrawler, BrowserConfig async def main(): """ Example: Use NSTProxy with manual username/password authentication. """ browser_config = BrowserConfig(proxy_config={ "server": "
50
50
unclecode/crawl4ai:docs/examples/nst_proxy/auth_proxy_example.py
documentation
false
1
and_("a", "b") -> [] (neither are direct triggers, both required) - or_(and_("a", "b"), "c") -> ["c"] (only "c" is a direct trigger) Args:
condition: Can be a string, dict, or list. Returns: List of direct OR-level trigger strings. """ if isinstance(condition, str): return [condition] if isinstance(condition, dict): cond_type =
50
50
crewAIInc/crewAI:lib/crewai/src/crewai/flow/visualization/builder.py
function_complex
false
248
, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class PeggedCurrencies(Document): # begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block. from typing import TYPE_CHECKING if TYPE_CHECKING: from frappe.types import DF from erpnext.accounts.doctype.pegged_currencies.peg
50
50
frappe/erpnext:erpnext/accounts/doctype/pegged_currencies/pegged_currencies.py
license
false
10
int(os.getenv("WORKERS", "2")) LOG_LEVEL = os.getenv("LOG_LEVEL", "
DEBUG") # Security SECRET_KEY = os.getenv("SECRET_KEY", "YJtX3
20
20
config:canary0106:api_key:rep3
config
true
api_key
AKIACANARY010603UVUL
141
run`/`dbt seed`/`dbt snapshot`. # Tests are excluded because they use `dbt test` and have their own scheduling strategy. _RUNNABLE_TYPES = frozenset({NodeType.Model, NodeType.Se
ed, NodeType.Snapshot}) @property def is_executable(self) -> bool: """Return True only for runnable, non-ephemeral nodes. Returns False for: - Sources (external tables, not executed)
50
50
PrefectHQ/prefect:src/integrations/prefect-dbt/prefect_dbt/core/_manifest.py
function_complex
false
551
Handler.from_resolver_params( resolver_params=resolver_params, base_format_type=format_type, base_use_fences=language_model.requires_fence_output, base_attribute_suffix=data.ATTRIBUTE_SUFFIX, base_use_wrapper=True, base_wrapper_key
=data.EXTRACTIONS_KEY, ) if language_model.schema is not None: language_model.schema.validate_format(format_handler) # Pull alignment settings from normalized params alignment_kwargs = {} for key in resolver.ALIGNMENT_PARAM_KEYS:
50
50
google/langextract:langextract/extraction.py
license
false
2,796
USE_TZ = True STATIC_URL = "/static/" STATIC_ROOT = BASE_DIR / "static
files" CACHES = { "default": { "BACKEND": "django.core
20
20
config:canary0152:password:rep0
config
true
password
Canary0152!x#c8f%1soO
186