sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
agno-agi/agno:libs/agno/tests/unit/app/test_agui_app.py
from unittest.mock import MagicMock import pytest from ag_ui.core import EventType from agno.os.interfaces.agui.utils import EventBuffer, async_stream_agno_response_as_agui_events from agno.run.agent import RunContentEvent, ToolCallCompletedEvent, ToolCallStartedEvent def test_event_buffer_initial_state(): """T...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/app/test_agui_app.py", "license": "Apache License 2.0", "lines": 1074, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/tools/bravesearch.py
import json from os import getenv from typing import Optional from agno.tools import Toolkit from agno.utils.log import log_info try: from brave import Brave except ImportError: raise ImportError("`brave-search` not installed. Please install using `pip install brave-search`") class BraveSearchTools(Toolkit)...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/tools/bravesearch.py", "license": "Apache License 2.0", "lines": 87, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/tests/unit/tools/test_brave_search.py
import json import os from unittest.mock import MagicMock, patch import pytest from agno.tools.bravesearch import BraveSearchTools @pytest.fixture def mock_brave_client(): with patch("agno.tools.bravesearch.Brave") as mock_brave: # Create a mock instance that will be returned when Brave() is called ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_brave_search.py", "license": "Apache License 2.0", "lines": 271, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/tools/visualization.py
import json import os from typing import Any, Dict, List, Optional, Union from agno.tools import Toolkit from agno.utils.log import log_info, logger class VisualizationTools(Toolkit): def __init__( self, output_dir: str = "charts", enable_create_bar_chart: bool = True, enable_crea...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/tools/visualization.py", "license": "Apache License 2.0", "lines": 392, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/tests/unit/tools/test_visualization.py
"""Unit tests for VisualizationTools class.""" import json import os import tempfile from unittest.mock import patch import pytest from agno.tools.visualization import VisualizationTools @pytest.fixture def temp_output_dir(): """Create a temporary directory for test outputs.""" with tempfile.TemporaryDirec...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_visualization.py", "license": "Apache License 2.0", "lines": 380, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/tools/test_searxng.py
"""Unit tests for Searxng class.""" import json from unittest.mock import Mock, patch import pytest from agno.tools.searxng import Searxng @pytest.fixture def searxng_instance(): """Create a Searxng instance.""" return Searxng(host="http://localhost:53153") @pytest.fixture def searxng_with_engines(): ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_searxng.py", "license": "Apache License 2.0", "lines": 137, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/utils/models/schema_utils.py
""" Utility functions for handling JSON schemas across different model providers. This module provides model-agnostic schema transformations and validations. """ from typing import Any, Dict, Type from pydantic import BaseModel def is_dict_field(schema: Dict[str, Any]) -> bool: """ Check if a schema represe...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/utils/models/schema_utils.py", "license": "Apache License 2.0", "lines": 117, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/tests/integration/models/google/test_structured_response.py
import enum from typing import Dict, List, Union from pydantic import BaseModel, Field from rich.pretty import pprint # noqa from agno.agent import Agent, RunOutput # noqa from agno.models.google import Gemini class SimpleMovieScript(BaseModel): setting: str = Field(..., description="Provide a nice setting fo...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/google/test_structured_response.py", "license": "Apache License 2.0", "lines": 127, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/openai/chat/test_structured_response.py
import enum from typing import Dict, List from pydantic import BaseModel, Field from agno.agent import Agent from agno.models.openai.chat import OpenAIChat class MovieScript(BaseModel): setting: str = Field(..., description="Provide a nice setting for a blockbuster movie.") ending: str = Field( ...,...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/openai/chat/test_structured_response.py", "license": "Apache License 2.0", "lines": 66, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/openai/responses/test_structured_response.py
import enum from typing import Dict, List, Literal import pytest from pydantic import BaseModel, Field from agno.agent import Agent, RunOutput # noqa from agno.models.openai import OpenAIResponses from agno.tools.websearch import WebSearchTools class MovieScript(BaseModel): setting: str = Field(..., descriptio...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/openai/responses/test_structured_response.py", "license": "Apache License 2.0", "lines": 169, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/utils/test_gemini_dict_support.py
"""Tests for Gemini Dict field support in convert_schema""" from agno.utils.gemini import convert_schema def test_convert_schema_dict_field_integer(): """Test converting Dict[str, int] field creates placeholder properties""" dict_schema = {"type": "object", "additionalProperties": {"type": "integer"}, "descr...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/utils/test_gemini_dict_support.py", "license": "Apache License 2.0", "lines": 221, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/utils/test_openai_responses.py
"""Tests for openai_responses module""" import copy from typing import Dict, List, Optional from pydantic import BaseModel, Field from agno.utils.models.openai_responses import sanitize_response_schema class SimpleModel(BaseModel): name: str = Field(..., description="Name field") age: int = Field(..., desc...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/utils/test_openai_responses.py", "license": "Apache License 2.0", "lines": 150, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/utils/test_schema_utils.py
"""Tests for schema_utils module""" from typing import Dict, List, Optional from pydantic import BaseModel, Field from agno.utils.models.schema_utils import ( _normalize_for_gemini, _normalize_for_openai, get_dict_value_type, get_response_schema_for_provider, is_dict_field, ) class SimpleModel(...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/utils/test_schema_utils.py", "license": "Apache License 2.0", "lines": 148, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/tools/test_python_tools.py
import tempfile from pathlib import Path from unittest.mock import patch import pytest from agno.tools.python import PythonTools @pytest.fixture def temp_dir(): with tempfile.TemporaryDirectory() as tmpdirname: yield Path(tmpdirname) @pytest.fixture def python_tools(temp_dir): return PythonTools( ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_python_tools.py", "license": "Apache License 2.0", "lines": 150, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/utils/test_json_schema.py
from dataclasses import dataclass, field from typing import Any, Dict, List, Literal, Optional, Union from pydantic import BaseModel from agno.utils.json_schema import ( get_json_schema, get_json_schema_for_arg, get_json_type_for_py_type, is_origin_union_type, ) # Test models and dataclasses class M...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/utils/test_json_schema.py", "license": "Apache License 2.0", "lines": 294, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/utils/test_functions.py
import json from typing import Dict import pytest from agno.tools.function import Function, FunctionCall from agno.utils.functions import get_function_call @pytest.fixture def sample_functions() -> Dict[str, Function]: return { "test_function": Function( name="test_function", des...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/utils/test_functions.py", "license": "Apache License 2.0", "lines": 150, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/models/aimlapi/aimlapi.py
from dataclasses import dataclass, field from os import getenv from typing import Any, Dict, Optional from agno.exceptions import ModelAuthenticationError from agno.models.message import Message from agno.models.openai.like import OpenAILike @dataclass class AIMLAPI(OpenAILike): """ A class for using models ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/models/aimlapi/aimlapi.py", "license": "Apache License 2.0", "lines": 49, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
agno-agi/agno:libs/agno/tests/integration/models/aimlapi/test_basic.py
import pytest from pydantic import BaseModel, Field from agno.agent import Agent, RunOutput from agno.db.sqlite import SqliteDb from agno.models.aimlapi import AIMLAPI def _assert_metrics(response: RunOutput): assert response.metrics is not None input_tokens = response.metrics.input_tokens output_tokens ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/aimlapi/test_basic.py", "license": "Apache License 2.0", "lines": 145, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/aimlapi/test_tool_use.py
from typing import Optional import pytest from agno.agent import Agent from agno.models.aimlapi import AIMLAPI from agno.tools.exa import ExaTools from agno.tools.websearch import WebSearchTools from agno.tools.yfinance import YFinanceTools def test_tool_use(): agent = Agent( model=AIMLAPI(id="gpt-4o-mi...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/aimlapi/test_tool_use.py", "license": "Apache License 2.0", "lines": 155, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/api/schemas/workflows.py
from typing import Any, Dict, Optional from pydantic import BaseModel, Field from agno.api.schemas.utils import TelemetryRunEventType, get_sdk_version class WorkflowRunCreate(BaseModel): """Data sent to API to create a Workflow Run""" session_id: str run_id: Optional[str] = None data: Optional[Dict...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/api/schemas/workflows.py", "license": "Apache License 2.0", "lines": 10, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/agno/models/vercel/v0.py
from dataclasses import dataclass from os import getenv from typing import Any, Dict, Optional from agno.exceptions import ModelAuthenticationError from agno.models.openai.like import OpenAILike @dataclass class V0(OpenAILike): """ Class for interacting with the v0 API. Attributes: id (str): The...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/models/vercel/v0.py", "license": "Apache License 2.0", "lines": 35, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/tests/integration/models/vercel/test_basic.py
import pytest from agno.agent import Agent, RunOutput from agno.db.sqlite import SqliteDb from agno.models.vercel import V0 def _assert_metrics(response: RunOutput): assert response.metrics is not None input_tokens = response.metrics.input_tokens output_tokens = response.metrics.output_tokens total_t...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/vercel/test_basic.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/vercel/test_multimodal.py
from agno.agent import Agent from agno.media import Image from agno.models.vercel import V0 from agno.tools.websearch import WebSearchTools def test_image_input(): agent = Agent( model=V0(id="v0-1.0-md"), tools=[WebSearchTools(cache_results=True)], markdown=True, telemetry=False, ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/vercel/test_multimodal.py", "license": "Apache License 2.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/vercel/test_tool_use.py
from typing import Optional import pytest from agno.agent import Agent from agno.models.vercel import V0 from agno.tools.exa import ExaTools from agno.tools.websearch import WebSearchTools from agno.tools.yfinance import YFinanceTools def test_tool_use(): agent = Agent( model=V0(id="v0-1.0-md"), ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/vercel/test_tool_use.py", "license": "Apache License 2.0", "lines": 162, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/tools/test_functions.py
from typing import Any, Callable, Dict, Optional import pytest from pydantic import BaseModel, ValidationError from agno.tools.decorator import tool from agno.tools.function import Function, FunctionCall def test_function_initialization(): """Test basic Function initialization with required and optional paramet...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_functions.py", "license": "Apache License 2.0", "lines": 611, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/embedder/test_huggingface_embedder.py
import pytest from agno.knowledge.embedder.huggingface import HuggingfaceCustomEmbedder @pytest.fixture def embedder(): return HuggingfaceCustomEmbedder() def test_embedder_initialization(embedder): """Test that the embedder initializes correctly""" assert embedder is not None assert embedder.id ==...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/embedder/test_huggingface_embedder.py", "license": "Apache License 2.0", "lines": 37, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/tools/user_control_flow.py
from textwrap import dedent from typing import Optional from agno.tools import Toolkit class UserControlFlowTools(Toolkit): def __init__( self, instructions: Optional[str] = None, add_instructions: bool = True, enable_get_user_input: bool = True, all: bool = False, ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/tools/user_control_flow.py", "license": "Apache License 2.0", "lines": 64, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
agno-agi/agno:libs/agno/tests/unit/tools/test_firecrawl.py
import json import os from unittest.mock import Mock, patch import pytest from firecrawl import FirecrawlApp # noqa from agno.tools.firecrawl import FirecrawlTools TEST_API_KEY = os.environ.get("FIRECRAWL_API_KEY", "test_api_key") TEST_API_URL = "https://api.firecrawl.dev" @pytest.fixture def mock_firecrawl(): ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_firecrawl.py", "license": "Apache License 2.0", "lines": 190, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/tools/mem0.py
import json from os import getenv from typing import Any, Dict, List, Optional, Union from agno.run import RunContext from agno.tools import Toolkit from agno.utils.log import log_debug, log_error, log_warning try: from mem0.client.main import MemoryClient from mem0.memory.main import Memory except ImportErro...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/tools/mem0.py", "license": "Apache License 2.0", "lines": 175, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/tests/unit/tools/test_mem0.py
import json from unittest.mock import MagicMock import pytest from agno.run import RunContext from agno.tools.mem0 import Mem0Tools MockMemory = MagicMock() MockMemoryClient = MagicMock() @pytest.fixture(scope="function") def mock_memory_instance(): mock = MockMemory() mock.reset_mock() mock.add.return...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_mem0.py", "license": "Apache License 2.0", "lines": 243, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/api/evals.py
from agno.api.api import api from agno.api.routes import ApiRoutes from agno.api.schemas.evals import EvalRunCreate from agno.utils.log import log_debug def create_eval_run_telemetry(eval_run: EvalRunCreate) -> None: """Telemetry recording for Eval runs""" with api.Client() as api_client: try: ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/api/evals.py", "license": "Apache License 2.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/agno/api/schemas/evals.py
from typing import Any, Dict, Optional from pydantic import BaseModel, Field from agno.api.schemas.utils import get_sdk_version from agno.db.schemas.evals import EvalType class EvalRunCreate(BaseModel): """Data sent to the telemetry API to create an Eval run event""" run_id: str eval_type: EvalType ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/api/schemas/evals.py", "license": "Apache License 2.0", "lines": 10, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/agno/tools/google_bigquery.py
"""Backward-compatibility stub. Use agno.tools.google.bigquery instead.""" import warnings warnings.warn( "Importing from 'agno.tools.google_bigquery' is deprecated. " "Use 'from agno.tools.google.bigquery import GoogleBigQueryTools' instead.", DeprecationWarning, stacklevel=2, ) from agno.tools.goog...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/tools/google_bigquery.py", "license": "Apache License 2.0", "lines": 11, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/tests/unit/tools/test_google_bigquery.py
# agno/tests/unit/tools/test_bigquery.py import json from unittest.mock import MagicMock, patch import pytest from agno.tools.google.bigquery import GoogleBigQueryTools, _clean_sql @pytest.fixture def mock_bq_client(): """Mock BigQuery Client used by BQTools.""" with patch("agno.tools.google.bigquery.bigqu...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/test_google_bigquery.py", "license": "Apache License 2.0", "lines": 99, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/vectordb/couchbase/couchbase.py
import asyncio import time from datetime import timedelta from typing import Any, Dict, List, Optional, Union from agno.filters import FilterExpr from agno.knowledge.document import Document from agno.knowledge.embedder import Embedder from agno.utils.log import log_debug, log_info, log_warning, logger from agno.vecto...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/vectordb/couchbase/couchbase.py", "license": "Apache License 2.0", "lines": 1244, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/agno/tools/whatsapp.py
from os import getenv from typing import Any, Dict, List, Optional import httpx from agno.tools import Toolkit from agno.utils.log import logger class WhatsAppTools(Toolkit): """WhatsApp Business API toolkit for sending messages.""" base_url = "https://graph.facebook.com" def __init__( self, ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/tools/whatsapp.py", "license": "Apache License 2.0", "lines": 235, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/agno/utils/whatsapp.py
import os from typing import Optional, Union import httpx import requests from agno.utils.log import log_debug, log_error def get_access_token() -> str: access_token = os.getenv("WHATSAPP_ACCESS_TOKEN") if not access_token: raise ValueError("WHATSAPP_ACCESS_TOKEN is not set") return access_token...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/utils/whatsapp.py", "license": "Apache License 2.0", "lines": 234, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/agno/models/nebius/nebius.py
from dataclasses import dataclass, field from os import getenv from typing import Any, Dict, Optional from agno.exceptions import ModelAuthenticationError from agno.models.openai.like import OpenAILike @dataclass class Nebius(OpenAILike): """ A class for interacting with Nebius Token Factory models. Att...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/models/nebius/nebius.py", "license": "Apache License 2.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/agno/tools/models/nebius.py
import base64 from os import getenv from typing import Optional from uuid import uuid4 from agno.agent import Agent from agno.media import Image from agno.models.nebius import Nebius from agno.tools import Toolkit from agno.tools.function import ToolResult from agno.utils.log import log_error, log_warning class Nebi...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/tools/models/nebius.py", "license": "Apache License 2.0", "lines": 104, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/tests/integration/models/nebius/test_basic.py
import pytest from pydantic import BaseModel, Field from agno.agent import Agent, RunOutput # noqa from agno.db.sqlite import SqliteDb from agno.models.nebius import Nebius NEBIUS_MODEL_ID = "Qwen/Qwen3-4B-fast" def _assert_metrics(response: RunOutput): assert response.metrics is not None input_tokens = re...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/nebius/test_basic.py", "license": "Apache License 2.0", "lines": 116, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/nebius/test_tool_use.py
from typing import Optional import pytest from agno.agent import Agent # noqa from agno.models.nebius import Nebius from agno.tools.exa import ExaTools from agno.tools.websearch import WebSearchTools from agno.tools.yfinance import YFinanceTools NEBIUS_MODEL_ID = "Qwen/Qwen3-30B-A3B" def test_tool_use(): agen...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/nebius/test_tool_use.py", "license": "Apache License 2.0", "lines": 163, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/unit/tools/models/test_nebius.py
import base64 from unittest.mock import MagicMock, patch from uuid import UUID import pytest from agno.agent import Agent from agno.media import Image from agno.tools.function import ToolResult from agno.tools.models.nebius import NebiusTools # Fixture for mock agent @pytest.fixture def mock_agent(): agent = Ma...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/unit/tools/models/test_nebius.py", "license": "Apache License 2.0", "lines": 188, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/eval/utils.py
from dataclasses import asdict from pathlib import Path from typing import TYPE_CHECKING, Optional, Union from agno.db.base import AsyncBaseDb, BaseDb from agno.db.schemas.evals import EvalRunRecord, EvalType from agno.utils.log import log_debug, logger if TYPE_CHECKING: from agno.eval.accuracy import AccuracyRes...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/eval/utils.py", "license": "Apache License 2.0", "lines": 109, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/agno/utils/models/ai_foundry.py
from typing import Any, Dict from agno.models.message import Message from agno.utils.log import log_warning from agno.utils.openai import images_to_message def format_message(message: Message, compress_tool_results: bool = False) -> Dict[str, Any]: """ Format a message into the format expected by OpenAI. ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/utils/models/ai_foundry.py", "license": "Apache License 2.0", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/agno/utils/models/cohere.py
from pathlib import Path from typing import Any, Dict, List, Sequence from agno.media import Image from agno.models.message import Message from agno.utils.log import log_error, log_warning def _format_images_for_message(message: Message, images: Sequence[Image]) -> List[Dict[str, Any]]: """ Format an image i...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/utils/models/cohere.py", "license": "Apache License 2.0", "lines": 74, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/agno/utils/models/mistral.py
from typing import Any, List, Optional, Union from agno.media import Image from agno.models.message import Message from agno.utils.log import log_error, log_warning try: # TODO: Adapt these imports to the new Mistral SDK versions from mistralai.models import ( # type: ignore AssistantMessage, # type...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/utils/models/mistral.py", "license": "Apache License 2.0", "lines": 81, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/agno/utils/models/watsonx.py
from typing import Any, Dict, List, Sequence from agno.media import Image from agno.models.message import Message from agno.utils.log import log_error, log_warning def format_images_for_message(message: Message, images: Sequence[Image]) -> Message: """ Format an image into the format expected by WatsonX. ...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/utils/models/watsonx.py", "license": "Apache License 2.0", "lines": 32, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
agno-agi/agno:libs/agno/agno/models/cerebras/cerebras.py
import json from collections.abc import AsyncIterator from dataclasses import dataclass from os import getenv from typing import Any, Dict, Iterator, List, Optional, Type, Union import httpx from pydantic import BaseModel from agno.models.base import Model from agno.models.message import Message from agno.models.metr...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/models/cerebras/cerebras.py", "license": "Apache License 2.0", "lines": 497, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/agno/models/cerebras/cerebras_openai.py
import json from dataclasses import dataclass, field from os import getenv from typing import Any, Dict, List, Optional, Type, Union from pydantic import BaseModel from agno.exceptions import ModelAuthenticationError from agno.models.message import Message from agno.models.openai.like import OpenAILike from agno.util...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/models/cerebras/cerebras_openai.py", "license": "Apache License 2.0", "lines": 111, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/tests/integration/models/cerebras/test_basic.py
import pytest from pydantic import BaseModel, Field from agno.agent import Agent, RunOutput from agno.db.sqlite import SqliteDb from agno.models.cerebras import Cerebras @pytest.fixture(scope="module") def cerebras_model(): """Fixture that provides a Cerebras model and reuses it across all tests in the module.""...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/cerebras/test_basic.py", "license": "Apache License 2.0", "lines": 140, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/cerebras/test_tool_use.py
import pytest from agno.agent import Agent, RunOutput # noqa from agno.models.cerebras import Cerebras from agno.tools.websearch import WebSearchTools def test_tool_use(): agent = Agent( model=Cerebras(id="gpt-oss-120b"), tools=[WebSearchTools(cache_results=True)], telemetry=False, )...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/cerebras/test_tool_use.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/agent/test_metrics.py
import time import pytest from agno.agent import Agent, RunOutput # noqa from agno.culture.manager import CultureManager from agno.db.base import SessionType from agno.eval.accuracy import AccuracyEval from agno.eval.agent_as_judge import AgentAsJudgeEval from agno.memory.manager import MemoryManager from agno.metri...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/agent/test_metrics.py", "license": "Apache License 2.0", "lines": 605, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/utils/models/llama.py
from typing import Any, Dict from agno.agent import Message from agno.utils.log import log_warning from agno.utils.openai import process_image ROLE_MAP = { "user": "user", "assistant": "assistant", "system": "system", "tool": "tool", } TOOL_CALL_ROLE_MAP = { "user": "user", "assistant": "assi...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/utils/models/llama.py", "license": "Apache License 2.0", "lines": 70, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/tests/integration/models/meta/llama/test_basic.py
import pytest from pydantic import BaseModel, Field from agno.agent import Agent, RunOutput from agno.db.sqlite import SqliteDb from agno.models.meta.llama import Llama @pytest.fixture(scope="module") def llama_model(): """Fixture that provides a Llama model and reuses it across all tests in the module.""" r...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/meta/llama/test_basic.py", "license": "Apache License 2.0", "lines": 159, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/meta/llama/test_multimodal.py
from pathlib import Path from agno.agent.agent import Agent from agno.media import Image from agno.models.meta import Llama image_path = Path(__file__).parent.parent.parent.joinpath("sample_image.jpg") def test_image_input_file(): agent = Agent(model=Llama(id="Llama-4-Maverick-17B-128E-Instruct-FP8"), markdown=...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/meta/llama/test_multimodal.py", "license": "Apache License 2.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/meta/llama/test_tool_use.py
from typing import Optional import pytest from agno.agent import Agent, RunOutput # noqa from agno.models.meta import Llama from agno.tools.websearch import WebSearchTools from agno.tools.yfinance import YFinanceTools def test_tool_use(): agent = Agent( model=Llama(id="Llama-4-Maverick-17B-128E-Instruc...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/meta/llama/test_tool_use.py", "license": "Apache License 2.0", "lines": 147, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/meta/llama_openai/test_basic.py
import pytest from pydantic import BaseModel, Field from agno.agent import Agent, RunOutput from agno.db.sqlite import SqliteDb from agno.models.meta.llama_openai import LlamaOpenAI @pytest.fixture(scope="module") def llama_openai_model(): """Fixture that provides a LlamaOpenAI model and reuses it across all tes...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/meta/llama_openai/test_basic.py", "license": "Apache License 2.0", "lines": 154, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/meta/llama_openai/test_multimodal.py
from pathlib import Path from agno.agent.agent import Agent from agno.media import Image from agno.models.meta import LlamaOpenAI from agno.utils.media import download_image image_path = Path(__file__).parent.joinpath("sample.jpg") download_image( url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGa...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/meta/llama_openai/test_multimodal.py", "license": "Apache License 2.0", "lines": 29, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/tests/integration/models/meta/llama_openai/test_tool_use.py
from typing import Optional import pytest from agno.agent import Agent, RunOutput # noqa from agno.models.meta import LlamaOpenAI from agno.tools.websearch import WebSearchTools from agno.tools.yfinance import YFinanceTools def test_tool_use(): agent = Agent( model=LlamaOpenAI(id="Llama-4-Maverick-17B-...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/tests/integration/models/meta/llama_openai/test_tool_use.py", "license": "Apache License 2.0", "lines": 144, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
agno-agi/agno:libs/agno/agno/models/meta/llama.py
from collections.abc import AsyncIterator from dataclasses import dataclass from os import getenv from typing import Any, Dict, Iterator, List, Optional, Type, Union import httpx from pydantic import BaseModel from agno.exceptions import ModelProviderError from agno.models.base import Model from agno.models.message i...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/models/meta/llama.py", "license": "Apache License 2.0", "lines": 413, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
agno-agi/agno:libs/agno/agno/models/meta/llama_openai.py
from dataclasses import dataclass from os import getenv from typing import Any, Dict, Optional try: from openai import AsyncOpenAI as AsyncOpenAIClient except ImportError: raise ImportError("`openai` not installed. Please install using `pip install openai`") from agno.exceptions import ModelAuthenticationErro...
{ "repo_id": "agno-agi/agno", "file_path": "libs/agno/agno/models/meta/llama_openai.py", "license": "Apache License 2.0", "lines": 64, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
ansible/ansible:lib/ansible/_internal/_powershell/_clixml.py
"""Helpers for PowerShell's CLIXML data""" from __future__ import annotations import base64 import re import xml.etree.ElementTree as ET # This is weird, we are matching on byte sequences that match the utf-16-be # matches for '_x(a-fA-F0-9){4}_'. The \x00 and {4} will match the hex sequence # when it is encoded as...
{ "repo_id": "ansible/ansible", "file_path": "lib/ansible/_internal/_powershell/_clixml.py", "license": "GNU General Public License v3.0", "lines": 153, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
ansible/ansible:lib/ansible/_internal/_powershell/_script.py
"""Helpers for PowerShell command line and scripting arguments.""" from __future__ import annotations import base64 import re import shlex from . import _clixml # There are 5 chars that need to be escaped in a single quote. # https://github.com/PowerShell/PowerShell/blob/b7cb335f03fe2992d0cbd61699de9d9aafa1d7c1/sr...
{ "repo_id": "ansible/ansible", "file_path": "lib/ansible/_internal/_powershell/_script.py", "license": "GNU General Public License v3.0", "lines": 126, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
ansible/ansible:test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_powershell.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = r''' --- module: win_powershell version_added: 1.5.0 short_description: Run PowerShell scripts description: - Runs a PowerShell...
{ "repo_id": "ansible/ansible", "file_path": "test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_powershell.py", "license": "GNU General Public License v3.0", "lines": 531, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pat...
test
ansible/ansible:test/units/_internal/_powershell/test_clixml.py
from __future__ import annotations import pytest from ansible._internal._powershell import _clixml CLIXML_WITH_ERROR = b'#< CLIXML\r\n<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">' \ b'<S S="Error">My error</S></Objs>' def test_replace_stderr_clixml_by_itself(): data = C...
{ "repo_id": "ansible/ansible", "file_path": "test/units/_internal/_powershell/test_clixml.py", "license": "GNU General Public License v3.0", "lines": 156, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/units/_internal/_powershell/test_script.py
from __future__ import annotations import pytest from ansible._internal._powershell import _script # print_argv is a binary that echoes back the argv it receives. ENCODED_CMD_CASES = [ ( # print_argv {'foo'} "'foo'", [], ['-EncodedCommand', 'JwBmAG8AbwAnAA=='], ), ( ...
{ "repo_id": "ansible/ansible", "file_path": "test/units/_internal/_powershell/test_script.py", "license": "GNU General Public License v3.0", "lines": 112, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/units/utils/test_jsonrpc.py
from __future__ import annotations import json import pickle from ansible._internal._datatag._tags import Origin from ansible.utils.jsonrpc import JsonRpcServer def test_response_type_cleansing() -> None: """Avoid unpickling errors in module contexts by ensuring that non-scalar JsonRpc responses are not pickled...
{ "repo_id": "ansible/ansible", "file_path": "test/units/utils/test_jsonrpc.py", "license": "GNU General Public License v3.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/sanity/code-smell/no-s3.py
""" Disallow direct linking to S3 buckets. S3 buckets should be accessed through a CloudFront distribution. """ from __future__ import annotations import re import sys def main(): """Main entry point.""" for path in sys.argv[1:] or sys.stdin.read().splitlines(): with open(path, 'rb') as path_fd: ...
{ "repo_id": "ansible/ansible", "file_path": "test/sanity/code-smell/no-s3.py", "license": "GNU General Public License v3.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/integration/targets/ansible-test-collection-indirect-by-meta/ansible_collections/ansible_test/ansible_test_collection_indirect_by_meta/plugins/modules/hello.py
from __future__ import annotations from ansible.module_utils.basic import AnsibleModule def main(): module = AnsibleModule(argument_spec=dict()) module.exit_json(source='meta') if __name__ == '__main__': main()
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-test-collection-indirect-by-meta/ansible_collections/ansible_test/ansible_test_collection_indirect_by_meta/plugins/modules/hello.py", "license": "GNU General Public License v3.0", "lines": 7, "canary_id": -1, "canary_value": "", ...
test
ansible/ansible:test/integration/targets/ansible-test-collection-indirect-by-needs-target/ansible_collections/ansible_test/ansible_test_collection_indirect_by_needs_target/plugins/modules/hello.py
from __future__ import annotations from ansible.module_utils.basic import AnsibleModule def main(): module = AnsibleModule(argument_spec=dict()) module.exit_json(source='needs/target') if __name__ == '__main__': main()
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-test-collection-indirect-by-needs-target/ansible_collections/ansible_test/ansible_test_collection_indirect_by_needs_target/plugins/modules/hello.py", "license": "GNU General Public License v3.0", "lines": 7, "canary_id": -1, "can...
test
ansible/ansible:test/integration/targets/ansible-test-sanity-pylint/ansible_collections/ns/col/plugins/module_utils/unwanted.py
from __future__ import annotations import os import subprocess import sys def main() -> None: os.popen('echo') os.posix_spawn('echo', ['echo'], {}) os.posix_spawnp('echo', ['echo'], {}) os.spawnl(os.P_WAIT, 'echo', 'echo') os.spawnle(os.P_WAIT, 'echo', 'echo', {}) os.spawnlp(os.P_WAIT, 'echo'...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-test-sanity-pylint/ansible_collections/ns/col/plugins/module_utils/unwanted.py", "license": "GNU General Public License v3.0", "lines": 26, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern...
test
ansible/ansible:test/sanity/code-smell/codespell.py
"""Check for common misspelled words using codespell.""" from __future__ import annotations import pathlib import re import subprocess import sys import tempfile import typing as t def main() -> None: paths = sys.argv[1:] or sys.stdin.read().splitlines() ignore_words_lines = (pathlib.Path(__file__).parent...
{ "repo_id": "ansible/ansible", "file_path": "test/sanity/code-smell/codespell.py", "license": "GNU General Public License v3.0", "lines": 81, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/units/ansible_test/_internal/ci/test_azp.py
from __future__ import annotations import argparse import json import os import typing as t import pytest import pytest_mock if t.TYPE_CHECKING: from ansible_test._internal.ci.azp import AzurePipelinesChanges def create_azure_pipelines_changes(mocker: pytest_mock.MockerFixture) -> AzurePipelinesChanges: ""...
{ "repo_id": "ansible/ansible", "file_path": "test/units/ansible_test/_internal/ci/test_azp.py", "license": "GNU General Public License v3.0", "lines": 75, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/units/_internal/_encryption/test_crypt.py
from __future__ import annotations import errno import pytest from pytest_mock import MockerFixture from ansible._internal._encryption._crypt import _CryptLib, CryptFacade, _FAILURE_TOKENS class TestCryptFacade: def test_unsupported_platform(self, mocker: MockerFixture) -> None: """Test that unsupporte...
{ "repo_id": "ansible/ansible", "file_path": "test/units/_internal/_encryption/test_crypt.py", "license": "GNU General Public License v3.0", "lines": 112, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/units/module_utils/basic/test_human_to_bytes.py
# -*- coding: utf-8 -*- # Copyright: (c) 2025 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations import pytest from ansible.module_utils.basic import AnsibleModule @pytest.mark.parametrize('value, isbits, expected', [ ...
{ "repo_id": "ansible/ansible", "file_path": "test/units/module_utils/basic/test_human_to_bytes.py", "license": "GNU General Public License v3.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/constants.py
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Matt Martz <matt@sivel.net> # Copyright (C) 2015 Rackspace US, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
{ "repo_id": "ansible/ansible", "file_path": "test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/constants.py", "license": "GNU General Public License v3.0", "lines": 57, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetitio...
test
ansible/ansible:test/units/ansible_test/_util/controller/sanity/validate-modules/validate_modules/test_main.py
"""Tests for validate-module's main module.""" from __future__ import annotations def test_dict_members() -> None: from validate_modules.constants import FORBIDDEN_DICTIONARY_KEYS # type: ignore[import-not-found] expected_keys = [key for key in dict.__dict__ if not key.startswith("__")] assert FORBIDDE...
{ "repo_id": "ansible/ansible", "file_path": "test/units/ansible_test/_util/controller/sanity/validate-modules/validate_modules/test_main.py", "license": "GNU General Public License v3.0", "lines": 6, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetiti...
test
ansible/ansible:test/integration/targets/cache-plugins/cache_plugins/dummy_file_cache.py
from __future__ import annotations DOCUMENTATION = """ name: dummy_file_cache short_description: dummy file cache description: see short options: _uri: required: True description: - Path in which the cache plugin will save the files env: - n...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/cache-plugins/cache_plugins/dummy_file_cache.py", "license": "GNU General Public License v3.0", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template"...
test
ansible/ansible:test/integration/targets/cache-plugins/cache_plugins/dummy_file_cache_persistent.py
from __future__ import annotations DOCUMENTATION = """ name: dummy_file_cache short_description: dummy file cache description: see short options: _uri: required: True description: - Path in which the cache plugin will save the files env: - n...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/cache-plugins/cache_plugins/dummy_file_cache_persistent.py", "license": "GNU General Public License v3.0", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, ...
test
ansible/ansible:lib/ansible/_internal/_encryption/_crypt.py
# Copyright: Contributors to the Ansible project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations import ctypes import ctypes.util import os import sys import typing as t from dataclasses import dataclass __all__ = ['CryptFacade'] _FAILU...
{ "repo_id": "ansible/ansible", "file_path": "lib/ansible/_internal/_encryption/_crypt.py", "license": "GNU General Public License v3.0", "lines": 136, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ansible/ansible:lib/ansible/_internal/_display_utils.py
from __future__ import annotations import dataclasses from ansible.module_utils._internal import _ambient_context, _messages from . import _event_formatting class DeferredWarningContext(_ambient_context.AmbientContextBase): """ Calls to `Display.warning()` and `Display.deprecated()` within this context will...
{ "repo_id": "ansible/ansible", "file_path": "lib/ansible/_internal/_display_utils.py", "license": "GNU General Public License v3.0", "lines": 111, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
ansible/ansible:test/integration/targets/connection_persistent/connection_plugins/persistent.py
from __future__ import annotations DOCUMENTATION = """ options: persistent_connect_timeout: type: int default: 30 ini: - section: persistent_connection key: connect_timeout env: - name: ANSIBLE_PERSISTENT_CONNECT_TIMEOUT vars: - name: ansible_connect_timeout persistent_command...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/connection_persistent/connection_plugins/persistent.py", "license": "GNU General Public License v3.0", "lines": 62, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "te...
test
ansible/ansible:test/integration/targets/connection_persistent/library/persistent.py
from __future__ import annotations from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.connection import Connection def main(): module = AnsibleModule({}) connection = Connection(module._socket_path) capabilities = module.from_json(connection.get_capabilities()) module.exi...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/connection_persistent/library/persistent.py", "license": "GNU General Public License v3.0", "lines": 10, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": ""...
test
ansible/ansible:test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/doc_fragments/return_doc_fragment.py
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations class ModuleDocFragment: DOCUMENTATION = r""" options: {} """ RETURN = r""" bar: description: - Some foo bar. - P(a.b.asfd#dfsa) this is an error. returned: success t...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/doc_fragments/return_doc_fragment.py", "license": "GNU General Public License v3.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider"...
test
ansible/ansible:test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/doc_fragments_not_exist.py
#!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations DOCUMENTATION = """ module: doc_fragments_not_exist short_description: Non-existing doc fragment description: A module with a non-existing doc fragment author: - Ansible ...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/doc_fragments_not_exist.py", "license": "GNU General Public License v3.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": ...
test
ansible/ansible:test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/return_fragments.py
#!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations DOCUMENTATION = """ module: return_fragments short_description: Uses return fragments description: A module with a return doc fragment. author: - Ansible Core Team """ E...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/return_fragments.py", "license": "GNU General Public License v3.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "...
test
ansible/ansible:test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/return_fragments_not_exist.py
#!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations DOCUMENTATION = """ module: return_fragments_not_exist short_description: Non-existing return doc fragment description: A module with a non-existing return doc fragment. au...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/return_fragments_not_exist.py", "license": "GNU General Public License v3.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider...
test
ansible/ansible:test/units/plugins/lookup/test_template.py
from __future__ import annotations import pathlib from ansible._internal._templating._utils import Omit from ansible.parsing.dataloader import DataLoader from ansible.template import Templar, trust_as_template def test_no_finalize_marker_passthru(tmp_path: pathlib.Path) -> None: """Return an Undefined marker fr...
{ "repo_id": "ansible/ansible", "file_path": "test/units/plugins/lookup/test_template.py", "license": "GNU General Public License v3.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:lib/ansible/module_utils/_internal/_no_six.py
from __future__ import annotations import sys import types from ansible.module_utils.common import warnings # INLINED FROM THE SIX LIBRARY, see lib/ansible/module_utils/six/__init__.py # Copyright (c) 2010-2024 Benjamin Peterson def with_metaclass(meta, *bases): """Create a base class with a metaclass.""" ...
{ "repo_id": "ansible/ansible", "file_path": "lib/ansible/module_utils/_internal/_no_six.py", "license": "GNU General Public License v3.0", "lines": 66, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
license
ansible/ansible:test/integration/targets/ansible-doc/doc_fragments/test_return_frag.py
from __future__ import annotations class ModuleDocFragment(object): # Standard documentation fragment RETURN = r''' y_notlast: description: A return from fragment type: str returned: it depends TM z_last: description: A a return from fragment with merge. type: str returned: success '...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-doc/doc_fragments/test_return_frag.py", "license": "GNU General Public License v3.0", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": ...
test
ansible/ansible:test/integration/targets/ansible-doc/library/test_docs_return_fragments.py
#!/usr/bin/python from __future__ import annotations DOCUMENTATION = ''' --- module: test_docs_returns short_description: Test module description: - Test module author: - Ansible Core Team ''' EXAMPLES = ''' ''' RETURN = ''' m_middle: description: - This should be in the middle. - Has s...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/ansible-doc/library/test_docs_return_fragments.py", "license": "GNU General Public License v3.0", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "templat...
test
ansible/ansible:test/integration/targets/config/lookup_plugins/broken.py
# -*- coding: utf-8 -*- # Copyright (c) 2025, Felix Fontein <felix@fontein.de>, The Ansible Project # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import annotations DOCUMENTATION = r""" nam...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/config/lookup_plugins/broken.py", "license": "GNU General Public License v3.0", "lines": 49, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:lib/ansible/module_utils/_internal/_ansiballz/_extensions/_debugpy.py
""" Remote debugging support for AnsiballZ modules with debugpy. To use with VS Code: 1) Choose an available port for VS Code to listen on (e.g. 5678). 2) Ensure `debugpy` is installed for the interpreter(s) which will run the code being debugged. 3) Create the following launch.json configuration { "vers...
{ "repo_id": "ansible/ansible", "file_path": "lib/ansible/module_utils/_internal/_ansiballz/_extensions/_debugpy.py", "license": "GNU General Public License v3.0", "lines": 81, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "...
documentation
ansible/ansible:test/units/module_utils/_internal/test_traceback.py
from __future__ import annotations import pytest import pytest_mock from ansible.module_utils._internal import _traceback @pytest.mark.parametrize("patched_parsed_args, event, expected", ( (dict(_ansible_tracebacks_for=["error", "warning"]), _traceback.TracebackEvent.ERROR, True), # included value (dict(_a...
{ "repo_id": "ansible/ansible", "file_path": "test/units/module_utils/_internal/test_traceback.py", "license": "GNU General Public License v3.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/units/_internal/_json/test_json.py
from __future__ import annotations import typing as t import pytest from ansible._internal._json import AnsibleVariableVisitor, EncryptedStringBehavior from ansible.errors import AnsibleVariableTypeError from ansible.parsing.vault import EncryptedString, AnsibleVaultError from units.mock.vault_helper import VaultTes...
{ "repo_id": "ansible/ansible", "file_path": "test/units/_internal/_json/test_json.py", "license": "GNU General Public License v3.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/units/_internal/_ansiballz/test_builder.py
from __future__ import annotations from ansible._internal._ansiballz._builder import ExtensionManager from ansible.module_utils._internal._ansiballz._extensions import _pydevd def test_debugger_source_mapping() -> None: """Synthetic coverage for builder source mapping.""" debug_options = _pydevd.Options(sour...
{ "repo_id": "ansible/ansible", "file_path": "test/units/_internal/_ansiballz/test_builder.py", "license": "GNU General Public License v3.0", "lines": 16, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/integration/targets/task-esoterica/action_plugins/echo.py
from __future__ import annotations from ansible.plugins.action import ActionBase class ActionModule(ActionBase): def run(self, tmp=None, task_vars=None): return dict(action_args=self._task.args)
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/task-esoterica/action_plugins/echo.py", "license": "GNU General Public License v3.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
ansible/ansible:test/integration/targets/callback-dispatch/callback_plugins/oops_always_enabled.py
from __future__ import annotations import os import typing as t from ansible.plugins.callback import CallbackBase class CallbackModule(CallbackBase): call_count: t.ClassVar[int] = 0 def v2_runner_on_ok(self, *args, **kwargs) -> None: print(f"hello from ALWAYS ENABLED v2_runner_on_ok {args=} {kwargs...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/callback-dispatch/callback_plugins/oops_always_enabled.py", "license": "GNU General Public License v3.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, ...
test
ansible/ansible:test/integration/targets/callback-dispatch/callback_plugins/v1_only_methods.py
from __future__ import annotations import functools from ansible.plugins.callback import CallbackBase class CallbackModule(CallbackBase): """Test callback that implements exclusively deprecated v1 callback methods.""" CALLBACK_NEEDS_ENABLED = True def __init__(self, *args, **kwargs): super().__...
{ "repo_id": "ansible/ansible", "file_path": "test/integration/targets/callback-dispatch/callback_plugins/v1_only_methods.py", "license": "GNU General Public License v3.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "tem...
test
ansible/ansible:test/lib/ansible_test/_internal/debugging.py
"""Setup and configure remote debugging.""" from __future__ import annotations import abc import dataclasses import importlib import json import os import re import sys import typing as t from .util import ( cache, display, raw_command, ApplicationError, get_subclasses, ) from .util_common impor...
{ "repo_id": "ansible/ansible", "file_path": "test/lib/ansible_test/_internal/debugging.py", "license": "GNU General Public License v3.0", "lines": 343, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test