repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
vndee/llm-sandbox | import json
import signal
import subprocess
import sys
import time
import uuid
from pathlib import Path
from typing import Any, cast
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend
from llm_sandbox.core.config import SessionConfig
from llm_sandbox.data import Cons... | 1 | assert | numeric_literal | tests/test_interactive_session.py | test_run_executes_code_and_returns_output | 169 | null | |
vndee/llm-sandbox | import logging
import os
import re
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.exceptions import LanguageNotSupportPlotError, PackageManagerError
from llm_sandbox.language_handlers.base import PlotLibrary
from llm_sandbox.language_handlers.... | "" | assert | string_literal | tests/test_r_handler.py | test_plot_detection_config | TestRHandler | 41 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.micromamba import MicromambaSession
from llm_sandbox.security import SecurityPolicy
class TestMicromambaSessionInit:
@patch("llm_sandbox.micromamba.docker.from_env")
@patch("llm_sandbox.... | "1g" | assert | string_literal | tests/test_micromamba.py | test_init_with_all_docker_session_params | TestMicromambaSessionInit | 104 | null |
vndee/llm-sandbox | from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
from llm_sandbox.data import ConsoleOutput, StreamCallback
from llm_sandbox.docker import SandboxDockerSession
class TestEndToEndStreamingDocker:
@patch("llm_sandbox.docker.docker.from_env")
@patch("llm_sandbox.language_ha... | "err" | assert | string_literal | tests/test_streaming_callbacks.py | test_only_stdout_callback | TestEndToEndStreamingDocker | 447 | null |
vndee/llm-sandbox | from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
from llm_sandbox.data import ConsoleOutput, StreamCallback
from llm_sandbox.docker import SandboxDockerSession
class TestDockerStreamOutputCallbacks:
@patch("llm_sandbox.docker.docker.from_env")
@patch("llm_sandbox.languag... | [] | assert | collection | tests/test_streaming_callbacks.py | test_empty_stream_with_callbacks | TestDockerStreamOutputCallbacks | 230 | null |
vndee/llm-sandbox | from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
from llm_sandbox.data import ConsoleOutput, StreamCallback
from llm_sandbox.docker import SandboxDockerSession
class TestEndToEndStreamingDocker:
@patch("llm_sandbox.docker.docker.from_env")
@patch("llm_sandbox.language_ha... | "out" | assert | string_literal | tests/test_streaming_callbacks.py | test_only_stdout_callback | TestEndToEndStreamingDocker | 446 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from kubernetes.client.exceptions import ApiException
from llm_sandbox.k8s_utils import retry_k8s_api_call
class TestRetryK8sApiCall:
def test_no_retry_on_other_api_exception(self):
"""Test no retry on non-WebSocket ApiException."""
# 404 ... | api_error | assert | variable | tests/test_k8s_utils.py | test_no_retry_on_other_api_exception | TestRetryK8sApiCall | 59 | null |
vndee/llm-sandbox | import base64
import io
import logging
import tarfile
from unittest.mock import MagicMock, Mock, patch
import pytest
from llm_sandbox.data import FileType
from llm_sandbox.exceptions import CommandFailedError, PackageManagerError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, LanguageConfig, ... | [] | assert | collection | tests/test_base_handler.py | test_no_plot_detection_line_212 | TestMissingCoverage | 79 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.go_handler import GoHandler
class TestGoHandler:
def test_init(self) -> None:
"""Test GoHandler initialization."""
handler = GoHandler()
assert ... | True | assert | bool_literal | tests/test_go_handler.py | test_init | TestGoHandler | 23 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.java_handler import JavaHandler
class TestJavaHandler:
def test_init(self) -> None:
"""Test JavaHandler initialization."""
handler = JavaHandler()
... | "mvn" | assert | string_literal | tests/test_java_handler.py | test_init | TestJavaHandler | 21 | null |
vndee/llm-sandbox | import json
import signal
import subprocess
import sys
import time
import uuid
from pathlib import Path
from typing import Any, cast
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend
from llm_sandbox.core.config import SessionConfig
from llm_sandbox.data import Cons... | "hello" | assert | string_literal | tests/test_interactive_session.py | test_run_accepts_callbacks_without_error | 882 | null | |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.micromamba import MicromambaSession
from llm_sandbox.security import SecurityPolicy
class TestMicromambaSessionExecuteCommand:
@patch("llm_sandbox.micromamba.docker.from_env")
@patch("ll... | 0 | assert | numeric_literal | tests/test_micromamba.py | test_execute_command_wraps_with_micromamba_run | TestMicromambaSessionExecuteCommand | 133 | null |
vndee/llm-sandbox | import logging
from typing import TYPE_CHECKING
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.exceptions import LanguageNotSupportedError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, PlotOutput
from llm_sandbox.language_handlers.cpp_handler import CppHandler... | handler2.name | assert | complex_expr | tests/test_language_handler_factory.py | test_handler_consistency_across_creation | TestLanguageHandlerFactory | 201 | null |
vndee/llm-sandbox | import warnings
from llm_sandbox.data import ConsoleOutput, ExecutionResult, FileType, PlotOutput
class TestDataClassDefaults:
def test_console_output_defaults(self) -> None:
"""Test ConsoleOutput with default values."""
# Test with all defaults
output = ConsoleOutput()
assert out... | 1 | assert | numeric_literal | tests/test_data_missing.py | test_console_output_defaults | TestDataClassDefaults | 231 | null |
vndee/llm-sandbox | import io
import tarfile
import time
from pathlib import Path
from unittest.mock import MagicMock, Mock, patch
import pytest
from llm_sandbox.core.mixins import CommandExecutionMixin, FileOperationsMixin, TimeoutMixin
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import CommandEmptyError, Not... | "hello" | assert | string_literal | tests/test_mixins.py | test_extract_archive_safely_single_file | TestFileOperationsMixin | 271 | null |
vndee/llm-sandbox | import time
from typing import Any
from unittest.mock import MagicMock
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.pool.base import ContainerPoolManager, ContainerState, PooledContainer
from llm_sandbox.pool.config import ExhaustionStrategy, PoolConfig
from llm_sandbox.pool.exceptio... | pool._pool | assert | complex_expr | tests/test_pool_base.py | test_acquire_release | TestContainerPoolManager | 106 | null |
vndee/llm-sandbox | import pytest
from llm_sandbox.const import DefaultImage, SandboxBackend, StrEnum, SupportedLanguage
class TestSandboxBackend:
def test_backend_iteration(self) -> None:
"""Test iterating over backends."""
backends = list(SandboxBackend)
assert len(backends) == | 4 | assert | numeric_literal | tests/test_const.py | test_backend_iteration | TestSandboxBackend | 86 | null |
vndee/llm-sandbox | import io
import tarfile
import tempfile
from unittest.mock import MagicMock, Mock, patch
import pytest
from kubernetes.client.exceptions import ApiException
from llm_sandbox.const import DefaultImage, SupportedLanguage
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import ContainerError, NotO... | 3 | assert | numeric_literal | tests/test_kubernetes.py | test_open_waiting_for_pod | TestSandboxKubernetesSessionOpen | 205 | null |
vndee/llm-sandbox | from llm_sandbox.exceptions import (
CommandEmptyError,
CommandFailedError,
ContainerError,
ExtraArgumentsError,
ImageNotFoundError,
ImagePullError,
InvalidRegexPatternError,
LanguageHandlerNotInitializedError,
LanguageNotSupportedError,
LanguageNotSupportPlotError,
LibraryIn... | 0 | assert | numeric_literal | tests/test_exceptions.py | test_exception_instantiation | TestExceptionHierarchy | 331 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from kubernetes.client.exceptions import ApiException
from llm_sandbox.k8s_utils import retry_k8s_api_call
class TestRetryK8sApiCall:
def test_successful_call(self):
"""Test successful API call without retries."""
mock_func = MagicMock(ret... | "arg1") | assert_* | string_literal | tests/test_k8s_utils.py | test_successful_call | TestRetryK8sApiCall | 21 | null |
vndee/llm-sandbox | import io
import shlex
import tarfile
import tempfile
from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
import pytest
from docker.errors import ImageNotFound, NotFound
from pydantic_core import ValidationError
from llm_sandbox.const import DefaultImage, SupportedLanguage
from llm_... | 0 | assert | numeric_literal | tests/test_docker.py | test_execute_command_success_no_stream | TestSandboxDockerSessionCommands | 559 | null |
vndee/llm-sandbox | from dataclasses import FrozenInstanceError
import pytest
from llm_sandbox.data import ConsoleOutput, ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import (
CommandEmptyError,
CommandFailedError,
ExtraArgumentsError,
ImageNotFoundError,
ImagePullError,
LanguageHandlerNotIni... | [] | assert | collection | tests/test_data.py | test_execution_result_creation_minimal | TestExecutionResult | 112 | null |
vndee/llm-sandbox | import base64
import io
import logging
import re
import tarfile
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.data import FileType, PlotOutput
from llm_sandbox.exceptions import LanguageNotSupportPlotError
from llm_sandbox.language_handlers.b... | [] | assert | collection | tests/test_python_handler.py | test_run_with_artifacts_plotting_disabled | TestPythonHandler | 105 | null |
vndee/llm-sandbox | import json
import signal
import subprocess
import sys
import time
import uuid
from pathlib import Path
from typing import Any, cast
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend
from llm_sandbox.core.config import SessionConfig
from llm_sandbox.data import Cons... | None | assert | none_literal | tests/test_interactive_session.py | test_interactive_session_kubernetes_with_runtime_configs | 113 | null | |
vndee/llm-sandbox | import time
from typing import Any
from unittest.mock import MagicMock
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.pool.base import ContainerPoolManager, ContainerState, PooledContainer
from llm_sandbox.pool.config import ExhaustionStrategy, PoolConfig
from llm_sandbox.pool.exceptio... | None | assert | none_literal | tests/test_pool_base.py | test_initialization | TestContainerPoolManager | 92 | null |
vndee/llm-sandbox | from llm_sandbox.language_handlers.cpp_handler import CppHandler
from llm_sandbox.language_handlers.python_handler import PythonHandler
from llm_sandbox.language_handlers.runtime_context import RuntimeContext
class TestCppHandlerDynamicPaths:
def test_execution_commands_with_context_default_workdir(self) -> None:... | 2 | assert | numeric_literal | tests/test_dynamic_paths.py | test_execution_commands_with_context_default_workdir | TestCppHandlerDynamicPaths | 112 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.exceptions import UnsupportedBackendError
from llm_sandbox.pool.config import PoolConfig
from llm_sandbox.pool.factory import create_pool_manager
class TestFactoryEdgeCases:
... | "wait" | assert | string_literal | tests/test_pool_factory.py | test_none_config_uses_defaults | TestFactoryEdgeCases | 197 | null |
vndee/llm-sandbox | import base64
import io
import logging
import re
import tarfile
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.data import FileType, PlotOutput
from llm_sandbox.exceptions import LanguageNotSupportPlotError
from llm_sandbox.language_handlers.b... | "py" | assert | string_literal | tests/test_python_handler.py | test_init | TestPythonHandler | 27 | null |
vndee/llm-sandbox | import base64
import io
import logging
import re
import tarfile
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.data import FileType, PlotOutput
from llm_sandbox.exceptions import LanguageNotSupportPlotError
from llm_sandbox.language_handlers.b... | mock_plot1 | assert | variable | tests/test_python_handler.py | test_extract_plots_success | TestPythonHandler | 149 | null |
vndee/llm-sandbox | import base64
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox import ArtifactSandboxSession, SandboxBackend
from llm_sandbox.data import ConsoleOutput, FileType, PlotOutput
def create_mock_plot_data(count: int = 1) -> bytes | list[PlotOutput]:
"""Create mock plot ... | 0 | assert | numeric_literal | tests/test_plot_clearing.py | test_shell_command_compatibility | TestPlotClearing | 335 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.go_handler import GoHandler
class TestGoHandler:
def test_inject_plot_detection_code(self) -> None:
"""Test plot detection code injection (should return unchange... | code | assert | variable | tests/test_go_handler.py | test_inject_plot_detection_code | TestGoHandler | 38 | null |
vndee/llm-sandbox | import pytest
from llm_sandbox.const import DefaultImage, SandboxBackend, StrEnum, SupportedLanguage
class TestSupportedLanguage:
def test_all_languages(self) -> None:
"""Test all language values."""
assert SupportedLanguage.PYTHON == "python"
assert SupportedLanguage.JAVA == "java"
... | "go" | assert | string_literal | tests/test_const.py | test_all_languages | TestSupportedLanguage | 109 | null |
vndee/llm-sandbox | from collections.abc import Callable
from typing import TYPE_CHECKING, Any, cast
from unittest.mock import MagicMock, Mock, patch
import pytest
from pydantic_core import ValidationError
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import Comman... | "3GB" | assert | string_literal | tests/test_podman.py | test_normalize_runtime_configs_for_podman_returns_copy | TestPodmanRuntimeNormalization | 341 | null |
vndee/llm-sandbox | import pytest
from pydantic import ValidationError
from llm_sandbox.pool.config import ExhaustionStrategy, PoolConfig
class TestPoolConfig:
def test_default_values(self) -> None:
"""Test default configuration values."""
config = PoolConfig()
assert config.max_pool_size == 10
asse... | 0 | assert | numeric_literal | tests/test_pool_config.py | test_default_values | TestPoolConfig | 40 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
from docker.errors import NotFound
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.pool.config import PoolConfig
from llm_sandbox.pool.docker_pool import DockerPoolManager
class TestDockerPoolManagerHealthCheck:
@patch("llm_sandbox.pool.docker_pool.doc... | True | assert | bool_literal | tests/test_pool_docker.py | test_health_check_healthy_container | TestDockerPoolManagerHealthCheck | 255 | null |
vndee/llm-sandbox | import io
import shlex
import tarfile
import tempfile
from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
import pytest
from docker.errors import ImageNotFound, NotFound
from pydantic_core import ValidationError
from llm_sandbox.const import DefaultImage, SupportedLanguage
from llm_... | env | assert | variable | tests/test_docker.py | test_env_list_appends_pythonunbuffered | TestPythonUnbufferedEnvInjection | 1,756 | null |
vndee/llm-sandbox | import re
import pytest
from llm_sandbox.exceptions import InvalidRegexPatternError
from llm_sandbox.security import RestrictedModule, SecurityIssueSeverity, SecurityPattern, SecurityPolicy
class TestSecurityModelsValidation:
def test_security_pattern_empty_description(self) -> None:
"""Test SecurityPat... | "" | assert | string_literal | tests/test_security_missing.py | test_security_pattern_empty_description | TestSecurityModelsValidation | 270 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
from llm_sandbox import SandboxSession
from llm_sandbox.data import ConsoleOutput
class TestCustomImageLibraries:
@patch("llm_sandbox.docker.docker.from_env")
@patch("llm_sandbox.language_handlers.factory.LanguageHandlerFactory.create_handler")
def test_custom_i... | 0 | assert | numeric_literal | tests/test_custom_image_libraries.py | test_custom_image_with_preinstalled_libraries | TestCustomImageLibraries | 77 | null |
vndee/llm-sandbox | import base64
import io
import logging
import tarfile
from unittest.mock import MagicMock, Mock, patch
import pytest
from llm_sandbox.data import FileType
from llm_sandbox.exceptions import CommandFailedError, PackageManagerError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, LanguageConfig, ... | None | assert | none_literal | tests/test_base_handler.py | test_extract_single_plot_exception_handling | TestMissingCoverage | 271 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from kubernetes.client.exceptions import ApiException
from llm_sandbox.k8s_utils import retry_k8s_api_call
class TestRetryK8sApiCall:
def test_fail_after_max_retries(self):
"""Test failure after exhausting retries."""
ws_error = ApiExcepti... | ws_error | assert | variable | tests/test_k8s_utils.py | test_fail_after_max_retries | TestRetryK8sApiCall | 47 | null |
vndee/llm-sandbox | import json
import os
from unittest.mock import MagicMock, patch
import pytest
from mcp.types import ImageContent, TextContent
from llm_sandbox import SupportedLanguage
from llm_sandbox.const import SandboxBackend
from llm_sandbox.data import ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import Mi... | 2 | assert | numeric_literal | tests/test_mcp_server.py | test_execute_code_with_visualization | TestExecuteCode | 333 | null |
vndee/llm-sandbox | import io
import tarfile
import time
from pathlib import Path
from unittest.mock import MagicMock, Mock, patch
import pytest
from llm_sandbox.core.mixins import CommandExecutionMixin, FileOperationsMixin, TimeoutMixin
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import CommandEmptyError, Not... | 5 | assert | numeric_literal | tests/test_mixins.py | test_execute_with_timeout_no_timeout | TestTimeoutMixin | 42 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.ruby_handler import RubyHandler
class TestRubyHandler:
def test_inject_plot_detection_code(self) -> None:
"""Test plot detection code injection (should return un... | code | assert | variable | tests/test_ruby_handler.py | test_inject_plot_detection_code | TestRubyHandler | 38 | null |
vndee/llm-sandbox | import base64
import io
import logging
import re
import tarfile
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.data import FileType, PlotOutput
from llm_sandbox.exceptions import LanguageNotSupportPlotError
from llm_sandbox.language_handlers.b... | len(code) | assert | func_call | tests/test_python_handler.py | test_inject_plot_detection_code | TestPythonHandler | 49 | null |
vndee/llm-sandbox | import io
import shlex
import tarfile
import tempfile
from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
import pytest
from docker.errors import ImageNotFound, NotFound
from pydantic_core import ValidationError
from llm_sandbox.const import DefaultImage, SupportedLanguage
from llm_... | None | assert | none_literal | tests/test_docker.py | test_init_with_defaults | TestSandboxDockerSessionInit | 46 | null |
vndee/llm-sandbox | from dataclasses import FrozenInstanceError
import pytest
from llm_sandbox.data import ConsoleOutput, ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import (
CommandEmptyError,
CommandFailedError,
ExtraArgumentsError,
ImageNotFoundError,
ImagePullError,
LanguageHandlerNotIni... | "" | assert | string_literal | tests/test_data.py | test_console_output_creation | TestConsoleOutput | 34 | null |
vndee/llm-sandbox | import base64
import io
import logging
import tarfile
from unittest.mock import MagicMock, Mock, patch
import pytest
from llm_sandbox.data import FileType
from llm_sandbox.exceptions import CommandFailedError, PackageManagerError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, LanguageConfig, ... | "gruff" | assert | string_literal | tests/test_base_handler.py | test_plot_library_enum_coverage | TestMissingCoverage | 181 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.javascript_handler import JavaScriptHandler
class TestJavaScriptHandler:
def test_init(self) -> None:
"""Test JavaScriptHandler initialization."""
handle... | "js" | assert | string_literal | tests/test_javascript_handler.py | test_init | TestJavaScriptHandler | 19 | null |
vndee/llm-sandbox | import logging
from typing import TYPE_CHECKING
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.exceptions import LanguageNotSupportedError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, PlotOutput
from llm_sandbox.language_handlers.cpp_handler import CppHandler... | None | assert | none_literal | tests/test_language_handler_factory.py | test_create_handler_with_none_logger | TestLanguageHandlerFactory | 259 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.cpp_handler import CppHandler
class TestCppHandler:
def test_init(self) -> None:
"""Test CppHandler initialization."""
handler = CppHandler()
as... | True | assert | bool_literal | tests/test_cpp_handler.py | test_init | TestCppHandler | 23 | null |
vndee/llm-sandbox | from collections.abc import Callable
from typing import TYPE_CHECKING, Any, cast
from unittest.mock import MagicMock, Mock, patch
import pytest
from pydantic_core import ValidationError
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import Comman... | image | assert | variable | tests/test_podman.py | test_get_or_pull_image_uses_local_image | TestPodmanImageManagement | 382 | null |
vndee/llm-sandbox | from llm_sandbox.language_handlers.cpp_handler import CppHandler
from llm_sandbox.language_handlers.python_handler import PythonHandler
from llm_sandbox.language_handlers.runtime_context import RuntimeContext
class TestReadOnlyFilesystemSupport:
def test_python_writable_workspace(self) -> None:
"""Test Py... | commands[0] | assert | complex_expr | tests/test_dynamic_paths.py | test_python_writable_workspace | TestReadOnlyFilesystemSupport | 214 | null |
vndee/llm-sandbox | import pytest
from llm_sandbox.const import DefaultImage, SandboxBackend, StrEnum, SupportedLanguage
class TestStrEnum:
def test_str_enum_creation(self) -> None:
"""Test basic StrEnum creation."""
# Test normal string values
assert SandboxBackend.DOCKER == "docker"
assert SandboxB... | "podman" | assert | string_literal | tests/test_const.py | test_str_enum_creation | TestStrEnum | 17 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.pool.config import PoolConfig
from llm_sandbox.pool.exceptions import SessionNotOpenError
from llm_sandbox.pool.session import ArtifactPo... | call_args | assert | variable | tests/test_pool_session.py | test_clear_plots | TestArtifactPooledSandboxSession | 376 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.cpp_handler import CppHandler
class TestCppHandler:
def test_get_execution_commands(self) -> None:
"""Test getting execution commands."""
handler = CppHa... | 2 | assert | numeric_literal | tests/test_cpp_handler.py | test_get_execution_commands | TestCppHandler | 195 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.core.config import SessionConfig
from llm_sandbox.data import ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import LanguageNotSupportPlotError, MissingDependenc... | "" | assert | string_literal | tests/test_session.py | test_run_with_plotting_disabled | TestArtifactSandboxSession | 221 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.javascript_handler import JavaScriptHandler
class TestJavaScriptHandler:
def test_inject_plot_detection_code(self) -> None:
"""Test plot detection code injection... | code | assert | variable | tests/test_javascript_handler.py | test_inject_plot_detection_code | TestJavaScriptHandler | 38 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.exceptions import MissingDependencyError, UnsupportedBackendError
from llm_sandbox.security import SecurityPolicy
from llm_sandbox.session import create_session
class TestBackendS... | test_mounts | assert | variable | tests/test_backend.py | test_docker_specific_features | TestBackendSpecificFeatures | 231 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.core.config import SessionConfig
from llm_sandbox.data import ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import LanguageNotSupportPlotError, MissingDependenc... | mock_plot | assert | variable | tests/test_session.py | test_run_with_plotting_enabled_supported_language | TestArtifactSandboxSession | 261 | null |
vndee/llm-sandbox | from collections.abc import Generator
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.docker import SandboxDockerSession
from llm_sandbox.session import SandboxSession
def mock_docker_client() -> MagicMock:
"""Create a mock Docker client."""
return MagicMock()... | "" | assert | string_literal | tests/test_encoding_errors.py | test_stream_strict_swallows_unicode_error | TestEncodingErrors | 115 | null |
vndee/llm-sandbox | import logging
from typing import TYPE_CHECKING
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.exceptions import LanguageNotSupportedError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, PlotOutput
from llm_sandbox.language_handlers.cpp_handler import CppHandler... | supported | assert | variable | tests/test_language_handler_factory.py | test_get_supported_languages | TestLanguageHandlerFactory | 107 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.ruby_handler import RubyHandler
class TestRubyHandler:
def test_init(self) -> None:
"""Test RubyHandler initialization."""
handler = RubyHandler()
... | True | assert | bool_literal | tests/test_ruby_handler.py | test_init | TestRubyHandler | 23 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.go_handler import GoHandler
class TestGoHandler:
def test_init(self) -> None:
"""Test GoHandler initialization."""
handler = GoHandler()
assert ... | None | assert | none_literal | tests/test_go_handler.py | test_init | TestGoHandler | 22 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.go_handler import GoHandler
class TestGoHandler:
def test_init(self) -> None:
"""Test GoHandler initialization."""
handler = GoHandler()
assert ... | "go" | assert | string_literal | tests/test_go_handler.py | test_init | TestGoHandler | 19 | null |
vndee/llm-sandbox | import json
import os
from unittest.mock import MagicMock, patch
import pytest
from mcp.types import ImageContent, TextContent
from llm_sandbox import SupportedLanguage
from llm_sandbox.const import SandboxBackend
from llm_sandbox.data import ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import Mi... | True | assert | bool_literal | tests/test_mcp_server.py | test_get_commit_container_true | TestGetCommitContainer | 99 | null |
vndee/llm-sandbox | from llm_sandbox.exceptions import (
CommandEmptyError,
CommandFailedError,
ContainerError,
ExtraArgumentsError,
ImageNotFoundError,
ImagePullError,
InvalidRegexPatternError,
LanguageHandlerNotInitializedError,
LanguageNotSupportedError,
LanguageNotSupportPlotError,
LibraryIn... | str(error) | assert | func_call | tests/test_exceptions.py | test_exception_message_contains_input | TestExceptionMessageFormatting | 380 | null |
vndee/llm-sandbox | import json
import os
from unittest.mock import MagicMock, patch
import pytest
from mcp.types import ImageContent, TextContent
from llm_sandbox import SupportedLanguage
from llm_sandbox.const import SandboxBackend
from llm_sandbox.data import ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import Mi... | 1 | assert | numeric_literal | tests/test_mcp_server.py | test_execute_code_basic_success | TestExecuteCode | 281 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.cpp_handler import CppHandler
class TestCppHandler:
def test_run_with_artifacts_no_plotting_support(self) -> None:
"""Test run_with_artifacts returns empty plots... | [] | assert | collection | tests/test_cpp_handler.py | test_run_with_artifacts_no_plotting_support | TestCppHandler | 57 | null |
vndee/llm-sandbox | import base64
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox import ArtifactSandboxSession, SandboxBackend
from llm_sandbox.data import ConsoleOutput, FileType, PlotOutput
def create_mock_plot_data(count: int = 1) -> bytes | list[PlotOutput]:
"""Create mock plot ... | 1 | assert | numeric_literal | tests/test_plot_clearing.py | test_clear_plots_parameter | TestPlotClearing | 95 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.go_handler import GoHandler
class TestGoHandler:
def test_run_with_artifacts_no_plotting_support(self) -> None:
"""Test run_with_artifacts returns empty plots li... | [] | assert | collection | tests/test_go_handler.py | test_run_with_artifacts_no_plotting_support | TestGoHandler | 57 | null |
vndee/llm-sandbox | import logging
import pytest
from llm_sandbox.exceptions import LanguageNotSupportedError
from llm_sandbox.language_handlers.factory import LanguageHandlerFactory
from llm_sandbox.language_handlers.python_handler import PythonHandler
class TestAbstractLanguageHandler:
def test_filter_comments_removes_multiline(... | filtered | assert | variable | tests/test_language_handlers.py | test_filter_comments_removes_multiline | TestAbstractLanguageHandler | 78 | null |
vndee/llm-sandbox | import logging
import re
from unittest.mock import MagicMock
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.language_handlers.java_handler import JavaHandler
class TestJavaHandler:
def test_run_with_artifacts_no_plotting_support(self) -> None:
"""Test run_with_artifacts returns empty pl... | [] | assert | collection | tests/test_java_handler.py | test_run_with_artifacts_no_plotting_support | TestJavaHandler | 57 | null |
vndee/llm-sandbox | from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
from llm_sandbox.data import ConsoleOutput, StreamCallback
from llm_sandbox.docker import SandboxDockerSession
class TestEndToEndStreamingDocker:
@patch("llm_sandbox.docker.docker.from_env")
@patch("llm_sandbox.language_ha... | ["out"] | assert | collection | tests/test_streaming_callbacks.py | test_only_stdout_callback | TestEndToEndStreamingDocker | 448 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.pool.config import PoolConfig
from llm_sandbox.pool.exceptions import SessionNotOpenError
from llm_sandbox.pool.session import ArtifactPo... | True | assert | bool_literal | tests/test_pool_session.py | test_artifact_session_init | TestArtifactPooledSandboxSession | 285 | null |
vndee/llm-sandbox | import io
import tarfile
import time
from pathlib import Path
from unittest.mock import MagicMock, Mock, patch
import pytest
from llm_sandbox.core.mixins import CommandExecutionMixin, FileOperationsMixin, TimeoutMixin
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import CommandEmptyError, Not... | "pwd") | assert_* | string_literal | tests/test_mixins.py | test_execute_command_with_workdir | TestCommandExecutionMixin | 404 | null |
vndee/llm-sandbox | from collections.abc import Generator
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.docker import SandboxDockerSession
from llm_sandbox.session import SandboxSession
def mock_docker_client() -> MagicMock:
"""Create a mock Docker client."""
return MagicMock()... | stdout | assert | variable | tests/test_encoding_errors.py | test_replace_substitutes_invalid_bytes | TestEncodingErrors | 54 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from kubernetes.client.exceptions import ApiException
from llm_sandbox.k8s_utils import retry_k8s_api_call
class TestRetryK8sApiCall:
def test_retry_on_websocket_error(self):
"""Test retry on WebSocket handshake error."""
# Mock ApiExcepti... | 2 | assert | numeric_literal | tests/test_k8s_utils.py | test_retry_on_websocket_error | TestRetryK8sApiCall | 37 | null |
vndee/llm-sandbox | import time
from typing import Any
from unittest.mock import MagicMock
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.pool.base import ContainerPoolManager, ContainerState, PooledContainer
from llm_sandbox.pool.config import ExhaustionStrategy, PoolConfig
from llm_sandbox.pool.exceptio... | 0 | assert | numeric_literal | tests/test_pool_base.py | test_initialization | TestContainerPoolManager | 91 | null |
vndee/llm-sandbox | from collections.abc import Callable
from typing import TYPE_CHECKING, Any, cast
from unittest.mock import MagicMock, Mock, patch
import pytest
from pydantic_core import ValidationError
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import Comman... | "5XB" | assert | string_literal | tests/test_podman.py | test_normalize_memory_limit_returns_original_for_unknown_unit | TestPodmanRuntimeNormalization | 328 | null |
vndee/llm-sandbox | import pytest
from pydantic import ValidationError
from llm_sandbox.pool.config import ExhaustionStrategy, PoolConfig
class TestPoolConfig:
def test_custom_pool_sizes(self) -> None:
"""Test custom pool size configuration."""
config = PoolConfig(max_pool_size=20, min_pool_size=5)
assert co... | 5 | assert | numeric_literal | tests/test_pool_config.py | test_custom_pool_sizes | TestPoolConfig | 53 | null |
vndee/llm-sandbox | import base64
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox import ArtifactSandboxSession, SandboxBackend
from llm_sandbox.data import ConsoleOutput, FileType, PlotOutput
def create_mock_plot_data(count: int = 1) -> bytes | list[PlotOutput]:
"""Create mock plot ... | clear_cmd | assert | variable | tests/test_plot_clearing.py | test_shell_command_compatibility | TestPlotClearing | 339 | null |
vndee/llm-sandbox | from llm_sandbox.exceptions import (
CommandEmptyError,
CommandFailedError,
ContainerError,
ExtraArgumentsError,
ImageNotFoundError,
ImagePullError,
InvalidRegexPatternError,
LanguageHandlerNotInitializedError,
LanguageNotSupportedError,
LanguageNotSupportPlotError,
LibraryIn... | None | assert | none_literal | tests/test_exceptions.py | test_sandbox_timeout_error_basic | TestSandboxTimeoutError | 257 | null |
vndee/llm-sandbox | from dataclasses import FrozenInstanceError
import pytest
from llm_sandbox.data import ConsoleOutput, ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import (
CommandEmptyError,
CommandFailedError,
ExtraArgumentsError,
ImageNotFoundError,
ImagePullError,
LanguageHandlerNotIni... | plot1 | assert | variable | tests/test_data.py | test_execution_result_with_plots | TestExecutionResult | 125 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from kubernetes.client.exceptions import ApiException
from llm_sandbox.k8s_utils import retry_k8s_api_call
class TestRetryK8sApiCall:
def test_retry_on_websocket_error(self):
"""Test retry on WebSocket handshake error."""
# Mock ApiExcepti... | 3 | assert | numeric_literal | tests/test_k8s_utils.py | test_retry_on_websocket_error | TestRetryK8sApiCall | 36 | null |
vndee/llm-sandbox | import logging
from typing import TYPE_CHECKING
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.exceptions import LanguageNotSupportedError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, PlotOutput
from llm_sandbox.language_handlers.cpp_handler import CppHandler... | "cust" | assert | string_literal | tests/test_language_handler_factory.py | test_register_custom_handler | TestLanguageHandlerFactory | 156 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.exceptions import MissingDependencyError, UnsupportedBackendError
from llm_sandbox.security import SecurityPolicy
from llm_sandbox.session import create_session
class TestBackendC... | "/test" | assert | string_literal | tests/test_backend.py | test_all_backends_accept_common_parameters | TestBackendCommonInterface | 201 | null |
vndee/llm-sandbox | import re
import pytest
from llm_sandbox.exceptions import InvalidRegexPatternError
from llm_sandbox.language_handlers.python_handler import PythonHandler
from llm_sandbox.security import RestrictedModule, SecurityIssueSeverity, SecurityPattern, SecurityPolicy
class TestRestrictedModule:
def test_restricted_mod... | "os" | assert | string_literal | tests/test_security_policy.py | test_restricted_module_creation | TestRestrictedModule | 101 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.core.session_base import BaseSession
from llm_sandbox.pool import PoolConfig, create_pool_manager
class TestPoolManagerLibrariesParameter:
@patch("llm_sandbox.pool.docker_pool.docker.from_e... | kwargs | assert | variable | tests/test_libraries_param.py | test_pool_manager_passes_libraries_to_session | TestPoolManagerLibrariesParameter | 38 | null |
vndee/llm-sandbox | import io
import tarfile
import tempfile
from unittest.mock import MagicMock, Mock, patch
import pytest
from kubernetes.client.exceptions import ApiException
from llm_sandbox.const import DefaultImage, SupportedLanguage
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import ContainerError, NotO... | 1 | assert | numeric_literal | tests/test_kubernetes.py | test_execute_command_with_stderr | TestKubernetesContainerAPI | 923 | null |
vndee/llm-sandbox | import pytest
from pydantic import ValidationError
from llm_sandbox.pool.config import ExhaustionStrategy, PoolConfig
class TestPoolConfig:
def test_max_container_uses_minimum_validation(self) -> None:
"""Test max_container_uses must be >= 1 when not None."""
config = PoolConfig(max_container_use... | 1 | assert | numeric_literal | tests/test_pool_config.py | test_max_container_uses_minimum_validation | TestPoolConfig | 160 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.micromamba import MicromambaSession
from llm_sandbox.security import SecurityPolicy
class TestMicromambaSessionInit:
@patch("llm_sandbox.micromamba.docker.from_env")
@patch("llm_sandbox.... | True | assert | bool_literal | tests/test_micromamba.py | test_init_with_defaults | TestMicromambaSessionInit | 33 | null |
vndee/llm-sandbox | import logging
from typing import TYPE_CHECKING
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.exceptions import LanguageNotSupportedError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, PlotOutput
from llm_sandbox.language_handlers.cpp_handler import CppHandler... | "py" | assert | string_literal | tests/test_language_handler_factory.py | test_create_python_handler | TestLanguageHandlerFactory | 32 | null |
vndee/llm-sandbox | from dataclasses import FrozenInstanceError
import pytest
from llm_sandbox.data import ConsoleOutput, ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import (
CommandEmptyError,
CommandFailedError,
ExtraArgumentsError,
ImageNotFoundError,
ImagePullError,
LanguageHandlerNotIni... | "svg" | assert | string_literal | tests/test_data.py | test_file_type_values | TestFileType | 151 | null |
vndee/llm-sandbox | import logging
from typing import Any
from unittest.mock import MagicMock, Mock, call, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.core.config import SessionConfig
from llm_sandbox.core.mixins import ContainerAPI
from llm_sandbox.core.session_base import BaseSession
from llm_s... | [] | assert | collection | tests/test_session_base.py | test_check_security_policy_no_policy | TestBaseSessionSecurity | 255 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SandboxBackend, SupportedLanguage
from llm_sandbox.core.config import SessionConfig
from llm_sandbox.data import ExecutionResult, FileType, PlotOutput
from llm_sandbox.exceptions import LanguageNotSupportPlotError, MissingDependenc... | exc_tb) | assert_* | variable | tests/test_session.py | test_context_manager_exit | TestArtifactSandboxSession | 186 | null |
vndee/llm-sandbox | import io
import tarfile
import time
from pathlib import Path
from unittest.mock import MagicMock, Mock, patch
import pytest
from llm_sandbox.core.mixins import CommandExecutionMixin, FileOperationsMixin, TimeoutMixin
from llm_sandbox.data import ConsoleOutput
from llm_sandbox.exceptions import CommandEmptyError, Not... | 0 | assert | numeric_literal | tests/test_mixins.py | test_execute_command_success | TestCommandExecutionMixin | 390 | null |
vndee/llm-sandbox | import pytest
from llm_sandbox.const import DefaultImage, SandboxBackend, StrEnum, SupportedLanguage
class TestSupportedLanguage:
def test_all_languages(self) -> None:
"""Test all language values."""
assert SupportedLanguage.PYTHON == "python"
assert SupportedLanguage.JAVA == | "java" | assert | string_literal | tests/test_const.py | test_all_languages | TestSupportedLanguage | 106 | null |
vndee/llm-sandbox | import warnings
from llm_sandbox.data import ConsoleOutput, ExecutionResult, FileType, PlotOutput
class TestDataClassDefaults:
def test_execution_result_defaults(self) -> None:
"""Test ExecutionResult with default values."""
# Test with minimal parameters
result = ExecutionResult()
... | [] | assert | collection | tests/test_data_missing.py | test_execution_result_defaults | TestDataClassDefaults | 243 | null |
vndee/llm-sandbox | import logging
from typing import TYPE_CHECKING
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.exceptions import LanguageNotSupportedError
from llm_sandbox.language_handlers.base import AbstractLanguageHandler, PlotOutput
from llm_sandbox.language_handlers.cpp_handler import CppHandler... | "java" | assert | string_literal | tests/test_language_handler_factory.py | test_create_java_handler | TestLanguageHandlerFactory | 40 | null |
vndee/llm-sandbox | from unittest.mock import MagicMock, patch
import pytest
from llm_sandbox.const import SupportedLanguage
from llm_sandbox.micromamba import MicromambaSession
from llm_sandbox.security import SecurityPolicy
class TestMicromambaSessionInit:
@patch("llm_sandbox.micromamba.docker.from_env")
@patch("llm_sandbox.... | "base" | assert | string_literal | tests/test_micromamba.py | test_init_with_defaults | TestMicromambaSessionInit | 35 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.