repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sloria/TextBlob | 94acdf782ee21458c8d2f3c645653ed32c8b8512 | 107 | train | train | tests/test_utils.py | test_is_filelike | assert_* | func_call | 15 | from unittest import TestCase
import os
from nose.tools import * # PEP8 asserts
from textblob.utils import lowerstrip, strip_punc, is_filelike
HERE = os.path.abspath(os.path.dirname(__file__))
CSV_FILE = os.path.join(HERE, 'data.csv')
def test_is_filelike():
with open(CSV_FILE) as fp:
assert_true(is_fi... | is_filelike('notafile')) | 94acdf782ee21458c8d2f3c645653ed32c8b8512 | 107 | v2_extractor_at_anchor |
sloria/TextBlob | 94acdf782ee21458c8d2f3c645653ed32c8b8512 | 107 | train | train | tests/test_utils.py | test_strip_punc | assert_* | string_literal | 17 | from unittest import TestCase
import os
from nose.tools import * # PEP8 asserts
from textblob.utils import lowerstrip, strip_punc, is_filelike
HERE = os.path.abspath(os.path.dirname(__file__))
CSV_FILE = os.path.join(HERE, 'data.csv')
class UtilsTests(TestCase):
def setUp(self):
self.text = "this. Has.... | 'this. Has. Punctuation') | 94acdf782ee21458c8d2f3c645653ed32c8b8512 | 107 | v2_extractor_at_anchor |
sloria/TextBlob | 94acdf782ee21458c8d2f3c645653ed32c8b8512 | 107 | train | train | tests/test_utils.py | test_lowerstrip | assert_* | string_literal | 17 | from unittest import TestCase
import os
from nose.tools import * # PEP8 asserts
from textblob.utils import lowerstrip, strip_punc, is_filelike
HERE = os.path.abspath(os.path.dirname(__file__))
CSV_FILE = os.path.join(HERE, 'data.csv')
class UtilsTests(TestCase):
def setUp(self):
self.text = "this. Has.... | 'this. has. punctuation') | 94acdf782ee21458c8d2f3c645653ed32c8b8512 | 107 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/basic_abilities/test_browse_website.py | test_browse_website | assert | variable | 25 | import pytest
from autogpt.agent import Agent
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import run_interaction_loop
CYCLE_COUNT = 2
@challenge()
def test_browse_website(
browser_agent: Agent,
patched_api_requestor: None,
monkeypatch: pytest... | content | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/basic_abilities/test_write_file.py | test_write_file | assert | variable | 40 | from typing import List
import pytest
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import get_workspace_path, run_interaction_loop
CYCLE_COUNT_PER_LEVEL = [1, 1]
EXPECT... | content | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/debug_code/test_debug_code_challenge_a.py | test_debug_code_challenge_a | assert | variable | 54 | from pathlib import Path
import pytest
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.execute_code import execute_python_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import (
copy_file_into_workspace,
... | output | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/debug_code/test_debug_code_challenge_a.py | test_debug_code_challenge_a | assert | func_call | 51 | from pathlib import Path
import pytest
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.execute_code import execute_python_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import (
copy_file_into_workspace,
... | output.lower() | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/information_retrieval/test_information_retrieval_challenge_b.py | test_information_retrieval_challenge_b | assert | variable | 43 | import contextlib
import pytest
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import get_workspace_path, run_interaction_loop
CYCLE... | content | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/kubernetes/test_kubernetes_template_challenge_a.py | test_kubernetes_template_challenge_a | assert | variable | 39 | import pytest
import yaml
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import get_workspace_path, run_interaction_loop
CYCLE_COUNT ... | content | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/kubernetes/test_kubernetes_template_challenge_a.py | test_kubernetes_template_challenge_a | assert | complex_expr | 43 | import pytest
import yaml
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import get_workspace_path, run_interaction_loop
CYCLE_COUNT ... | content["kind"] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/memory/test_memory_challenge_a.py | test_memory_challenge_a | assert | variable | 42 | import pytest
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file, write_to_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import get_workspace_path, run_interaction_loop
OUTPUT_LO... | content | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/memory/test_memory_challenge_b.py | test_memory_challenge_b | assert | variable | 49 | import pytest
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file, write_to_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import (
generate_noise,
get_workspace_path,
r... | content | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/memory/test_memory_challenge_c.py | test_memory_challenge_c | assert | variable | 66 | import pytest
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file, write_to_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import (
generate_noise,
get_workspace_path,
r... | content | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/memory/test_memory_challenge_d.py | check_beliefs | assert | variable | 127 | import json
from typing import Dict
import pytest
from pytest_mock import MockerFixture
from autogpt.agent import Agent
from autogpt.commands.file_operations import read_file, write_to_file
from tests.challenges.challenge_decorator.challenge_decorator import challenge
from tests.challenges.utils import get_workspace_... | ai_belief | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/test_challenge_should_be_formatted_properly.py | assert_single_test_function | assert | numeric_literal | 43 | import importlib.util
import inspect
import os
from types import ModuleType
from typing import List
CHALLENGES_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../challenges"
)
def get_python_files(directory: str, exclude_file: str) -> List[str]:
"""Recursively get all python files in a direc... | 1 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/test_challenge_should_be_formatted_properly.py | load_module_from_file | assert | none_literal | 27 | import importlib.util
import inspect
import os
from types import ModuleType
from typing import List
CHALLENGES_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../challenges"
)
def get_python_files(directory: str, exclude_file: str) -> List[str]:
"""Recursively get all python files in a direc... | None | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/test_challenge_should_be_formatted_properly.py | test_method_name_and_count | assert_* | variable | 54 | import importlib.util
import inspect
import os
from types import ModuleType
from typing import List
CHALLENGES_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../challenges"
)
def get_python_files(directory: str, exclude_file: str) -> List[str]:
"""Recursively get all python files in a direc... | test_file) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/challenges/test_challenge_should_be_formatted_properly.py | assert_single_test_function | assert | func_call | 44 | import importlib.util
import inspect
import os
from types import ModuleType
from typing import List
CHALLENGES_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../challenges"
)
def get_python_files(directory: str, exclude_file: str) -> List[str]:
"""Recursively get all python files in a direc... | os.path.basename(test_file)[5:-3] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_get_stats | assert | numeric_literal | 18 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | 1 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_clear | assert | collection | 16 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | [] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_init_without_backing_file | assert | string_literal | 20 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | "[]" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_get | assert | none_literal | 16 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | None | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_get_relevant | assert | variable | 28 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | mem1 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_get_relevant | assert | variable | 29 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | mem2 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_get_relevant | assert | variable | 30 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | mem3 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_add | assert | variable | 17 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | memory_item | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/memory/test_json_file_memory.py | test_json_memory_get_relevant | assert | collection | 31 | import orjson
import pytest
from autogpt.config import Config
from autogpt.memory.vector import JSONFileMemory, MemoryItem
from autogpt.workspace import Workspace
from tests.utils import requires_api_key
def cleanup_sut_singleton():
if JSONFileMemory in JSONFileMemory._instances:
del JSONFileMemory._insta... | [mem4, mem1] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_execute_code.py | test_execute_shell | assert | variable | 30 | import os
import random
import string
import tempfile
from typing import Callable
import pytest
import autogpt.commands.execute_code as sut # system under testing
from autogpt.agent.agent import Agent
from autogpt.config import Config
def random_code(random_string) -> Callable:
return f"print('Hello {random_str... | result | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_execute_code.py | test_execute_python_code | assert | variable | 39 | import os
import random
import string
import tempfile
from typing import Callable
import pytest
import autogpt.commands.execute_code as sut # system under testing
from autogpt.agent.agent import Agent
from autogpt.config import Config
def random_code(random_string) -> Callable:
return f"print('Hello {random_str... | random_code | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_execute_code.py | test_execute_python_file | assert | string_literal | 30 | import os
import random
import string
import tempfile
from typing import Callable
import pytest
import autogpt.commands.execute_code as sut # system under testing
from autogpt.agent.agent import Agent
from autogpt.config import Config
def random_code(random_string) -> Callable:
return f"print('Hello {random_str... | f"Hello {random_string}!\n" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_image_gen.py | test_huggingface_fail_request_with_delay | assert_* | numeric_literal | 60 | import functools
import hashlib
from pathlib import Path
from unittest.mock import patch
import pytest
from PIL import Image
from autogpt.agent.agent import Agent
from autogpt.commands.image_gen import generate_image, generate_image_with_sd_webui
from tests.utils import requires_api_key
def image_size(request):
... | 0) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_image_gen.py | test_huggingface_fail_request_with_delay | assert_* | variable | 84 | import functools
import hashlib
from pathlib import Path
from unittest.mock import patch
import pytest
from PIL import Image
from autogpt.agent.agent import Agent
from autogpt.commands.image_gen import generate_image, generate_image_with_sd_webui
from tests.utils import requires_api_key
def image_size(request):
... | delay) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_image_gen.py | test_huggingface_fail_missing_api_token | pytest.raises | variable | 48 | import functools
import hashlib
from pathlib import Path
from unittest.mock import patch
import pytest
from PIL import Image
from autogpt.agent.agent import Agent
from autogpt.commands.image_gen import generate_image, generate_image_with_sd_webui
from tests.utils import requires_api_key
def image_size(request):
... | ValueError) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_image_gen.py | test_sd_webui_negative_prompt | assert | variable | 38 | import functools
import hashlib
from pathlib import Path
from unittest.mock import patch
import pytest
from PIL import Image
from autogpt.agent.agent import Agent
from autogpt.commands.image_gen import generate_image, generate_image_with_sd_webui
from tests.utils import requires_api_key
def image_size(request):
... | neg_image_hash | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_image_gen.py | test_huggingface_fail_request_with_delay | assert | string_literal | 57 | import functools
import hashlib
from pathlib import Path
from unittest.mock import patch
import pytest
from PIL import Image
from autogpt.agent.agent import Agent
from autogpt.commands.image_gen import generate_image, generate_image_with_sd_webui
from tests.utils import requires_api_key
def image_size(request):
... | "Error creating image." | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_image_gen.py | generate_and_validate | assert | collection | 38 | import functools
import hashlib
from pathlib import Path
from unittest.mock import patch
import pytest
from PIL import Image
from autogpt.agent.agent import Agent
from autogpt.commands.image_gen import generate_image, generate_image_with_sd_webui
from tests.utils import requires_api_key
def image_size(request):
... | (image_size, image_size) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_setup.py | test_generate_aiconfig_automatic_default | assert | none_literal | 18 | from unittest.mock import patch
import pytest
from autogpt.config.ai_config import AIConfig
from autogpt.setup import generate_aiconfig_automatic, prompt_user
from tests.utils import requires_api_key
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
def test_generate_aiconfig_automatic_default(patched_api_request... | None | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_setup.py | test_generate_aiconfig_automatic_fallback | assert | string_literal | 26 | from unittest.mock import patch
import pytest
from autogpt.config.ai_config import AIConfig
from autogpt.setup import generate_aiconfig_automatic, prompt_user
from tests.utils import requires_api_key
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
def test_generate_aiconfig_automatic_fallback(patched_api_reques... | "Chef-GPT" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_setup.py | test_generate_aiconfig_automatic_default | assert | func_call | 20 | from unittest.mock import patch
import pytest
from autogpt.config.ai_config import AIConfig
from autogpt.setup import generate_aiconfig_automatic, prompt_user
from tests.utils import requires_api_key
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
def test_generate_aiconfig_automatic_default(patched_api_request... | len(ai_config.ai_goals) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_setup.py | test_generate_aiconfig_automatic_fallback | assert | string_literal | 27 | from unittest.mock import patch
import pytest
from autogpt.config.ai_config import AIConfig
from autogpt.setup import generate_aiconfig_automatic, prompt_user
from tests.utils import requires_api_key
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
def test_generate_aiconfig_automatic_fallback(patched_api_reques... | "an AI designed to browse bake a cake." | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_setup.py | test_generate_aiconfig_automatic_fallback | assert | collection | 28 | from unittest.mock import patch
import pytest
from autogpt.config.ai_config import AIConfig
from autogpt.setup import generate_aiconfig_automatic, prompt_user
from tests.utils import requires_api_key
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
def test_generate_aiconfig_automatic_fallback(patched_api_reques... | ["Purchase ingredients", "Bake a cake"] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_web_selenium.py | test_browse_website | assert | numeric_literal | 18 | import pytest
from pytest_mock import MockerFixture
from autogpt.agent.agent import Agent
from autogpt.commands.web_selenium import browse_website
from tests.utils import requires_api_key
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
def test_browse_website(agent: Agent, patched_api_requestor: MockerFixture):
... | 200 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/integration/test_web_selenium.py | test_browse_website | assert | variable | 16 | import pytest
from pytest_mock import MockerFixture
from autogpt.agent.agent import Agent
from autogpt.commands.web_selenium import browse_website
from tests.utils import requires_api_key
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
def test_browse_website(agent: Agent, patched_api_requestor: MockerFixture):
... | response | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/_test_json_parser.py | test_invalid_json_leading_sentence_with_gpt | assert | variable | 41 | import pytest
from autogpt.json_utils.json_fix_llm import fix_and_parse_json
def test_invalid_json_leading_sentence_with_gpt():
"""Test that a REALLY invalid JSON string raises an error when try_to_fix_with_gpt is False."""
json_str = """I suggest we start by browsing the repository to find any issues that w... | good_obj | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/_test_json_parser.py | test_invalid_json_major_without_gpt | pytest.raises | variable | 10 | import pytest
from autogpt.json_utils.json_fix_llm import fix_and_parse_json
def test_invalid_json_major_without_gpt():
"""Test that a REALLY invalid JSON string raises an error when try_to_fix_with_gpt is False."""
json_str = 'BEGIN: "name": "John" - "age": 30 - "city": "New York" :END'
# Assert that thi... | Exception) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/_test_json_parser.py | test_valid_json | assert | collection | 10 | import pytest
from autogpt.json_utils.json_fix_llm import fix_and_parse_json
def test_valid_json():
"""Test that a valid JSON string is parsed correctly."""
json_str = '{"name": "John", "age": 30, "city": "New York"}'
obj = fix_and_parse_json(json_str)
assert obj == | {"name": "John", "age": 30, "city": "New York"} | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/_test_json_parser.py | test_invalid_json_minor | assert | collection | 9 | import pytest
from autogpt.json_utils.json_fix_llm import fix_and_parse_json
def test_invalid_json_minor():
"""Test that an invalid JSON string can be fixed with gpt."""
json_str = '{"name": "John", "age": 30, "city": "New York",}'
assert fix_and_parse_json(json_str, try_to_fix_with_gpt=False) == | { "name": "John", "age": 30, "city": "New York", } | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/models/test_base_open_api_plugin.py | test_dummy_plugin_default_methods | assert | numeric_literal | 40 | import pytest
from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin
def dummy_plugin():
"""A dummy plugin for testing purposes."""
manifests_specs_clients = {
"manifest": {
"name_for_model": "Dummy",
"schema_version": "1.0",
"description_for_model": "A dum... | 1 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/models/test_base_open_api_plugin.py | test_dummy_plugin_default_methods | assert | numeric_literal | 47 | import pytest
from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin
def dummy_plugin():
"""A dummy plugin for testing purposes."""
manifests_specs_clients = {
"manifest": {
"name_for_model": "Dummy",
"schema_version": "1.0",
"description_for_model": "A dum... | 2 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/models/test_base_open_api_plugin.py | test_dummy_plugin_default_methods | assert | none_literal | 33 | import pytest
from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin
def dummy_plugin():
"""A dummy plugin for testing purposes."""
manifests_specs_clients = {
"manifest": {
"name_for_model": "Dummy",
"schema_version": "1.0",
"description_for_model": "A dum... | None | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/models/test_base_open_api_plugin.py | test_dummy_plugin_version | assert | string_literal | 21 | import pytest
from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin
def dummy_plugin():
"""A dummy plugin for testing purposes."""
manifests_specs_clients = {
"manifest": {
"name_for_model": "Dummy",
"schema_version": "1.0",
"description_for_model": "A dum... | "1.0" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/models/test_base_open_api_plugin.py | test_dummy_plugin_name | assert | string_literal | 21 | import pytest
from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin
def dummy_plugin():
"""A dummy plugin for testing purposes."""
manifests_specs_clients = {
"manifest": {
"name_for_model": "Dummy",
"schema_version": "1.0",
"description_for_model": "A dum... | "Dummy" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/models/test_base_open_api_plugin.py | test_dummy_plugin_description | assert | string_literal | 21 | import pytest
from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin
def dummy_plugin():
"""A dummy plugin for testing purposes."""
manifests_specs_clients = {
"manifest": {
"name_for_model": "Dummy",
"schema_version": "1.0",
"description_for_model": "A dum... | "A dummy plugin for testing purposes" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_agent.py | test_agent_initialization | assert | numeric_literal | 37 | from unittest.mock import MagicMock
import pytest
from autogpt.agent import Agent
from autogpt.config import AIConfig
from autogpt.config.config import Config
def agent(config: Config):
ai_name = "Test AI"
memory = MagicMock()
next_action_count = 0
command_registry = MagicMock()
ai_config = AICon... | 0 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_agent.py | test_agent_initialization | assert | collection | 36 | from unittest.mock import MagicMock
import pytest
from autogpt.agent import Agent
from autogpt.config import AIConfig
from autogpt.config.config import Config
def agent(config: Config):
ai_name = "Test AI"
memory = MagicMock()
next_action_count = 0
command_registry = MagicMock()
ai_config = AICon... | [] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_agent.py | test_agent_initialization | assert | string_literal | 34 | from unittest.mock import MagicMock
import pytest
from autogpt.agent import Agent
from autogpt.config import AIConfig
from autogpt.config.config import Config
def agent(config: Config):
ai_name = "Test AI"
memory = MagicMock()
next_action_count = 0
command_registry = MagicMock()
ai_config = AICon... | "Test AI" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_agent.py | test_agent_initialization | assert | complex_expr | 35 | from unittest.mock import MagicMock
import pytest
from autogpt.agent import Agent
from autogpt.config import AIConfig
from autogpt.config.config import Config
def agent(config: Config):
ai_name = "Test AI"
memory = MagicMock()
next_action_count = 0
command_registry = MagicMock()
ai_config = AICon... | agent.memory | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_agent.py | test_agent_initialization | assert | complex_expr | 39 | from unittest.mock import MagicMock
import pytest
from autogpt.agent import Agent
from autogpt.config import AIConfig
from autogpt.config.config import Config
def agent(config: Config):
ai_name = "Test AI"
memory = MagicMock()
next_action_count = 0
command_registry = MagicMock()
ai_config = AICon... | agent.ai_config | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_agent_manager.py | test_list_agents | assert | variable | 33 | import pytest
from autogpt.agent.agent_manager import AgentManager
from autogpt.llm.chat import create_chat_completion
def agent_manager():
# Hack, real gross. Singletons are not good times.
yield AgentManager()
del AgentManager._instances[AgentManager]
def task():
return "translate English to French... | agents_list | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_agent_manager.py | test_create_agent | assert | complex_expr | 33 | import pytest
from autogpt.agent.agent_manager import AgentManager
from autogpt.llm.chat import create_chat_completion
def agent_manager():
# Hack, real gross. Singletons are not good times.
yield AgentManager()
del AgentManager._instances[AgentManager]
def task():
return "translate English to French... | agent_manager.agents | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_goals_are_always_lists_of_strings | assert | numeric_literal | 22 | from autogpt.config.ai_config import AIConfig
def test_goals_are_always_lists_of_strings(tmp_path):
"""Test if the goals attribute is always a list of strings."""
yaml_content = """
ai_goals:
- Goal 1: Make a sandwich
- Goal 2, Eat the sandwich
- Goal 3 - Go to sleep
- "Goal 4: Wake up"
ai_name: McFamished
ai... | 4 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_ai_config_file_not_exists | assert | string_literal | 10 | from autogpt.config.ai_config import AIConfig
def test_ai_config_file_not_exists(workspace):
"""Test if file does not exist."""
config_file = workspace.get_path("ai_settings.yaml")
ai_config = AIConfig.load(str(config_file))
assert ai_config.ai_name == | "" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_ai_config_file_not_exists | assert | collection | 12 | from autogpt.config.ai_config import AIConfig
def test_ai_config_file_not_exists(workspace):
"""Test if file does not exist."""
config_file = workspace.get_path("ai_settings.yaml")
ai_config = AIConfig.load(str(config_file))
assert ai_config.ai_name == ""
assert ai_config.ai_role == ""
asser... | [] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_ai_config_file_not_exists | assert | numeric_literal | 13 | from autogpt.config.ai_config import AIConfig
def test_ai_config_file_not_exists(workspace):
"""Test if file does not exist."""
config_file = workspace.get_path("ai_settings.yaml")
ai_config = AIConfig.load(str(config_file))
assert ai_config.ai_name == ""
assert ai_config.ai_role == ""
assert... | 0.0 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_ai_config_file_not_exists | assert | none_literal | 14 | from autogpt.config.ai_config import AIConfig
def test_ai_config_file_not_exists(workspace):
"""Test if file does not exist."""
config_file = workspace.get_path("ai_settings.yaml")
ai_config = AIConfig.load(str(config_file))
assert ai_config.ai_name == ""
assert ai_config.ai_role == ""
assert... | None | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_goals_are_always_lists_of_strings | assert | variable | 40 | from autogpt.config.ai_config import AIConfig
def test_goals_are_always_lists_of_strings(tmp_path):
"""Test if the goals attribute is always a list of strings."""
yaml_content = """
ai_goals:
- Goal 1: Make a sandwich
- Goal 2, Eat the sandwich
- Goal 3 - Go to sleep
- "Goal 4: Wake up"
ai_name: McFamished
ai... | yaml_content2 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_goals_are_always_lists_of_strings | assert | string_literal | 26 | from autogpt.config.ai_config import AIConfig
def test_goals_are_always_lists_of_strings(tmp_path):
"""Test if the goals attribute is always a list of strings."""
yaml_content = """
ai_goals:
- Goal 1: Make a sandwich
- Goal 2, Eat the sandwich
- Goal 3 - Go to sleep
- "Goal 4: Wake up"
ai_name: McFamished
ai... | "Goal 4: Wake up" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_goals_are_always_lists_of_strings | assert | string_literal | 25 | from autogpt.config.ai_config import AIConfig
def test_goals_are_always_lists_of_strings(tmp_path):
"""Test if the goals attribute is always a list of strings."""
yaml_content = """
ai_goals:
- Goal 1: Make a sandwich
- Goal 2, Eat the sandwich
- Goal 3 - Go to sleep
- "Goal 4: Wake up"
ai_name: McFamished
ai... | "Goal 3 - Go to sleep" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_ai_config.py | test_goals_are_always_lists_of_strings | assert | string_literal | 23 | from autogpt.config.ai_config import AIConfig
def test_goals_are_always_lists_of_strings(tmp_path):
"""Test if the goals attribute is always a list of strings."""
yaml_content = """
ai_goals:
- Goal 1: Make a sandwich
- Goal 2, Eat the sandwich
- Goal 3 - Go to sleep
- "Goal 4: Wake up"
ai_name: McFamished
ai... | "Goal 1: Make a sandwich" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_update_cost_embedding_model | assert | numeric_literal | 38 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | 0 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_create_chat_completion_valid_inputs | assert | numeric_literal | 47 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | 10 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_create_chat_completion_valid_inputs | assert | numeric_literal | 48 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | 20 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_getter_methods | assert | numeric_literal | 33 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | 600 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_getter_methods | assert | numeric_literal | 34 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | 1200 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_getter_methods | assert | numeric_literal | 36 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | 10.0 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_create_chat_completion_debug_mode | assert | complex_expr | 47 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | caplog.text | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_set_total_budget | assert | variable | 35 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | total_budget | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_update_cost_completion_model | assert | variable | 38 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | prompt_tokens | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_get_models | assert | string_literal | 36 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | "gpt-3.5-turbo" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_update_cost_completion_model | assert | variable | 39 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | completion_tokens | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_update_cost_embedding_model | assert | collection | 39 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | (prompt_tokens * 0.0004) / 1000 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_create_chat_completion_valid_inputs | assert | collection | 49 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | (10 * 0.0013 + 20 * 0.0025) / 1000 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_getter_methods | assert | collection | 35 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | (600 * 0.0013 + 1200 * 0.0025) / 1000 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_api_manager.py | test_update_cost_completion_model | assert | collection | 40 | from unittest.mock import MagicMock, patch
import pytest
from pytest_mock import MockerFixture
from autogpt.llm.api_manager import OPEN_AI_MODELS, ApiManager
api_manager = ApiManager()
def reset_api_manager():
api_manager.reset()
yield
def mock_costs(mocker: MockerFixture):
mocker.patch.multiple(
... | (prompt_tokens * 0.0013 + completion_tokens * 0.0025) / 1000 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_valid_url_with_hyperlinks | assert | numeric_literal | 10 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_valid_url_with_hyperlinks(self, agent: Agent):
url = "https://www.google.com"
result = scrape_links(url, agent=agent)
assert len(result) > | 0 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_scrape_links_with_few_hyperlinks | assert | numeric_literal | 27 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_scrape_links_with_few_hyperlinks(self, mocker, agent: Agent):
"""Test that scrape_links() correctly extracts and formats hyperlinks from a sample HTML containing a few hyperlinks.""... | 3 | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_no_hyperlinks | assert | collection | 19 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_no_hyperlinks(self, mocker, agent: Agent):
"""Test that the function returns an empty list when the html contains no hyperlinks."""
# Mock the requests.get() function to ret... | [] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_invalid_url | assert | variable | 18 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_invalid_url(self, mocker, agent: Agent):
"""Test that the function returns "error" when given an invalid url."""
# Mock the requests.get() function to return an HTTP error r... | result | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_scrape_links_with_few_hyperlinks | assert | string_literal | 29 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_scrape_links_with_few_hyperlinks(self, mocker, agent: Agent):
"""Test that scrape_links() correctly extracts and formats hyperlinks from a sample HTML containing a few hyperlinks.""... | "GitHub (https://github.com)" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_scrape_links_with_few_hyperlinks | assert | string_literal | 28 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_scrape_links_with_few_hyperlinks(self, mocker, agent: Agent):
"""Test that scrape_links() correctly extracts and formats hyperlinks from a sample HTML containing a few hyperlinks.""... | "Google (https://www.google.com)" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_scrape_links_with_few_hyperlinks | assert | string_literal | 30 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_scrape_links_with_few_hyperlinks(self, mocker, agent: Agent):
"""Test that scrape_links() correctly extracts and formats hyperlinks from a sample HTML containing a few hyperlinks.""... | "CodiumAI (https://www.codium.ai)" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_links.py | test_valid_url | assert | collection | 21 | from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_links
class TestScrapeLinks:
def test_valid_url(self, mocker, agent: Agent):
"""Test that the function returns correctly formatted hyperlinks when given a valid url."""
# Mock the requests.get() function to retu... | ["Google (https://www.google.com)"] | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_text.py | test_no_text | assert | string_literal | 20 | import pytest
import requests
from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_text
class TestScrapeText:
def test_no_text(self, mocker, agent: Agent):
"""Test that scrape_text returns an empty string when the html page contains no text to be scraped."""
# Mo... | "" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_text.py | test_invalid_url | pytest.raises | variable | 13 | import pytest
import requests
from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_text
class TestScrapeText:
def test_invalid_url(self, agent: Agent):
"""Tests that an error is raised when an invalid url is provided."""
url = "invalidurl.com"
pytest.rai... | ValueError) | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_text.py | test_scrape_text_with_valid_url | assert | variable | 24 | import pytest
import requests
from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_text
class TestScrapeText:
def test_scrape_text_with_valid_url(self, mocker, agent: Agent):
"""Tests that scrape_text() returns the expected text when given a valid URL."""
# Mock t... | expected_text | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_text.py | test_unreachable_url | assert | variable | 21 | import pytest
import requests
from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_text
class TestScrapeText:
def test_unreachable_url(self, mocker, agent: Agent):
"""Test that scrape_text returns an error message when an invalid or unreachable url is provided."""
... | error_message | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_text.py | test_scrape_text_with_html_tags | assert | string_literal | 23 | import pytest
import requests
from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_text
class TestScrapeText:
def test_scrape_text_with_html_tags(self, mocker, agent: Agent):
"""Test that scrape_text() properly handles HTML tags."""
# Create a mock response objec... | "This is bold text." | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_browse_scrape_text.py | test_http_error | assert | string_literal | 19 | import pytest
import requests
from autogpt.agent.agent import Agent
from autogpt.commands.web_requests import scrape_text
class TestScrapeText:
def test_http_error(self, mocker, agent: Agent):
"""Test that scrape_text returns an error message when the response status code is an http error (>=400)."""
... | "Error: HTTP 404 error" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_commands.py | test_register_command | assert | variable | 31 | import os
import shutil
import sys
from pathlib import Path
import pytest
from autogpt.commands.command import Command, CommandRegistry
SIGNATURE = "(arg1: int, arg2: str) -> str"
class TestCommandRegistry:
def example_command_method(arg1: int, arg2: str) -> str:
return f"{arg1} - {arg2}"
def test... | cmd | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
snap-stanford/MLAgentBench | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | train | train | MLAgentBench/agents/Auto-GPT/tests/unit/test_commands.py | test_command_creation | assert | string_literal | 29 | import os
import shutil
import sys
from pathlib import Path
import pytest
from autogpt.commands.command import Command, CommandRegistry
SIGNATURE = "(arg1: int, arg2: str) -> str"
class TestCommand:
def example_command_method(arg1: int, arg2: str) -> str:
"""Example function for testing the Command cla... | "example" | f7869fa915430d791f8599a793f0bca1bf3c5e4c | 0 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.