repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
omni-us/jsonargparse | from __future__ import annotations
import asyncio
import json
import os
import sys
from contextlib import contextmanager, redirect_stderr, redirect_stdout, suppress
from dataclasses import asdict, dataclass
from inspect import getmodule as inspect_getmodule
from io import StringIO
from pathlib import Path
from types i... | {} | assert | collection | jsonargparse_tests/test_cli.py | test_dataclass_without_methods_parser_groups | 451 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import pickle
import random
import sys
import time
import uuid
from calendar import Calendar, TextCalendar
from collections import OrderedDict
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
from types import MappingProxyType
from t... | [] | assert | collection | jsonargparse_tests/test_typehints.py | test_get_all_subclass_paths_import_error | 1,628 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import warnings
from pathlib import Path
from unittest.mock import patch
import pytest
from jsonargparse import (
SUPPRESS,
ArgumentError,
ArgumentParser,
Namespace,
)
from jsonargparse_tests.conftest import (
get_parse_args_stderr,
get... | "b" | assert | string_literal | jsonargparse_tests/test_subcommands.py | test_subcommands_parse_args_basics | 94 | null | |
omni-us/jsonargparse | from __future__ import annotations # keep
import dataclasses
import os
import sys
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import docstring_parser_support
from jsonargparse._parameter_resolvers import get... | logs.getvalue() | assert | func_call | jsonargparse_tests/test_postponed_annotations.py | test_evaluate_postponed_annotations_all_types_fail | 95 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pathlib
import stat
import zipfile
from calendar import Calendar
from io import StringIO
from typing import Any, Dict, List, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentError, Namespace, set_parsing_set... | file_r | assert | variable | jsonargparse_tests/test_paths.py | test_pathlib_path | 46 | null | |
omni-us/jsonargparse | from __future__ import annotations
import ast
import inspect
import sys
from calendar import Calendar, TextCalendar
from contextlib import contextmanager
from email.headerregistry import DateHeader
from importlib.util import find_spec
from ipaddress import ip_network
from random import Random, SystemRandom, uniform
fr... | help_str | assert | variable | jsonargparse_tests/test_stubs_resolver.py | test_get_params_complex_function_requests_get | 293 | null | |
omni-us/jsonargparse | from __future__ import annotations
from pathlib import Path
import pytest
from jsonargparse import (
SUPPRESS,
ActionFail,
ActionParser,
ActionYesNo,
ArgumentError,
ArgumentParser,
Namespace,
)
from jsonargparse_tests.conftest import get_parser_help, json_or_yaml_dump
def test_action_con... | cfg.val | assert | complex_expr | jsonargparse_tests/test_actions.py | test_action_config_file | 32 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import math
import multiprocessing
import os
import sys
from dataclasses import dataclass
from pathlib import Path
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, Namespace
from jsonargparse._common import parser_context, set_parsi... | "Y" | assert | string_literal | jsonargparse_tests/test_omegaconf.py | test_omegaconf_global_path_preserve_relative | 182 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import pickle
import random
import sys
import time
import uuid
from calendar import Calendar, TextCalendar
from collections import OrderedDict
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
from types import MappingProxyType
from t... | "{}" | assert | string_literal | jsonargparse_tests/test_typehints.py | test_dump_skip_default | 1,597 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import textwrap
import warnings
from calendar import Calendar, HTMLCalendar, TextCalendar
from copy import deepcopy
from dataclasses import dataclass
from gzip import GzipFile
from pathlib import Path
from typing import Any, Dict, Iterable, List, Mapping, Option... | 1 | assert | numeric_literal | jsonargparse_tests/test_subclasses.py | test_custom_instantiation_replace | 494 | null | |
omni-us/jsonargparse | from __future__ import annotations # keep
import dataclasses
import os
import sys
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import docstring_parser_support
from jsonargparse._parameter_resolvers import get... | str(types["p1"]) | assert | func_call | jsonargparse_tests/test_postponed_annotations.py | test_get_types_undefined_type | 75 | null | |
omni-us/jsonargparse | from __future__ import annotations
from typing import List
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import attrs_support
from jsonargparse_tests.conftest import get_parser_help
class TestAttrs:
def test_field_init_false(self, parser):
parser.add_argument("--data", t... | help_str | assert | variable | jsonargparse_tests/test_attrs.py | test_field_init_false | TestAttrs | 76 | null |
omni-us/jsonargparse | import inspect
import pytest
from jsonargparse import FromConfigMixin
from jsonargparse._paths import PathError
from jsonargparse_tests.conftest import json_or_yaml_dump, skip_if_no_pyyaml, skip_if_omegaconf_unavailable
@skip_if_omegaconf_unavailable
def test_init_defaults_override_parser_kwargs(tmp_cwd):
config... | "hi there" | assert | string_literal | jsonargparse_tests/test_from_config.py | test_init_defaults_override_parser_kwargs | 160 | null | |
omni-us/jsonargparse | from __future__ import annotations
import argparse
import platform
import pytest
from jsonargparse import Namespace
from jsonargparse._namespace import NSKeyError, meta_keys
skip_if_no_setattr_insertion_order = pytest.mark.skipif(
platform.python_implementation() != "CPython",
reason="requires __setattr__ i... | 1 | assert | numeric_literal | jsonargparse_tests/test_namespace.py | test_shallow_clashing_keys | 240 | null | |
omni-us/jsonargparse | from __future__ import annotations
from typing import List
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import attrs_support
from jsonargparse_tests.conftest import get_parser_help
class TestAttrs:
def test_field_init_false(self, parser):
parser.add_argument("--data", t... | {} | assert | collection | jsonargparse_tests/test_attrs.py | test_field_init_false | TestAttrs | 79 | null |
omni-us/jsonargparse | from __future__ import annotations
import dataclasses
import json
import sys
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from unittest.mock import patch
import pytest
from jsonargparse import (
ArgumentError,
ArgumentParser,
Namespace,
set_parsing_settings,
)
from jso... | [] | assert | collection | jsonargparse_tests/test_dataclasses.py | test_dataclass_field_init_false | 294 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import pickle
import random
import sys
import time
import uuid
from calendar import Calendar, TextCalendar
from collections import OrderedDict
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
from types import MappingProxyType
from t... | val | assert | variable | jsonargparse_tests/test_typehints.py | test_str_edge_cases | 119 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import math
import multiprocessing
import os
import sys
from dataclasses import dataclass
from pathlib import Path
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, Namespace
from jsonargparse._common import parser_context, set_parsi... | float("inf") | assert | func_call | jsonargparse_tests/test_omegaconf.py | test_omegaconf_inf_nan | 204 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import re
from pathlib import Path
import pytest
from jsonargparse import (
ActionJsonnet,
ActionJsonSchema,
ArgumentError,
ArgumentParser,
)
from jsonargparse._optionals import jsonnet_support, pyyaml_available
from jsonargparse_tests.conftest import (
... | len(cfg.records) | assert | func_call | jsonargparse_tests/test_jsonnet.py | test_parser_mode_jsonnet | 90 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
from calendar import Calendar, TextCalendar
from dataclasses import dataclass
from importlib.util import find_spec
from typing import Any, Callable, List, Mapping, Optional, Union
import pytest
from jsonargparse import (
ArgumentError,
ArgumentParser,
Namesp... | 2 | assert | numeric_literal | jsonargparse_tests/test_link_arguments.py | test_on_parse_subclass_target_in_list | 261 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import textwrap
import warnings
from calendar import Calendar, HTMLCalendar, TextCalendar
from copy import deepcopy
from dataclasses import dataclass
from gzip import GzipFile
from pathlib import Path
from typing import Any, Dict, Iterable, List, Mapping, Option... | None | assert | none_literal | jsonargparse_tests/test_subclasses.py | test_subclass_basics | 50 | null | |
omni-us/jsonargparse | from __future__ import annotations
import inspect
import pickle
import random
import uuid
from datetime import datetime, timedelta
from decimal import Decimal
from typing import List, Optional, Union
import pytest
from jsonargparse import ArgumentError
from jsonargparse.typing import (
ClosedUnitInterval,
Em... | NewEmail | assert | variable | jsonargparse_tests/test_typing.py | test_restricted_string_already_registered | 235 | null | |
omni-us/jsonargparse | from __future__ import annotations
import inspect
import pickle
import random
import uuid
from datetime import datetime, timedelta
from decimal import Decimal
from typing import List, Optional, Union
import pytest
from jsonargparse import ArgumentError
from jsonargparse.typing import (
ClosedUnitInterval,
Em... | id1 | assert | variable | jsonargparse_tests/test_typing.py | test_uuid | 413 | null | |
omni-us/jsonargparse | from __future__ import annotations
import dataclasses
import json
import sys
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from unittest.mock import patch
import pytest
from jsonargparse import (
ArgumentError,
ArgumentParser,
Namespace,
set_parsing_settings,
)
from jso... | False | assert | bool_literal | jsonargparse_tests/test_dataclasses.py | test_nested_dataclass_field_init_false | 320 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import pickle
import random
import sys
import time
import uuid
from calendar import Calendar, TextCalendar
from collections import OrderedDict
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
from types import MappingProxyType
from t... | True | assert | bool_literal | jsonargparse_tests/test_typehints.py | test_lazy_instance_init_postponed | 1,499 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pickle
import sys
from calendar import Calendar
from contextlib import redirect_stderr
from io import StringIO
from pathlib import Path
from random import randint, shuffle
from typing import Union
from unittest.mock import patch
import pytest
from jsona... | "v2" | assert | string_literal | jsonargparse_tests/test_core.py | test_parse_args_choices_config | 178 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import sys
from pathlib import Path
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from unittest.mock import patch
import pytest
from jsonargparse import (
ActionParser,
ArgumentError,
Namespace,
lazy_instance,
)
from jsonar... | cfg | assert | variable | jsonargparse_tests/test_signatures.py | test_add_class_without_parameters | 192 | null | |
omni-us/jsonargparse | import re
import subprocess
import tempfile
from enum import Enum
from importlib.util import find_spec
from os import PathLike
from pathlib import Path
from typing import Any, Callable, Literal, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, set_parsing_settings... | help_str | assert | variable | jsonargparse_tests/test_shtab.py | test_bash_subcommands | 439 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import sys
from pathlib import Path
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from unittest.mock import patch
import pytest
from jsonargparse import (
ActionParser,
ArgumentError,
Namespace,
lazy_instance,
)
from jsonar... | "cmd" | assert | string_literal | jsonargparse_tests/test_signatures.py | test_add_class_in_subcommand | 356 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pathlib
import stat
import zipfile
from calendar import Calendar
from io import StringIO
from typing import Any, Dict, List, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentError, Namespace, set_parsing_set... | dir2 | assert | variable | jsonargparse_tests/test_paths.py | test_relative_path_context_fsspec | 427 | null | |
omni-us/jsonargparse | import inspect
import pytest
from jsonargparse import FromConfigMixin
from jsonargparse._paths import PathError
from jsonargparse_tests.conftest import json_or_yaml_dump, skip_if_no_pyyaml, skip_if_omegaconf_unavailable
def test_init_defaults_override_keyword_only_parameters(tmp_cwd):
config_path = tmp_cwd / "co... | 1 | assert | numeric_literal | jsonargparse_tests/test_from_config.py | test_init_defaults_override_keyword_only_parameters | 79 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import re
from pathlib import Path
import pytest
from jsonargparse import (
ActionJsonnet,
ActionJsonSchema,
ArgumentError,
ArgumentParser,
)
from jsonargparse._optionals import jsonnet_support, pyyaml_available
from jsonargparse_tests.conftest import (
... | 80 | assert | numeric_literal | jsonargparse_tests/test_jsonnet.py | test_parser_mode_jsonnet_import_libsonnet | 111 | null | |
omni-us/jsonargparse | from __future__ import annotations
import ast
import inspect
import sys
from calendar import Calendar, TextCalendar
from contextlib import contextmanager
from email.headerregistry import DateHeader
from importlib.util import find_spec
from ipaddress import ip_network
from random import Random, SystemRandom, uniform
fr... | logs.getvalue() | assert | func_call | jsonargparse_tests/test_stubs_resolver.py | test_get_params_non_unique_alias | 257 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pickle
import sys
from calendar import Calendar
from contextlib import redirect_stderr
from io import StringIO
from pathlib import Path
from random import randint, shuffle
from typing import Union
from unittest.mock import patch
import pytest
from jsona... | cfg3 | assert | variable | jsonargparse_tests/test_core.py | test_save_multifile | 733 | null | |
omni-us/jsonargparse | from __future__ import annotations
import logging
import os
from calendar import Calendar
from importlib import import_module
from random import Random
from unittest.mock import patch
import pytest
from jsonargparse import (
ArgumentParser,
Namespace,
capture_parser,
class_from_function,
)
from jsona... | help_str | assert | variable | jsonargparse_tests/test_util.py | test_add_class_from_function_arguments | 286 | null | |
omni-us/jsonargparse | from __future__ import annotations # keep
import dataclasses
import os
import sys
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import docstring_parser_support
from jsonargparse._parameter_resolvers import get... | expected | assert | variable | jsonargparse_tests/test_postponed_annotations.py | test_get_types_methods | 55 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
from calendar import Calendar, TextCalendar
from dataclasses import dataclass
from importlib.util import find_spec
from typing import Any, Callable, List, Mapping, Optional, Union
import pytest
from jsonargparse import (
ArgumentError,
ArgumentParser,
Namesp... | 16 | assert | numeric_literal | jsonargparse_tests/test_link_arguments.py | test_on_instantiate_within_deep_subclass | 846 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import re
from pathlib import Path
import pytest
from jsonargparse import (
ActionJsonnet,
ActionJsonSchema,
ArgumentError,
ArgumentParser,
)
from jsonargparse._optionals import jsonnet_support, pyyaml_available
from jsonargparse_tests.conftest import (
... | str(config_path) | assert | func_call | jsonargparse_tests/test_jsonnet.py | test_parser_mode_jsonnet_import_libsonnet | 112 | null | |
omni-us/jsonargparse | from __future__ import annotations # keep
import dataclasses
import os
import sys
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import docstring_parser_support
from jsonargparse._parameter_resolvers import get... | ["p1"] | assert | collection | jsonargparse_tests/test_postponed_annotations.py | test_get_types_type_checking_list | 222 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pathlib
import stat
import zipfile
from calendar import Calendar
from io import StringIO
from typing import Any, Dict, List, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentError, Namespace, set_parsing_set... | Path | assert | variable | jsonargparse_tests/test_paths.py | test_import_old_path_location | 752 | null | |
omni-us/jsonargparse | import inspect
import pytest
from jsonargparse import FromConfigMixin
from jsonargparse._paths import PathError
from jsonargparse_tests.conftest import json_or_yaml_dump, skip_if_no_pyyaml, skip_if_omegaconf_unavailable
def test_init_defaults_override_keyword_only_parameters(tmp_cwd):
config_path = tmp_cwd / "co... | 2 | assert | numeric_literal | jsonargparse_tests/test_from_config.py | test_init_defaults_override_keyword_only_parameters | 81 | null | |
omni-us/jsonargparse | from __future__ import annotations
import dataclasses
import os
import pathlib
from calendar import Calendar
from contextlib import contextmanager, redirect_stderr, redirect_stdout
from enum import Enum
from importlib import import_module
from io import StringIO
from warnings import catch_warnings
import pytest
from... | w) | assert_* | variable | jsonargparse_tests/test_deprecated.py | test_ActionEnum | 119 | null | |
omni-us/jsonargparse | from __future__ import annotations
import dataclasses
import json
import sys
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from unittest.mock import patch
import pytest
from jsonargparse import (
ArgumentError,
ArgumentParser,
Namespace,
set_parsing_settings,
)
from jso... | value | assert | variable | jsonargparse_tests/test_dataclasses.py | test_class_path_union_mixture_dataclass_and_class | 651 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
from calendar import Calendar, TextCalendar
from dataclasses import dataclass
from importlib.util import find_spec
from typing import Any, Callable, List, Mapping, Optional, Union
import pytest
from jsonargparse import (
ArgumentError,
ArgumentParser,
Namesp... | 7 | assert | numeric_literal | jsonargparse_tests/test_link_arguments.py | test_on_instantiate_link_all_group_arguments | 598 | null | |
omni-us/jsonargparse | from __future__ import annotations # keep
import dataclasses
import os
import sys
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import docstring_parser_support
from jsonargparse._parameter_resolvers import get... | globals() | assert | func_call | jsonargparse_tests/test_postponed_annotations.py | test_get_params_dataclass_inherit_different_module | 342 | null | |
omni-us/jsonargparse | from __future__ import annotations
from typing import List
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import attrs_support
from jsonargparse_tests.conftest import get_parser_help
class TestAttrs:
def test_field_factory(self, parser):
parser.add_argument("--data", type... | cfg2.data.p1 | assert | complex_expr | jsonargparse_tests/test_attrs.py | test_field_factory | TestAttrs | 69 | null |
omni-us/jsonargparse | from __future__ import annotations
import json
from calendar import Calendar, TextCalendar
from dataclasses import dataclass
from importlib.util import find_spec
from typing import Any, Callable, List, Mapping, Optional, Union
import pytest
from jsonargparse import (
ArgumentError,
ArgumentParser,
Namesp... | 1 | assert | numeric_literal | jsonargparse_tests/test_link_arguments.py | test_on_parse_subclass_target_in_list | 258 | null | |
omni-us/jsonargparse | from __future__ import annotations
import dataclasses
import json
from copy import deepcopy
from typing import Dict, List, Literal, Optional, Union
import pytest
from jsonargparse import ArgumentError, ArgumentParser, Namespace, set_parsing_settings
from jsonargparse._optionals import (
docstring_parser_support,... | help_str | assert | variable | jsonargparse_tests/test_pydantic.py | test_field_description | TestPydanticBasics | 236 | null |
omni-us/jsonargparse | from __future__ import annotations
import json
import math
import multiprocessing
import os
import sys
from dataclasses import dataclass
from pathlib import Path
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, Namespace
from jsonargparse._common import parser_context, set_parsi... | expected | assert | variable | jsonargparse_tests/test_omegaconf.py | test_omegaconf_absolute_to_relative_paths | 226 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
from dataclasses import dataclass
from pathlib import Path
from typing import List
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, get_loader, set_dumper, set_loader
from jsonargparse._common import parser_context
from jsonargparse... | cfg.bar.init_args.x | assert | complex_expr | jsonargparse_tests/test_loaders_dumpers.py | test_yaml_implicit_null_disabled | 49 | null | |
omni-us/jsonargparse | from __future__ import annotations # keep
import dataclasses
import os
import sys
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union
import pytest
from jsonargparse import Namespace
from jsonargparse._optionals import docstring_parser_support
from jsonargparse._parameter_resolvers import get... | int | assert | variable | jsonargparse_tests/test_postponed_annotations.py | test_get_types_undefined_type | 73 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pickle
import sys
from calendar import Calendar
from contextlib import redirect_stderr
from io import StringIO
from pathlib import Path
from random import randint, shuffle
from typing import Union
from unittest.mock import patch
import pytest
from jsona... | 1 | assert | numeric_literal | jsonargparse_tests/test_core.py | test_parse_string_simple | 345 | null | |
omni-us/jsonargparse | from __future__ import annotations
import argparse
import platform
import pytest
from jsonargparse import Namespace
from jsonargparse._namespace import NSKeyError, meta_keys
skip_if_no_setattr_insertion_order = pytest.mark.skipif(
platform.python_implementation() != "CPython",
reason="requires __setattr__ i... | ns | assert | variable | jsonargparse_tests/test_namespace.py | test_nested_item_set_get | 47 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import sys
from pathlib import Path
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from unittest.mock import patch
import pytest
from jsonargparse import (
ActionParser,
ArgumentError,
Namespace,
lazy_instance,
)
from jsonar... | 2 | assert | numeric_literal | jsonargparse_tests/test_signatures.py | test_add_class_and_action_parser | 471 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
from dataclasses import dataclass
from pathlib import Path
from typing import List
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, get_loader, set_dumper, set_loader
from jsonargparse._common import parser_context
from jsonargparse... | '{"int":1}' | assert | string_literal | jsonargparse_tests/test_loaders_dumpers.py | test_dump_header_json | 85 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pickle
import sys
from calendar import Calendar
from contextlib import redirect_stderr
from io import StringIO
from pathlib import Path
from random import randint, shuffle
from typing import Union
from unittest.mock import patch
import pytest
from jsona... | 1.2 | assert | numeric_literal | jsonargparse_tests/test_core.py | test_set_get_default_suppress_default_config_file | 1,078 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pathlib
import stat
import zipfile
from calendar import Calendar
from io import StringIO
from typing import Any, Dict, List, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentError, Namespace, set_parsing_set... | dir1 | assert | variable | jsonargparse_tests/test_paths.py | test_relative_path_context_fsspec | 411 | null | |
omni-us/jsonargparse | from __future__ import annotations
import dataclasses
import json
from copy import deepcopy
from typing import Dict, List, Literal, Optional, Union
import pytest
from jsonargparse import ArgumentError, ArgumentParser, Namespace, set_parsing_settings
from jsonargparse._optionals import (
docstring_parser_support,... | "-" | assert | string_literal | jsonargparse_tests/test_pydantic.py | test_dataclass_field_init_false | TestPydanticBasics | 277 | null |
omni-us/jsonargparse | from __future__ import annotations
import dataclasses
import json
from copy import deepcopy
from typing import Dict, List, Literal, Optional, Union
import pytest
from jsonargparse import ArgumentError, ArgumentParser, Namespace, set_parsing_settings
from jsonargparse._optionals import (
docstring_parser_support,... | cfg.model | assert | complex_expr | jsonargparse_tests/test_pydantic.py | test_basemodel | TestPydanticBasics | 214 | null |
omni-us/jsonargparse | from __future__ import annotations
import json
import os
import pickle
import sys
from calendar import Calendar
from contextlib import redirect_stderr
from io import StringIO
from pathlib import Path
from random import randint, shuffle
from typing import Union
from unittest.mock import patch
import pytest
from jsona... | 2.1 | assert | numeric_literal | jsonargparse_tests/test_core.py | test_parse_args_nested | 77 | null | |
omni-us/jsonargparse | import inspect
import pytest
from jsonargparse import FromConfigMixin
from jsonargparse._paths import PathError
from jsonargparse_tests.conftest import json_or_yaml_dump, skip_if_no_pyyaml, skip_if_omegaconf_unavailable
@skip_if_omegaconf_unavailable
def test_init_defaults_override_parser_kwargs(tmp_cwd):
config... | "there" | assert | string_literal | jsonargparse_tests/test_from_config.py | test_init_defaults_override_parser_kwargs | 159 | null | |
omni-us/jsonargparse | from __future__ import annotations
import asyncio
import json
import os
import sys
from contextlib import contextmanager, redirect_stderr, redirect_stdout, suppress
from dataclasses import asdict, dataclass
from inspect import getmodule as inspect_getmodule
from io import StringIO
from pathlib import Path
from types i... | out | assert | variable | jsonargparse_tests/test_cli.py | test_single_function_help | 85 | null | |
omni-us/jsonargparse | from __future__ import annotations
import calendar
import inspect
import xml.dom
from calendar import Calendar
from random import shuffle
from typing import Any, Callable, Dict, List, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import Namespace, class_from_function
from jsonargpar... | ["pu"] | assert | collection | jsonargparse_tests/test_parameter_resolvers.py | test_get_params_class_from_function_classmethod_untyped | 698 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
from dataclasses import dataclass
from pathlib import Path
from typing import List
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, get_loader, set_dumper, set_loader
from jsonargparse._common import parser_context
from jsonargparse... | load_value(" - ") | assert | func_call | jsonargparse_tests/test_loaders_dumpers.py | test_load_value_dash | 97 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import math
import multiprocessing
import os
import sys
from dataclasses import dataclass
from pathlib import Path
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, Namespace
from jsonargparse._common import parser_context, set_parsi... | str(tmp_cwd / subdir) | assert | func_call | jsonargparse_tests/test_omegaconf.py | test_omegaconf_global_path_preserve_relative | 184 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
import sys
from pathlib import Path
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from unittest.mock import patch
import pytest
from jsonargparse import (
ActionParser,
ArgumentError,
Namespace,
lazy_instance,
)
from jsonar... | 1 | assert | numeric_literal | jsonargparse_tests/test_signatures.py | test_add_class_in_subcommand | 359 | null | |
omni-us/jsonargparse | from __future__ import annotations
import calendar
import inspect
import xml.dom
from calendar import Calendar
from random import shuffle
from typing import Any, Callable, Dict, List, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import Namespace, class_from_function
from jsonargpar... | ["kp1"]) | assert_* | collection | jsonargparse_tests/test_parameter_resolvers.py | test_get_params_kwargs_use_in_property | 661 | null | |
omni-us/jsonargparse | from __future__ import annotations
import inspect
import pickle
import random
import uuid
from datetime import datetime, timedelta
from decimal import Decimal
from typing import List, Optional, Union
import pytest
from jsonargparse import ArgumentError
from jsonargparse.typing import (
ClosedUnitInterval,
Em... | delta_out | assert | variable | jsonargparse_tests/test_typing.py | test_timedelta_deserializer | 272 | null | |
omni-us/jsonargparse | import re
import subprocess
import tempfile
from enum import Enum
from importlib.util import find_spec
from os import PathLike
from pathlib import Path
from typing import Any, Callable, Literal, Optional, Union
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, set_parsing_settings... | choices | assert | variable | jsonargparse_tests/test_shtab.py | assert_bash_typehint_completions | 72 | null | |
omni-us/jsonargparse | import re
from dataclasses import dataclass
from typing import Literal, Optional
from unittest.mock import patch
import pytest
from jsonargparse import ActionYesNo, ArgumentError, Namespace, set_parsing_settings
from jsonargparse._common import get_parsing_setting
from jsonargparse_tests.conftest import capture_logs,... | logs.getvalue() | assert | func_call | jsonargparse_tests/test_parsing_settings.py | test_parse_optionals_as_positionals_simple | 116 | null | |
omni-us/jsonargparse | from __future__ import annotations
import json
from dataclasses import dataclass
from pathlib import Path
from typing import List
from unittest.mock import patch
import pytest
from jsonargparse import ArgumentParser, get_loader, set_dumper, set_loader
from jsonargparse._common import parser_context
from jsonargparse... | parser.parser_mode | assert | complex_expr | jsonargparse_tests/test_loaders_dumpers.py | test_set_loader_parser_mode_subparsers | 69 | null | |
exercism/python | import unittest
from binary import parse_binary
class BinaryTest(unittest.TestCase):
def test_binary_1_is_decimal_1(self):
self.assertEqual(parse_binary("1"), | 1) | self.assertEqual | numeric_literal | exercises/practice/binary/binary_test.py | test_binary_1_is_decimal_1 | BinaryTest | 14 | null |
exercism/python | import unittest
from armstrong_numbers import (
is_armstrong_number,
)
class ArmstrongNumbersTest(unittest.TestCase):
def test_zero_is_an_armstrong_number(self):
self.assertIs(is_armstrong_number(0), | True) | self.assertIs | bool_literal | exercises/practice/armstrong-numbers/armstrong_numbers_test.py | test_zero_is_an_armstrong_number | ArmstrongNumbersTest | 14 | null |
exercism/python | import sys
import unittest
from pascals_triangle import (
rows,
)
TRIANGLE = [
[1],
[1, 1],
[1, 2, 1],
[1, 3, 3, 1],
[1, 4, 6, 4, 1],
[1, 5, 10, 10, 5, 1],
[1, 6, 15, 20, 15, 6, 1],
[1, 7, 21, 35, 35, 21, 7, 1],
[1, 8, 28, 56, 70, 56, 28, 8, 1],
[1, 9, 36, 84, 126, 126, 84,... | TRIANGLE[:2]) | self.assertEqual | complex_expr | exercises/practice/pascals-triangle/pascals_triangle_test.py | test_two_rows | PascalsTriangleTest | 34 | null |
exercism/python | import unittest
from dnd_character import (
Character,
modifier,
)
class DndCharacterTest(unittest.TestCase):
def test_ability_modifier_for_score_14_is_2(self):
self.assertEqual(modifier(14), | 2) | self.assertEqual | numeric_literal | exercises/practice/dnd-character/dnd_character_test.py | test_ability_modifier_for_score_14_is_2 | DndCharacterTest | 48 | null |
exercism/python | import unittest
from darts import (
score,
)
class DartsTest(unittest.TestCase):
def test_on_the_middle_circle(self):
self.assertEqual(score(-5, 0), | 5) | self.assertEqual | numeric_literal | exercises/practice/darts/darts_test.py | test_on_the_middle_circle | DartsTest | 20 | null |
exercism/python | import unittest
from robot_simulator import (
Robot,
NORTH,
EAST,
SOUTH,
WEST,
)
class RobotSimulatorTest(unittest.TestCase):
def test_at_origin_facing_north(self):
robot = Robot(NORTH, 0, 0)
self.assertEqual(robot.coordinates, (0, 0))
self.assertEqual(robot.directio... | NORTH) | self.assertEqual | variable | exercises/practice/robot-simulator/robot_simulator_test.py | test_at_origin_facing_north | RobotSimulatorTest | 23 | null |
exercism/python | import unittest
from forth import (
evaluate,
StackUnderflowError,
)
class ForthTest(unittest.TestCase):
def test_user_defined_words_can_define_word_that_uses_word_with_the_same_name(self):
self.assertEqual(evaluate([": foo 10 ;", ": foo foo 1 + ;", "foo"]), | [11]) | self.assertEqual | collection | exercises/practice/forth/forth_test.py | test_user_defined_words_can_define_word_that_uses_word_with_the_same_name | ForthTest | 228 | null |
exercism/python | import sys
import unittest
from pascals_triangle import (
rows,
)
TRIANGLE = [
[1],
[1, 1],
[1, 2, 1],
[1, 3, 3, 1],
[1, 4, 6, 4, 1],
[1, 5, 10, 10, 5, 1],
[1, 6, 15, 20, 15, 6, 1],
[1, 7, 21, 35, 35, 21, 7, 1],
[1, 8, 28, 56, 70, 56, 28, 8, 1],
[1, 9, 36, 84, 126, 126, 84,... | TRIANGLE[:0]) | self.assertEqual | complex_expr | exercises/practice/pascals-triangle/pascals_triangle_test.py | test_zero_rows | PascalsTriangleTest | 28 | null |
exercism/python | import unittest
from binary_search import (
find,
)
class BinarySearchTest(unittest.TestCase):
def test_finds_a_value_in_an_array_with_one_element(self):
self.assertEqual(find([6], 6), | 0) | self.assertEqual | numeric_literal | exercises/practice/binary-search/binary_search_test.py | test_finds_a_value_in_an_array_with_one_element | BinarySearchTest | 15 | null |
exercism/python | import unittest
from atbash_cipher import (
decode,
encode,
)
class AtbashCipherTest(unittest.TestCase):
def test_encode_no(self):
self.assertEqual(encode("no"), | "ml") | self.assertEqual | string_literal | exercises/practice/atbash-cipher/atbash_cipher_test.py | test_encode_no | AtbashCipherTest | 18 | null |
exercism/python | import unittest
from binary import parse_binary
class BinaryTest(unittest.TestCase):
def test_binary_1001_is_decimal_9(self):
self.assertEqual(parse_binary("1001"), | 9) | self.assertEqual | numeric_literal | exercises/practice/binary/binary_test.py | test_binary_1001_is_decimal_9 | BinaryTest | 26 | null |
exercism/python | import unittest
from connect import (
ConnectGame,
)
class ConnectTest(unittest.TestCase):
def test_o_can_win_on_a_1x1_board(self):
game = ConnectGame("""O""")
winner = game.get_winner()
self.assertEqual(winner, | "O") | self.assertEqual | string_literal | exercises/practice/connect/connect_test.py | test_o_can_win_on_a_1x1_board | ConnectTest | 33 | null |
exercism/python | import unittest
from raindrops import (
convert,
)
class RaindropsTest(unittest.TestCase):
def test_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base(
self,
):
self.assertEqual(convert(8), | "8") | self.assertEqual | string_literal | exercises/practice/raindrops/raindrops_test.py | test_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base | RaindropsTest | 31 | null |
exercism/python | import unittest
from all_your_base import (
rebase,
)
class AllYourBaseTest(unittest.TestCase):
def test_binary_to_single_decimal(self):
self.assertEqual(rebase(2, [1, 0, 1], 10), | [5]) | self.assertEqual | collection | exercises/practice/all-your-base/all_your_base_test.py | test_binary_to_single_decimal | AllYourBaseTest | 17 | null |
exercism/python | import unittest
from bank_account import (
BankAccount,
)
class BankAccountTest(unittest.TestCase):
def test_newly_opened_account_has_zero_balance(self):
account = BankAccount()
account.open()
self.assertEqual(account.get_balance(), | 0) | self.assertEqual | numeric_literal | exercises/practice/bank-account/bank_account_test.py | test_newly_opened_account_has_zero_balance | BankAccountTest | 16 | null |
exercism/python | import math
import unittest
from complex_numbers import (
ComplexNumber,
)
class ComplexNumbersTest(unittest.TestCase):
def test_absolute_value_of_a_positive_purely_real_number(self):
self.assertEqual(abs(ComplexNumber(5, 0)), | 5) | self.assertEqual | numeric_literal | exercises/practice/complex-numbers/complex_numbers_test.py | test_absolute_value_of_a_positive_purely_real_number | ComplexNumbersTest | 107 | null |
exercism/python | import unittest
from allergies import (
Allergies,
)
class AllergiesTest(unittest.TestCase):
def test_no_allergies(self):
self.assertEqual(Allergies(0).lst, | []) | self.assertEqual | collection | exercises/practice/allergies/allergies_test.py | test_no_allergies | AllergiesTest | 134 | null |
exercism/python | import unittest
from roman_numerals import (
roman,
)
class RomanNumeralsTest(unittest.TestCase):
def test_3_is_iii(self):
self.assertEqual(roman(3), | "III") | self.assertEqual | string_literal | exercises/practice/roman-numerals/roman_numerals_test.py | test_3_is_iii | RomanNumeralsTest | 20 | null |
exercism/python | import unittest
from robot_simulator import (
Robot,
NORTH,
EAST,
SOUTH,
WEST,
)
class RobotSimulatorTest(unittest.TestCase):
def test_changes_north_to_east(self):
robot = Robot(NORTH, 0, 0)
robot.move("R")
self.assertEqual(robot.coordinates, (0, 0))
self.ass... | EAST) | self.assertEqual | variable | exercises/practice/robot-simulator/robot_simulator_test.py | test_changes_north_to_east | RobotSimulatorTest | 37 | null |
exercism/python | import unittest
from darts import (
score,
)
class DartsTest(unittest.TestCase):
def test_on_the_outer_circle(self):
self.assertEqual(score(0, 10), | 1) | self.assertEqual | numeric_literal | exercises/practice/darts/darts_test.py | test_on_the_outer_circle | DartsTest | 17 | null |
exercism/python | import unittest
import hangman
from hangman import Hangman
class HangmanTests(unittest.TestCase):
def test_initially_no_letters_are_guessed(self):
game = Hangman('foo')
self.assertEqual(game.get_masked_word(), | '___') | self.assertEqual | string_literal | exercises/practice/hangman/hangman_test.py | test_initially_no_letters_are_guessed | HangmanTests | 18 | null |
exercism/python | import unittest
from custom_set import (
CustomSet,
)
class CustomSetTest(unittest.TestCase):
def test_nothing_is_contained_in_an_empty_set(self):
sut = CustomSet()
self.assertNotIn(1, | sut) | self.assertNotIn | variable | exercises/practice/custom-set/custom_set_test.py | test_nothing_is_contained_in_an_empty_set | CustomSetTest | 23 | null |
exercism/python | import unittest
from rational_numbers import (
Rational,
)
class RationalNumbersTest(unittest.TestCase):
def test_subtract_two_negative_rational_numbers(self):
self.assertEqual(Rational(-1, 2) - Rational(-2, 3), | Rational(1, 6)) | self.assertEqual | func_call | exercises/practice/rational-numbers/rational_numbers_test.py | test_subtract_two_negative_rational_numbers | RationalNumbersTest | 39 | null |
exercism/python | import unittest
from go_counting import (
Board,
WHITE,
BLACK,
NONE,
)
class GoCountingTest(unittest.TestCase):
def test_white_center_territory_on_5x5_board(self):
board = Board([" B ", " B B ", "B W B", " W W ", " W "])
stone, territory = board.territory(x=2, y=3)
se... | WHITE) | self.assertEqual | variable | exercises/practice/go-counting/go_counting_test.py | test_white_center_territory_on_5x5_board | GoCountingTest | 26 | null |
exercism/python | import unittest
from darts import (
score,
)
class DartsTest(unittest.TestCase):
def test_missed_target(self):
self.assertEqual(score(-9, 9), | 0) | self.assertEqual | numeric_literal | exercises/practice/darts/darts_test.py | test_missed_target | DartsTest | 14 | null |
exercism/python | import unittest
from robot_simulator import (
Robot,
NORTH,
EAST,
SOUTH,
WEST,
)
class RobotSimulatorTest(unittest.TestCase):
def test_changes_south_to_west(self):
robot = Robot(SOUTH, 0, 0)
robot.move("R")
self.assertEqual(robot.coordinates, (0, 0))
self.ass... | WEST) | self.assertEqual | variable | exercises/practice/robot-simulator/robot_simulator_test.py | test_changes_south_to_west | RobotSimulatorTest | 51 | null |
exercism/python | import unittest
from rna_transcription import (
to_rna,
)
class RnaTranscriptionTest(unittest.TestCase):
def test_rna_complement_of_guanine_is_cytosine(self):
self.assertEqual(to_rna("G"), | "C") | self.assertEqual | string_literal | exercises/practice/rna-transcription/rna_transcription_test.py | test_rna_complement_of_guanine_is_cytosine | RnaTranscriptionTest | 20 | null |
exercism/python | import unittest
from rotational_cipher import (
rotate,
)
class RotationalCipherTest(unittest.TestCase):
def test_rotate_a_by_0_same_output_as_input(self):
self.assertEqual(rotate("a", 0), | "a") | self.assertEqual | string_literal | exercises/practice/rotational-cipher/rotational_cipher_test.py | test_rotate_a_by_0_same_output_as_input | RotationalCipherTest | 15 | null |
exercism/python | import unittest
from acronym import (
abbreviate,
)
class AcronymTest(unittest.TestCase):
def test_basic(self):
self.assertEqual(abbreviate("Portable Network Graphics"), | "PNG") | self.assertEqual | string_literal | exercises/practice/acronym/acronym_test.py | test_basic | AcronymTest | 15 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.