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
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_constructor_extracts_all_arguments
assert
variable
45
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
args
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_dependencies.py
test_gather_sources_and_dependencies
assert
variable
33
import os.path import os import mock import pytest from sacred.dependencies import (PEP440_VERSION_PATTERN, PackageDependency, Source, gather_sources_and_dependencies, get_digest, get_py_file_if_possible, is_local_source...
deps
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_ingredients.py
test_get_experiment_info
assert
variable
19
import os import pytest import tempfile from sacred.config import ConfigScope, ConfigDict from sacred.dependencies import Source, PackageDependency from sacred.experiment import Experiment from sacred.ingredient import Ingredient from sacred.utils import CircularDependencyError from sacred.serializer import json def ...
info
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_file_storage_observer.py
test_fs_observer_equality
assert
variable
58
import datetime import hashlib import os import tempfile from copy import copy import pytest import json from sacred.observers.file_storage import FileStorageObserver from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics T1 = datetime.datetime(1999, 5, 4, 3, 2, 1, 0) T2 = datetime.datetime(1999, 5...
obs2
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_queue_mongo_observer.py
test_mongo_observer_heartbeat_event_updates_run
assert
variable
62
import datetime import mock import pytest from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics pymongo = pytest.importorskip("pymongo") mongomock = pytest.importorskip("mongomock") gridfs = pytest.importorskip("gridfs") import pymongo.errors from sacred.dependencies import get_digest from sacred...
info
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_queue_mongo_observer.py
test_mongo_observer_heartbeat_event_updates_run
assert
variable
63
import datetime import mock import pytest from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics pymongo = pytest.importorskip("pymongo") mongomock = pytest.importorskip("mongomock") gridfs = pytest.importorskip("gridfs") import pymongo.errors from sacred.dependencies import get_digest from sacred...
outp
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_arg_parser.py
test_parse_individual_arguments
assert
variable
39
import pytest import shlex from docopt import docopt from sacred.arg_parser import (_convert_value, get_config_updates, format_usage) from sacred.commandline_options import gather_command_line_options @pytest.mark.parametrize("argv,expected", [ ('', {}), ('run', {'COMMAND': 'run'}...
plain
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_captured_function_randomness
assert
variable
19
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_captured_function_randomness(): def foo(_rnd, _seed): return _rnd.randint(0, 1000), _seed cf = create_captured_function(foo) assert cf.uses_randomness cf.logger = mock.MagicM...
seed2
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_config_dict_accepts_special_types
assert
variable
20
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
value
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_readonly_containers.py
test_nested_readonly_containers
assert
variable
97
import pytest from copy import copy, deepcopy from sacred.config.custom_containers import (make_read_only, ReadOnlyList, ReadOnlyDict, ) from sacred.utils import SacredError def _check_read_only_dict(d): assert isinstance(d, ReadOnlyDict) raises_dict = pytest.rais...
tuple
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_constructor_extract_kwargs_wildcard_name
assert
variable
46
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
kw_wc
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_fallback_dict.py
test_getitem
assert
variable
9
import pytest from sacred.config.custom_containers import fallback_dict def fbdict(): return fallback_dict({'fall1': 7, 'fall3': True}) def test_getitem(fbdict): assert 'foo' not in
fbdict
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_constructor_extract_vararg_name
assert
variable
46
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
vararg
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_constructor_extract_kwargs
assert
variable
47
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
kwargs
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_tinydb_reader.py
test_fetch_report_function
assert
variable
159
from __future__ import (division, print_function, unicode_literals, absolute_import) import datetime import os import tempfile import io import pytest tinydb = pytest.importorskip("tinydb") hashfs = pytest.importorskip("hashfs") from tinydb import Query from sacred.dependencies import get_d...
target
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_optional.py
test_optional_import
assert
variable
8
import pytest from sacred.optional import optional_import, get_tensorflow, modules_exist def test_optional_import(): has_pytest, pyt = optional_import("pytest") assert has_pytest assert pyt ==
pytest
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_file_storage_observer.py
test_log_metrics
assert
variable
104
import datetime import hashlib import os import tempfile from copy import copy import pytest import json from sacred.observers.file_storage import FileStorageObserver from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics T1 = datetime.datetime(1999, 5, 4, 3, 2, 1, 0) T2 = datetime.datetime(1999, 5...
metrics
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_arg_parser.py
test_convert_value
assert
variable
37
import pytest import shlex from docopt import docopt from sacred.arg_parser import (_convert_value, get_config_updates, format_usage) from sacred.commandline_options import gather_command_line_options @pytest.mark.parametrize("value,expected", [ ('None', None), ('True', True), ('False', ...
expected
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_commands.py
test_format_entry
assert
variable
45
import pprint from collections import OrderedDict import pytest from sacred import Ingredient, Experiment from sacred.commands import (COLOR_MODIFIED, ENDC, COLOR_DOC, COLOR_ADDED, COLOR_TYPECHANGED, ConfigEntry, PathEntry, _format_config, _format_entry, ...
expected
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_readonly_containers.py
test_copy_on_readonly_dict
assert
variable
90
import pytest from copy import copy, deepcopy from sacred.config.custom_containers import (make_read_only, ReadOnlyList, ReadOnlyDict, ) from sacred.utils import SacredError def _check_read_only_dict(d): assert isinstance(d, ReadOnlyDict) raises_dict = pytest.rais...
k_copied
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_readonly_containers.py
test_copy_on_readonly_dict
assert
variable
91
import pytest from copy import copy, deepcopy from sacred.config.custom_containers import (make_read_only, ReadOnlyList, ReadOnlyDict, ) from sacred.utils import SacredError def _check_read_only_dict(d): assert isinstance(d, ReadOnlyDict) raises_dict = pytest.rais...
v_copied
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_constructor_extract_positional_arguments
assert
variable
46
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
pos_args
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_dependencies.py
test_package_dependency_get_version_heuristic_version__
assert
variable
21
import os.path import os import mock import pytest from sacred.dependencies import (PEP440_VERSION_PATTERN, PackageDependency, Source, gather_sources_and_dependencies, get_digest, get_py_file_if_possible, is_local_source...
expected
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_dependencies.py
test_is_local_source
assert
variable
37
import os.path import os import mock import pytest from sacred.dependencies import (PEP440_VERSION_PATTERN, PackageDependency, Source, gather_sources_and_dependencies, get_digest, get_py_file_if_possible, is_local_source...
is_local
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_create_captured_function
assert
collection
17
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_create_captured_function(): def foo(): """my docstring""" return 42 cf = create_captured_function(foo) assert cf.__name__ == 'foo' assert cf.__doc__ == 'my docstring...
{}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_dogmatic_list.py
test_init
assert
collection
7
import pytest from sacred.config.custom_containers import DogmaticDict, DogmaticList def test_init(): l = DogmaticList() assert l ==
[]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_get_free_parameters
assert
collection
44
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
[]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_construct_arguments_without_options_returns_same_args_kwargs
assert
collection
46
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
{}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_file_storage_observer.py
test_fs_observer_started_event_creates_rundir_with_filesystem_delay
assert
collection
64
import datetime import hashlib import os import tempfile from copy import copy import pytest import json from sacred.observers.file_storage import FileStorageObserver from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics T1 = datetime.datetime(1999, 5, 4, 3, 2, 1, 0) T2 = datetime.datetime(1999, 5...
[]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_queue_observer.py
test_log_metrics
assert
collection
23
from collections import OrderedDict from sacred.observers.queue import QueueObserver import mock import pytest def queue_observer(): return QueueObserver( mock.MagicMock(), interval=0.01, retry_interval=0.01, ) def test_log_metrics(queue_observer): queue_observer.started_event() ...
{}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_construct_arguments_without_options_returns_same_args_kwargs
assert
collection
55
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
[2]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_construct_arguments_for_bound_method
assert
collection
45
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
[1]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_examples.py
test_example
assert
collection
21
import logging def test_example(capsys, example_test): # pytest adds a `LogCaptureHandler` to the root logger. This conflicts # with the sacred logger setup, so remove it logging.root.handlers = [] ex, call, out = example_test ex.run_commandline(call) captured_out, captured_err = capsys.readout...
['']
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_fixed_subentry_of_preset
assert
collection
31
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
{'d'}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_ingredients.py
test_capture_function_twice
assert
collection
21
import os import pytest import tempfile from sacred.config import ConfigScope, ConfigDict from sacred.dependencies import Source, PackageDependency from sacred.experiment import Experiment from sacred.ingredient import Ingredient from sacred.utils import CircularDependencyError from sacred.serializer import json def ...
[foo]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_file_storage_observer.py
test_fs_observer_started_event_creates_rundir_with_filesystem_delay
assert
collection
61
import datetime import hashlib import os import tempfile from copy import copy import pytest import json from sacred.observers.file_storage import FileStorageObserver from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics T1 = datetime.datetime(1999, 5, 4, 3, 2, 1, 0) T2 = datetime.datetime(1999, 5...
[_id]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_dogmatic_list.py
test_append
assert
collection
9
import pytest from sacred.config.custom_containers import DogmaticDict, DogmaticList def test_append(): l = DogmaticList([1, 2]) l.append(3) l.append(4) assert l ==
[1, 2]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_construct_arguments_completes_kwargs_from_options
assert
collection
45
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
[2, 4]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_signature.py
test_construct_arguments_does_not_overwrite_args_and_kwargs
assert
collection
46
from __future__ import division, print_function import re import pytest from sacred.config.signature import Signature from sacred.utils import MissingConfigError def foo() -> None: return def bariza(a: int, b: float, c: str): return a, b, c def complex_function_name(a: int = 5, b: str = 'fo', c: float = ...
[1, 2]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_experiment_named_config_subingredient
assert
collection
35
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_experiment_named_config_subingredient(): somemod = Ingredient("somemod") @somemod.config def sub_cfg(): a = 15 @somemod.capture def get_answer(a): return a @somemo...
(1, 15)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_experiment_named_config_subingredient
assert
collection
36
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_experiment_named_config_subingredient(): somemod = Ingredient("somemod") @somemod.config def sub_cfg(): a = 15 @somemod.capture def get_answer(a): return a @somemo...
(1, 16)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_experiment_named_config_subingredient
assert
collection
37
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_experiment_named_config_subingredient(): somemod = Ingredient("somemod") @somemod.config def sub_cfg(): a = 15 @somemod.capture def get_answer(a): return a @somemo...
(2, 25)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_experiment_named_config_subingredient
assert
collection
38
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_experiment_named_config_subingredient(): somemod = Ingredient("somemod") @somemod.config def sub_cfg(): a = 15 @somemod.capture def get_answer(a): return a @somemo...
(2, 16)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_captured_function_call_doesnt_modify_kwargs
assert
collection
18
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_captured_function_call_doesnt_modify_kwargs(): def foo(a, _log): if _log is not None: return a cf = create_captured_function(foo) cf.logger = mock.MagicMock() cf....
{'a': 7}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_config_dict_result_contains_keys
assert
collection
25
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
[1, 2, 3]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_adding_values
assert
collection
21
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
{'i': 10}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_experiment_double_named_config
assert
collection
32
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_experiment_double_named_config(): ex = Experiment() @ex.config def config(): a = 0 d = { 'e': 0, 'f': 0 } @ex.named_config def A(): ...
(0, 0, 0)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_experiment_double_named_config
assert
collection
33
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_experiment_double_named_config(): ex = Experiment() @ex.config def config(): a = 0 d = { 'e': 0, 'f': 0 } @ex.named_config def A(): ...
(2, 2, 2)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_queue_observer.py
test_started_event
assert
collection
20
from collections import OrderedDict from sacred.observers.queue import QueueObserver import mock import pytest def queue_observer(): return QueueObserver( mock.MagicMock(), interval=0.01, retry_interval=0.01, ) def test_started_event(queue_observer): queue_observer.started_event("...
("args",)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_tinydb_reader.py
test_fetch_files_function
assert
collection
130
from __future__ import (division, print_function, unicode_literals, absolute_import) import datetime import os import tempfile import io import pytest tinydb = pytest.importorskip("tinydb") hashfs = pytest.importorskip("hashfs") from tinydb import Query from sacred.dependencies import get_d...
['about']
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_utils.py
test_get_by_dotted_path
assert
collection
16
import pytest from sacred.utils import (PATHCHANGE, convert_to_nested_dict, get_by_dotted_path, is_prefix, iter_path_splits, iter_prefixes, iterate_flattened, iterate_flattened_separately, join_paths, recursive_upda...
{'a': 12}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_utils.py
test_get_inheritors
assert
collection
30
import pytest from sacred.utils import (PATHCHANGE, convert_to_nested_dict, get_by_dotted_path, is_prefix, iter_path_splits, iter_prefixes, iterate_flattened, iterate_flattened_separately, join_paths, recursive_upda...
{B, C, D}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_conf_scope_does_not_contain_fallback
assert
collection
33
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
{'answer'}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_fixed_subentry_of_preset
assert
collection
32
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
{'a', 'b'}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_scope_chain.py
test_chained_config_scopes_contain_combined_keys
assert
collection
15
import pytest from sacred.config import ConfigScope, ConfigDict, chain_evaluate_config_scopes def test_chained_config_scopes_contain_combined_keys(): @ConfigScope def cfg1(): a = 10 @ConfigScope def cfg2(): b = 20 final_cfg, summary = chain_evaluate_config_scopes([cfg1, cfg2]) ...
{'a', 'b'}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_captured_function_randomness
assert
collection
23
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_captured_function_randomness(): def foo(_rnd, _seed): return _rnd.randint(0, 1000), _seed cf = create_captured_function(foo) assert cf.uses_randomness cf.logger = mock.MagicM...
(nr1, seed1)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_captured_function_randomness
assert
collection
24
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_captured_function_randomness(): def foo(_rnd, _seed): return _rnd.randint(0, 1000), _seed cf = create_captured_function(foo) assert cf.uses_randomness cf.logger = mock.MagicM...
(nr2, seed2)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_tinydb_reader.py
test_fetch_files_function
assert
collection
137
from __future__ import (division, print_function, unicode_literals, absolute_import) import datetime import os import tempfile import io import pytest tinydb = pytest.importorskip("tinydb") hashfs = pytest.importorskip("hashfs") from tinydb import Query from sacred.dependencies import get_d...
['setup.py']
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_arg_parser.py
test_get_config_updates
assert
collection
22
import pytest import shlex from docopt import docopt from sacred.arg_parser import (_convert_value, get_config_updates, format_usage) from sacred.commandline_options import gather_command_line_options @pytest.mark.parametrize("update,expected", [ (None, {}), (['a=5'], {'a': 5}), (['...
(expected, [])
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_mongo_option.py
test_parse_mongo_db_arg
assert
collection
9
import pytest pymongo = pytest.importorskip("pymongo") from sacred.observers.mongo import MongoDbOption, DEFAULT_MONGO_PRIORITY def test_parse_mongo_db_arg(): assert MongoDbOption.parse_mongo_db_arg('foo') ==
{'db_name': 'foo'}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_queue_observer.py
test_started_event
assert
collection
21
from collections import OrderedDict from sacred.observers.queue import QueueObserver import mock import pytest def queue_observer(): return QueueObserver( mock.MagicMock(), interval=0.01, retry_interval=0.01, ) def test_started_event(queue_observer): queue_observer.started_event("...
{"kwds": "kwargs"}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_call_captured_function
assert
collection
15
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_call_captured_function(): def foo(a, b, c, d=4, e=5, f=6): return a, b, c, d, e, f cf = create_captured_function(foo) cf.logger = mock.MagicMock() cf.config = {'a': 11, 'b': ...
(21, 12, 23, 14, 5, 26)
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_mongo_option.py
test_parse_mongo_db_arg_hostname
assert
collection
9
import pytest pymongo = pytest.importorskip("pymongo") from sacred.observers.mongo import MongoDbOption, DEFAULT_MONGO_PRIORITY def test_parse_mongo_db_arg_hostname(): asse
{'url': 'localhost:28017'}
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_dogmatic_list.py
test_nested_dict_revelation
assert
complex_expr
11
import pytest from sacred.config.custom_containers import DogmaticDict, DogmaticList def test_nested_dict_revelation(): d1 = DogmaticDict({'a': 7, 'b': 12}) d2 = DogmaticDict({'c': 7}) l = DogmaticList([d1, 2, d2]) # assert l.revelation() == {'0.a', '0.b', '2.c'} l.revelation() assert 'a' in
l[0]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_dogmatic_list.py
test_nested_dict_revelation
assert
complex_expr
13
import pytest from sacred.config.custom_containers import DogmaticDict, DogmaticList def test_nested_dict_revelation(): d1 = DogmaticDict({'a': 7, 'b': 12}) d2 = DogmaticDict({'c': 7}) l = DogmaticList([d1, 2, d2]) # assert l.revelation() == {'0.a', '0.b', '2.c'} l.revelation() assert 'a' in l[0...
l[2]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_captured_function_magic_run_argument
assert
complex_expr
15
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_captured_function_magic_run_argument(): def foo(_run): return _run cf = create_captured_function(foo) cf.logger = mock.MagicMock() cf.run = mock.MagicMock() assert cf()...
cf.run
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_serializer.py
test_serialize_numpy_arrays
assert
complex_expr
12
import pytest from sacred.serializer import flatten, restore import sacred.optional as opt @pytest.mark.skipif(not opt.has_numpy, reason="requires numpy") def test_serialize_numpy_arrays(): a = opt.np.array([[1, 2, 3], [4, 5, 6]], dtype=opt.np.float32) b = restore(flatten(a)) assert opt.np.all(b == a) ...
a.dtype
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_serializer.py
test_serialize_numpy_arrays
assert
complex_expr
13
import pytest from sacred.serializer import flatten, restore import sacred.optional as opt @pytest.mark.skipif(not opt.has_numpy, reason="requires numpy") def test_serialize_numpy_arrays(): a = opt.np.array([[1, 2, 3], [4, 5, 6]], dtype=opt.np.float32) b = restore(flatten(a)) assert opt.np.all(b == a) ...
a.shape
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_commands.py
test_format_config
assert
complex_expr
35
import pprint from collections import OrderedDict import pytest from sacred import Ingredient, Experiment from sacred.commands import (COLOR_MODIFIED, ENDC, COLOR_DOC, COLOR_ADDED, COLOR_TYPECHANGED, ConfigEntry, PathEntry, _format_config, _format_entry, ...
lines[1]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_commands.py
test_format_config
assert
complex_expr
36
import pprint from collections import OrderedDict import pytest from sacred import Ingredient, Experiment from sacred.commands import (COLOR_MODIFIED, ENDC, COLOR_DOC, COLOR_ADDED, COLOR_TYPECHANGED, ConfigEntry, PathEntry, _format_config, _format_entry, ...
lines[2]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_commands.py
test_format_config
assert
complex_expr
37
import pprint from collections import OrderedDict import pytest from sacred import Ingredient, Experiment from sacred.commands import (COLOR_MODIFIED, ENDC, COLOR_DOC, COLOR_ADDED, COLOR_TYPECHANGED, ConfigEntry, PathEntry, _format_config, _format_entry, ...
lines[3]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_commands.py
test_format_config
assert
complex_expr
38
import pprint from collections import OrderedDict import pytest from sacred import Ingredient, Experiment from sacred.commands import (COLOR_MODIFIED, ENDC, COLOR_DOC, COLOR_ADDED, COLOR_TYPECHANGED, ConfigEntry, PathEntry, _format_config, _format_entry, ...
lines[4]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_commands.py
test_format_config
assert
complex_expr
39
import pprint from collections import OrderedDict import pytest from sacred import Ingredient, Experiment from sacred.commands import (COLOR_MODIFIED, ENDC, COLOR_DOC, COLOR_ADDED, COLOR_TYPECHANGED, ConfigEntry, PathEntry, _format_config, _format_entry, ...
lines[5]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_run.py
test_run_heartbeat_event
assert
complex_expr
30
from datetime import datetime import mock import os import pytest import tempfile import sys from sacred.run import Run from sacred.config.config_summary import ConfigSummary from sacred.utils import (ObserverError, SacredInterrupt, TimeoutInterrupt, apply_backspaces_and_linefeeds) def run()...
run.info
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_captured_function_magic_logger_argument
assert
complex_expr
14
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_captured_function_magic_logger_argument(): def foo(_log): return _log cf = create_captured_function(foo) cf.logger = mock.MagicMock() assert cf() ==
cf.logger
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_captured_function_magic_config_argument
assert
complex_expr
15
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_captured_function_magic_config_argument(): def foo(_config): return _config cf = create_captured_function(foo) cf.logger = mock.MagicMock() cf.config = {'a': 2, 'b': 2} ...
cf.config
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_ingredient_command
assert
complex_expr
14
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_ingredient_command(): m = Ingredient("somemod") m.add_config(a=42, b='foo{}') @m.command def transmogrify(a, b): return b.format(a) assert 'transmogrify' in
m.commands
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_stflow/test_internal.py
test_context_method_decorator
assert
complex_expr
30
from sacred.stflow.internal import ContextMethodDecorator def test_context_method_decorator(): """ Ensure that ContextMethodDecorator can intercept method calls. """ class FooClass(): def __init__(self, x): self.x = x def do_foo(self, y, z): print("foo") ...
5 * 10 + 6
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_readonly_containers.py
test_deepcopy_on_nested_readonly_list_can_be_mutated
assert
complex_expr
90
import pytest from copy import copy, deepcopy from sacred.config.custom_containers import (make_read_only, ReadOnlyList, ReadOnlyDict, ) from sacred.utils import SacredError def _check_read_only_dict(d): assert isinstance(d, ReadOnlyDict) raises_dict = pytest.rais...
copied_l[1][1]
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_run.py
test_run_state_attributes
assert
string_literal
28
from datetime import datetime import mock import os import pytest import tempfile import sys from sacred.run import Run from sacred.config.config_summary import ConfigSummary from sacred.utils import (ObserverError, SacredInterrupt, TimeoutInterrupt, apply_backspaces_and_linefeeds) def run()...
''
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_run.py
test_run_heartbeat_event
assert
string_literal
31
from datetime import datetime import mock import os import pytest import tempfile import sys from sacred.run import Run from sacred.config.config_summary import ConfigSummary from sacred.utils import (ObserverError, SacredInterrupt, TimeoutInterrupt, apply_backspaces_and_linefeeds) def run()...
""
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_utils.py
test_join_paths
assert
string_literal
15
import pytest from sacred.utils import (PATHCHANGE, convert_to_nested_dict, get_by_dotted_path, is_prefix, iter_path_splits, iter_prefixes, iterate_flattened, iterate_flattened_separately, join_paths, recursive_upda...
''
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_fixing_nested_dicts
assert
string_literal
20
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
'b'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_dict.py
test_fixing_nested_dicts
assert
string_literal
21
import pytest import sacred.optional as opt from sacred.config import ConfigDict from sacred.config.custom_containers import DogmaticDict, DogmaticList def conf_dict(): cfg = ConfigDict({ "a": 1, "b": 2.0, "c": True, "d": 'string', "e": [1, 2, 3], "f": {'a': 'b', 'c'...
't'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_scope.py
test_fixing_nested_dicts
assert
string_literal
38
import pytest import sacred.optional as opt from sacred.config.config_scope import (ConfigScope, dedent_function_body, dedent_line, get_function_body, is_empty_or_comment) from sacred.config.custom_containers import DogmaticDict, DogmaticLi...
'b'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_config_scope.py
test_fixing_nested_dicts
assert
string_literal
39
import pytest import sacred.optional as opt from sacred.config.config_scope import (ConfigScope, dedent_function_body, dedent_line, get_function_body, is_empty_or_comment) from sacred.config.custom_containers import DogmaticDict, DogmaticLi...
't'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_fallback_dict.py
test_get
assert
string_literal
10
import pytest from sacred.config.custom_containers import fallback_dict def fbdict(): return fallback_dict({'fall1': 7, 'fall3': True}) def test_get(fbdict): fbdict['a'] = 'b' assert fbdict.get('a', 18) ==
'b'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_file_storage_observer.py
test_fs_observer_started_event_creates_rundir_with_filesystem_delay
assert
string_literal
60
import datetime import hashlib import os import tempfile from copy import copy import pytest import json from sacred.observers.file_storage import FileStorageObserver from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics T1 = datetime.datetime(1999, 5, 4, 3, 2, 1, 0) T2 = datetime.datetime(1999, 5...
'1'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_file_storage_observer.py
test_fs_observer_started_event_creates_rundir_with_filesystem_delay
assert
string_literal
66
import datetime import hashlib import os import tempfile from copy import copy import pytest import json from sacred.observers.file_storage import FileStorageObserver from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics T1 = datetime.datetime(1999, 5, 4, 3, 2, 1, 0) T2 = datetime.datetime(1999, 5...
'2'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_experiment.py
test_config_hook_updates_config
assert
string_literal
31
from sacred import Ingredient from mock import patch import pytest import sys from sacred.experiment import Experiment from sacred.utils import apply_backspaces_and_linefeeds, ConfigAddedError, \ SacredError def ex(): return Experiment('ator3000') def test_config_hook_updates_config(ex): @ex.config ...
'me'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_config/test_captured_functions.py
test_create_captured_function
assert
string_literal
14
import datetime import mock import random from sacred.config.captured_function import create_captured_function def test_create_captured_function(): def foo(): """my docstring""" return 42 cf = create_captured_function(foo) assert cf.__name__ ==
'foo'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_experiment.py
test_main
assert
string_literal
22
from sacred import Ingredient from mock import patch import pytest import sys from sacred.experiment import Experiment from sacred.utils import apply_backspaces_and_linefeeds, ConfigAddedError, \ SacredError def ex(): return Experiment('ator3000') def test_main(ex): @ex.main def foo(): pass ...
'foo'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_ingredients.py
test_capture_function_with_prefix
assert
string_literal
21
import os import pytest import tempfile from sacred.config import ConfigScope, ConfigDict from sacred.dependencies import Source, PackageDependency from sacred.experiment import Experiment from sacred.ingredient import Ingredient from sacred.utils import CircularDependencyError from sacred.serializer import json def ...
'bar'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_modules.py
test_experiment_run_access_subingredient
assert
string_literal
21
from sacred.config.config_scope import ConfigScope from sacred.experiment import Experiment, Ingredient def test_experiment_run_access_subingredient(): somemod = Ingredient("somemod") @somemod.config def cfg(): a = 5 b = 'foo' ex = Experiment("some_experiment", ingredients=[somemod]) ...
'foo'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_file_storage_observer.py
test_fs_observer_equality
assert
string_literal
62
import datetime import hashlib import os import tempfile from copy import copy import pytest import json from sacred.observers.file_storage import FileStorageObserver from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics T1 = datetime.datetime(1999, 5, 4, 3, 2, 1, 0) T2 = datetime.datetime(1999, 5...
'foo'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_utils.py
test_join_paths
assert
string_literal
16
import pytest from sacred.utils import (PATHCHANGE, convert_to_nested_dict, get_by_dotted_path, is_prefix, iter_path_splits, iter_prefixes, iterate_flattened, iterate_flattened_separately, join_paths, recursive_upda...
'foo'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_utils.py
test_join_paths
assert
string_literal
19
import pytest from sacred.utils import (PATHCHANGE, convert_to_nested_dict, get_by_dotted_path, is_prefix, iter_path_splits, iter_prefixes, iterate_flattened, iterate_flattened_separately, join_paths, recursive_upda...
'b.d'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_utils.py
test_rel_path
assert
string_literal
17
import pytest from sacred.utils import (PATHCHANGE, convert_to_nested_dict, get_by_dotted_path, is_prefix, iter_path_splits, iter_prefixes, iterate_flattened, iterate_flattened_separately, join_paths, recursive_upda...
'baz'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_observers/test_tinydb_reader.py
test_fetch_metadata_function_with_indices
assert
string_literal
139
from __future__ import (division, print_function, unicode_literals, absolute_import) import datetime import os import tempfile import io import pytest tinydb = pytest.importorskip("tinydb") hashfs = pytest.importorskip("hashfs") from tinydb import Query from sacred.dependencies import get_d...
'1234'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor
IDSIA/sacred
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
train
train
tests/test_host_info.py
test_host_info_decorator
assert
string_literal
15
from sacred.host_info import (get_host_info, host_info_getter, host_info_gatherers) def test_host_info_decorator(): try: assert 'greeting' not in host_info_gatherers @host_info_getter def greeting(): return "hello" assert 'greeting' in hos...
'hello'
2b1e7562ba006f32e2b8a1024032b78592db2e4e
180
v2_extractor_at_anchor