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 |
|---|---|---|---|---|---|---|---|---|---|
datmo/datmo | import os
import glob
import time
import pytest
import uuid
import tempfile
import shutil
import platform
from argparse import ArgumentError
from datmo.cli.driver.helper import Helper
from datmo.cli.command.environment import EnvironmentCommand
from datmo.cli.command.project import ProjectCommand
from datmo.core.util.... | SystemExit | assert | variable | datmo/cli/command/tests/test_environment.py | test_environment_setup_prompt | TestEnvironmentCommand | 188 | null |
datmo/datmo | import os
import glob
import time
import tempfile
import platform
from argparse import ArgumentError
from io import open
from datmo.config import Config
from datmo.cli.driver.helper import Helper
from datmo.cli.command.project import ProjectCommand
from datmo.cli.command.run import RunCommand
from datmo.core.entity.r... | test_command | assert | variable | datmo/cli/command/tests/test_run.py | test_run | TestRunCommand | 124 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.util.exceptions import EntityNotFound, InvalidArgu... | test_model_input_dict['id'] | assert | complex_expr | datmo/core/storage/local/tests/test_dal_model.py | test_create_model_by_dictionary | TestLocalDAL | 50 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.snapshot import Snapshot
from datmo.core.util.exceptions import EntityNotFound, InvalidA... | snapshot.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_snapshot.py | test_create_snapshot_by_dictionary | TestLocalDAL | 67 | null |
datmo/datmo | import os
import glob
import time
import pytest
import uuid
import tempfile
import shutil
import platform
from argparse import ArgumentError
from datmo.cli.driver.helper import Helper
from datmo.cli.command.environment import EnvironmentCommand
from datmo.cli.command.project import ProjectCommand
from datmo.core.util.... | "test" | assert | string_literal | datmo/cli/command/tests/test_environment.py | test_environment_create | TestEnvironmentCommand | 238 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.file_collection import FileCollection
from datmo.core.util... | set(ids) | assert | func_call | datmo/core/storage/local/tests/test_dal_file_collection.py | test_query_file_collections_multiple | TestLocalDAL | 188 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.environment import Environment
from datmo.core.util.except... | environment_1.created_at | assert | complex_expr | datmo/core/storage/local/tests/test_dal_environment.py | test_query_environments_multiple | TestLocalDAL | 158 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.task import Task
from datmo.core.util.exceptions import En... | set(ids) | assert | func_call | datmo/core/storage/local/tests/test_dal_task.py | test_sort_tasks | TestLocalDAL | 239 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.config import Config
from datmo.core.controller.base import BaseController
from datmo.core.controller.project import ProjectController
from datmo.core.controller.code.driver.file import FileCodeDriver
from datmo.core.controller.file.driver.local import LocalFileDriv... | os.getcwd() | assert | func_call | datmo/core/controller/tests/test_base.py | test_instantiation_with_home | TestBaseController | 45 | null |
datmo/datmo | import os
import tempfile
import datetime
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.util.exceptions import EntityNotFound, InvalidArgumentType, \
RequiredArgumentMissing
from datmo.core.util.misc_functions import create_unique_hash
class TestBlitzDBD... | 4 | assert | numeric_literal | datmo/core/storage/driver/tests/test_blitzdb_dal_driver.py | test_db_set_multiple_objs | TestBlitzDBDALDriver | 86 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.environment import Environment
from datmo.core.util.except... | result.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_environment.py | test_get_by_id_environment | TestLocalDAL | 85 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.util.exceptions import EntityNotFound, InvalidArgu... | model_2.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_model.py | test_create_model_by_dictionary | TestLocalDAL | 45 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.snapshot import Snapshot
from datmo.core.util.exceptions import EntityNotFound, InvalidA... | snapshot_1.created_at | assert | complex_expr | datmo/core/storage/local/tests/test_dal_snapshot.py | test_sort_snapshots | TestLocalDAL | 164 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.snapshot import SnapshotController
from datmo.core.util.exceptions import CommitDoesNotExist
class TestSnapshotController():
def setup_method(self):
... | {} | assert | collection | datmo/core/controller/tests/test_snapshot_private.py | test_config_setup_with_empty_no_file | TestSnapshotController | 143 | null |
datmo/datmo | import os
import tempfile
import platform
import time
import timeout_decorator
from io import open
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.snapshot import SnapshotController
from datmo.core.controller.environment.environment import Environm... | "test4" | assert | string_literal | datmo/core/controller/tests/test_project.py | test_status_snapshot_task | TestProjectController | 250 | null |
datmo/datmo | import os
import tempfile
import datetime
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.util.exceptions import EntityNotFound, InvalidArgumentType, \
RequiredArgumentMissing
from datmo.core.util.misc_functions import create_unique_hash
class TestBlitzDBD... | 9 | assert | numeric_literal | datmo/core/storage/driver/tests/test_blitzdb_dal_driver.py | test_db_query_all | TestBlitzDBDALDriver | 129 | null |
datmo/datmo | import os
import time
import shutil
import tempfile
import platform
from io import open
from datmo.core.controller.code.driver.file import FileCodeDriver
from datmo.core.util.exceptions import PathDoesNotExist, FileIOError, CodeNotInitialized, UnstagedChanges, CommitDoesNotExist
class TestFileCodeDriver():
def s... | ["test2.txt"] | assert | collection | datmo/core/controller/code/driver/tests/test_file.py | test_tracked_files | TestFileCodeDriver | 125 | null |
datmo/datmo | import os
import time
import shutil
import tempfile
import platform
from io import open
from datmo.core.controller.code.driver.file import FileCodeDriver
from datmo.core.util.exceptions import PathDoesNotExist, FileIOError, CodeNotInitialized, UnstagedChanges, CommitDoesNotExist
class TestFileCodeDriver():
def s... | ["test.txt"] | assert | collection | datmo/core/controller/code/driver/tests/test_file.py | test_tracked_files | TestFileCodeDriver | 92 | null |
datmo/datmo | import os
import tempfile
import platform
import timeout_decorator
from datmo.config import Config
from datmo import __version__
from datmo.cli.driver.helper import Helper
from datmo.cli.command.project import ProjectCommand
from datmo.cli.command.snapshot import SnapshotCommand
from datmo.core.entity.snapshot import ... | new_snapshot | assert | variable | datmo/cli/command/tests/test_project.py | test_status_autogenerated_snapshot | TestProjectCommand | 434 | null |
datmo/datmo | import os
import tempfile
import platform
from io import open, TextIOWrapper
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import EnvironmentController
from datmo.core.controller.task import TaskController
from datmo.core.... | 1 | assert | numeric_literal | datmo/core/controller/tests/test_snapshot.py | test_get_files | TestSnapshotController | 876 | null |
datmo/datmo | import os
import time
import tempfile
import platform
import datetime
from pytz import timezone
from io import open
from datmo.core.util.misc_functions import (
bytes2human, create_unique_hash, mutually_exclusive, is_project_dir,
find_project_dir, grep, prettify_datetime, format_table,
parse_cli_key_value,... | '9.8K' | assert | string_literal | datmo/core/util/tests/test_misc_functions.py | test_bytes2human | TestMiscFunctions | 114 | null |
datmo/datmo | import os
import time
import shutil
import tempfile
import platform
from io import open
from datmo.core.controller.code.driver.file import FileCodeDriver
from datmo.core.util.exceptions import PathDoesNotExist, FileIOError, CodeNotInitialized, UnstagedChanges, CommitDoesNotExist
class TestFileCodeDriver():
def s... | current_hash | assert | variable | datmo/core/controller/code/driver/tests/test_file.py | test_current_hash | TestFileCodeDriver | 148 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.file_collection import FileCollection
from datmo.core.util... | 1 | assert | numeric_literal | datmo/core/storage/local/tests/test_dal_file_collection.py | test_query_file_collections_basic | TestLocalDAL | 139 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.snapshot import Snapshot
from datmo.core.util.exceptions import EntityNotFound, InvalidA... | updated_snapshot.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_snapshot.py | test_update_snapshot | TestLocalDAL | 113 | null |
datmo/datmo | import os
import time
import shutil
import tempfile
import platform
from io import open
from datmo.core.controller.code.driver.git import (GitCodeDriver,
GitHostDriver)
from datmo.core.util.exceptions import (CommitFailed, CommitDoesNotExist,
... | True | assert | bool_literal | datmo/core/controller/code/driver/tests/test_git.py | test_is_initialized | TestGitCodeDriver | 78 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.user import User
from datmo.core.util.exceptions import EntityNotFound, InvalidArgumentType
class T... | result.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_user.py | test_get_by_id_user | TestLocalDAL | 56 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.code import Code
from datmo.core.util.exceptions import En... | 1 | assert | numeric_literal | datmo/core/storage/local/tests/test_dal_code.py | test_query_codes | TestLocalDAL | 117 | null |
datmo/datmo | import os
import time
import tempfile
import platform
import datetime
from pytz import timezone
from io import open
from datmo.core.util.misc_functions import (
bytes2human, create_unique_hash, mutually_exclusive, is_project_dir,
find_project_dir, grep, prettify_datetime, format_table,
parse_cli_key_value,... | '95.4M' | assert | string_literal | datmo/core/util/tests/test_misc_functions.py | test_bytes2human | TestMiscFunctions | 117 | null |
datmo/datmo | import os
import uuid
import tempfile
import platform
from io import open, TextIOWrapper
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import EnvironmentController
from datmo.core.controller.task import TaskController
from... | "0.94" | assert | string_literal | datmo/core/controller/tests/test_task.py | test_parse_logs_for_results | TestTaskController | 184 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
import threading
import sys
is_py2 = sys.version[0] == '2'
import uuid
import timeout_decorator
from io import open
from datmo.core.controller.environment.driver.dockerenv import DockerEnvironmentDriver
from datmo.core.util.exceptions import (
EnvironmentIni... | True | assert | bool_literal | datmo/core/controller/environment/driver/tests/test_dockerenv.py | test_build | TestDockerEnv | 274 | null |
datmo/datmo | import os
import tempfile
import platform
import timeout_decorator
from datmo.config import Config
from datmo import __version__
from datmo.cli.driver.helper import Helper
from datmo.cli.command.project import ProjectCommand
from datmo.cli.command.snapshot import SnapshotCommand
from datmo.core.entity.snapshot import ... | result_1.id | assert | complex_expr | datmo/cli/command/tests/test_project.py | test_init_update_force_success | TestProjectCommand | 164 | null |
datmo/datmo | import os
import uuid
import threading
import tempfile
import platform
import timeout_decorator
from io import open
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import \
EnvironmentController
from datmo.core.entity.en... | None | assert | none_literal | datmo/core/controller/environment/tests/test_environment.py | test_extract_workspace_url | TestEnvironmentController | 516 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.code import Code
from datmo.core.util.exceptions import En... | 3 | assert | numeric_literal | datmo/core/storage/local/tests/test_dal_code.py | test_query_codes_range_query | TestLocalDAL | 130 | null |
datmo/datmo | import os
import uuid
import threading
import tempfile
import platform
import timeout_decorator
from io import open
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import \
EnvironmentController
from datmo.core.entity.en... | environment_obj_2.id | assert | complex_expr | datmo/core/controller/environment/tests/test_environment.py | test_build | TestEnvironmentController | 456 | null |
datmo/datmo | import os
import glob
import time
import pytest
import uuid
import tempfile
import shutil
import platform
from argparse import ArgumentError
from datmo.cli.driver.helper import Helper
from datmo.cli.command.environment import EnvironmentCommand
from datmo.cli.command.project import ProjectCommand
from datmo.core.util.... | 0 | assert | numeric_literal | datmo/cli/command/tests/test_environment.py | test_environment_setup_prompt | TestEnvironmentCommand | 189 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.util.exceptions import EntityNotFound, InvalidArgu... | 2 | assert | numeric_literal | datmo/core/storage/local/tests/test_dal_model.py | test_query_models_basic | TestLocalDAL | 135 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.environment import Environment
from datmo.core.util.except... | updated_environment.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_environment.py | test_update_environment | TestLocalDAL | 122 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.util.exceptions import EntityNotFound, InvalidArgu... | model.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_model.py | test_get_by_id_model_new_driver_instance | TestLocalDAL | 98 | null |
datmo/datmo | import os
import tempfile
import platform
import timeout_decorator
from datmo.config import Config
from datmo import __version__
from datmo.cli.driver.helper import Helper
from datmo.cli.command.project import ProjectCommand
from datmo.cli.command.snapshot import SnapshotCommand
from datmo.core.entity.snapshot import ... | result | assert | variable | datmo/cli/command/tests/test_project.py | test_version | TestProjectCommand | 255 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.snapshot import Snapshot
from datmo.core.util.exceptions import EntityNotFound, InvalidA... | snapshot_2.created_at | assert | complex_expr | datmo/core/storage/local/tests/test_dal_snapshot.py | test_sort_snapshots | TestLocalDAL | 155 | null |
datmo/datmo | import os
import uuid
import tempfile
import platform
from io import open, TextIOWrapper
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import EnvironmentController
from datmo.core.controller.task import TaskController
from... | "0.32" | assert | string_literal | datmo/core/controller/tests/test_task.py | test_parse_logs_for_results | TestTaskController | 185 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.config import Config
from datmo.core.controller.base import BaseController
from datmo.core.controller.project import ProjectController
from datmo.core.controller.code.driver.file import FileCodeDriver
from datmo.core.controller.file.driver.local import LocalFileDriv... | "test" | assert | string_literal | datmo/core/controller/tests/test_base.py | test_datmo_model | TestBaseController | 59 | null |
datmo/datmo | import os
import glob
import time
import pytest
import uuid
import tempfile
import shutil
import platform
from argparse import ArgumentError
from datmo.cli.driver.helper import Helper
from datmo.cli.command.environment import EnvironmentCommand
from datmo.cli.command.project import ProjectCommand
from datmo.core.util.... | new_name | assert | variable | datmo/cli/command/tests/test_environment.py | test_environment_update | TestEnvironmentCommand | 313 | null |
datmo/datmo | import os
import tempfile
import platform
from io import open, TextIOWrapper
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import EnvironmentController
from datmo.core.controller.task import TaskController
from datmo.core.... | 0 | assert | numeric_literal | datmo/core/controller/tests/test_snapshot.py | test_list | TestSnapshotController | 753 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.util.exceptions import EntityNotFound, InvalidArgu... | updated_model.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_model.py | test_update_model | TestLocalDAL | 113 | null |
datmo/datmo | from future import standard_library
standard_library.install_aliases()
from builtins import input
import os
import sys
import pytest
import tempfile
import platform
from datmo.cli.driver.helper import Helper
from datmo.core.util.exceptions import ArgumentError
from datmo.cli.command.project import ProjectCommand
from... | 0 | assert | numeric_literal | datmo/cli/driver/tests/test_helper.py | test_prompt_available_options | TestHelper | 257 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.user import User
from datmo.core.util.exceptions import EntityNotFound, InvalidArgumentType
class T... | test_user_input_dict['id'] | assert | complex_expr | datmo/core/storage/local/tests/test_dal_user.py | test_create_user_by_dictionary | TestLocalDAL | 50 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.util.exceptions import EntityNotFound, InvalidArgu... | set(ids) | assert | func_call | datmo/core/storage/local/tests/test_dal_model.py | test_query_models_multiple | TestLocalDAL | 183 | null |
datmo/datmo | import os
import tempfile
import platform
from io import open, TextIOWrapper
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import EnvironmentController
from datmo.core.controller.task import TaskController
from datmo.core.... | True | assert | bool_literal | datmo/core/controller/tests/test_snapshot.py | test_create_from_task | TestSnapshotController | 521 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.environment import Environment
from datmo.core.util.except... | 3 | assert | numeric_literal | datmo/core/storage/local/tests/test_dal_environment.py | test_query_environments_multiple | TestLocalDAL | 157 | null |
datmo/datmo | import os
import glob
import time
import json
import tempfile
import platform
from io import open
from argparse import ArgumentError
from datmo.config import Config
from datmo.cli.driver.helper import Helper
from datmo.cli.command.project import ProjectCommand
from datmo.cli.command.snapshot import SnapshotCommand
fr... | test_paths | assert | variable | datmo/cli/command/tests/test_snapshot.py | test_snapshot_create | TestSnapshotCommand | 197 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.snapshot import SnapshotController
from datmo.core.util.exceptions import CommitDoesNotExist
class TestSnapshotController():
def setup_method(self):
... | val | assert | variable | datmo/core/controller/tests/test_snapshot_private.py | test_code_setup_with_code_id | TestSnapshotController | 67 | null |
datmo/datmo | import os
import tempfile
import platform
import time
import timeout_decorator
from io import open
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.snapshot import SnapshotController
from datmo.core.controller.environment.environment import Environm... | True | assert | bool_literal | datmo/core/controller/tests/test_project.py | test_init_reinit_success | TestProjectController | 149 | null |
datmo/datmo | import os
import uuid
import tempfile
import platform
from io import open, TextIOWrapper
from datmo.config import Config
from datmo.core.controller.project import ProjectController
from datmo.core.controller.environment.environment import EnvironmentController
from datmo.core.controller.task import TaskController
from... | test_command | assert | variable | datmo/core/controller/tests/test_task.py | test_update | TestTaskController | 822 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
import threading
import sys
is_py2 = sys.version[0] == '2'
import uuid
import timeout_decorator
from io import open
from datmo.core.controller.environment.driver.dockerenv import DockerEnvironmentDriver
from datmo.core.util.exceptions import (
EnvironmentIni... | 0 | assert | numeric_literal | datmo/core/controller/environment/driver/tests/test_dockerenv.py | test_run | TestDockerEnv | 306 | null |
datmo/datmo | import os
import shutil
import tempfile
import platform
import threading
import sys
is_py2 = sys.version[0] == '2'
import uuid
import timeout_decorator
from io import open
from datmo.core.controller.environment.driver.dockerenv import DockerEnvironmentDriver
from datmo.core.util.exceptions import (
EnvironmentIni... | None | assert | none_literal | datmo/core/controller/environment/driver/tests/test_dockerenv.py | test_instantiation | TestDockerEnv | 75 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.environment import Environment
from datmo.core.util.except... | environment.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_environment.py | test_create_environment_by_dictionary | TestLocalDAL | 71 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.task import Task
from datmo.core.util.exceptions import En... | result.model_id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_task.py | test_get_by_id_task | TestLocalDAL | 79 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.file_collection import FileCollection
from datmo.core.util... | updated_file_collection.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_file_collection.py | test_update_file_collection | TestLocalDAL | 116 | null |
datmo/datmo | import os
import tempfile
import platform
from datetime import datetime
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.code import Code
from datmo.core.util.exceptions import En... | code.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_code.py | test_create_code_by_dictionary | TestLocalDAL | 56 | null |
datmo/datmo | from datmo.core.entity.environment import Environment
class TestEnvironment():
def setup_method(self):
self.input_dict = {
"model_id": "my_model",
"driver_type": "docker",
"definition_filename": "Dockerfile",
"hardware_info": {
"system": "test... | v | assert | variable | datmo/core/entity/tests/test_environment.py | test_init_no_id | TestEnvironment | 23 | null |
datmo/datmo | from future import standard_library
standard_library.install_aliases()
from builtins import input
import os
import sys
import pytest
import tempfile
import platform
from datmo.cli.driver.helper import Helper
from datmo.core.util.exceptions import ArgumentError
from datmo.cli.command.project import ProjectCommand
from... | "cpu" | assert | string_literal | datmo/cli/driver/tests/test_helper.py | test_prompt_available_options | TestHelper | 187 | null |
datmo/datmo | import os
import tempfile
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.core.storage.local.dal import LocalDAL
from datmo.core.entity.model import Model
from datmo.core.entity.snapshot import Snapshot
from datmo.core.util.exceptions import EntityNotFound, InvalidA... | result.id | assert | complex_expr | datmo/core/storage/local/tests/test_dal_snapshot.py | test_get_by_id_snapshot | TestLocalDAL | 80 | null |
datmo/datmo | import os
import glob
import time
import pytest
import uuid
import tempfile
import shutil
import platform
from argparse import ArgumentError
from datmo.cli.driver.helper import Helper
from datmo.cli.command.environment import EnvironmentCommand
from datmo.cli.command.project import ProjectCommand
from datmo.core.util.... | result_2 | assert | variable | datmo/cli/command/tests/test_environment.py | test_environment_create | TestEnvironmentCommand | 277 | null |
Delgan/loguru | import sys
from unittest.mock import MagicMock
import pytest
from loguru import logger
from .conftest import parse
@pytest.mark.parametrize("colorize", [True, False])
def test_colors_stripped_in_message_record(colorize):
message = None
def sink(msg):
nonlocal message
message = msg.record["m... | "Test" | assert | string_literal | tests/test_opt.py | test_colors_stripped_in_message_record | 297 | null | |
Delgan/loguru | import asyncio
import contextlib
import datetime
import logging
import pickle
import pytest
from loguru import logger
from .conftest import parse
def print_(message):
print(message, end="")
async def async_print(msg):
print_(msg)
def copied_logger_though_pickle(logger):
pickled = pickle.dumps(logger)
... | "A\n" | assert | string_literal | tests/test_pickling.py | test_remove_after_pickling | 306 | null | |
Delgan/loguru | import datetime
import os
import pathlib
import tempfile
import time
from unittest.mock import Mock
import pytest
import loguru
from loguru import logger
from loguru._ctime_functions import load_ctime_functions
from .conftest import check_dir
def tmp_path_local(reset_logger):
# Pytest 'tmp_path' creates directo... | "3\n" | assert | string_literal | tests/test_filesink_rotation.py | test_time_rotation_reopening_xattr_attributeerror | 782 | null | |
Delgan/loguru | import datetime
import os
import pathlib
import tempfile
import time
from unittest.mock import Mock
import pytest
import loguru
from loguru import logger
from loguru._ctime_functions import load_ctime_functions
from .conftest import check_dir
def tmp_path_local(reset_logger):
# Pytest 'tmp_path' creates directo... | "1\n2\n" | assert | string_literal | tests/test_filesink_rotation.py | test_time_rotation_reopening_xattr_attributeerror | 776 | null | |
Delgan/loguru | import json
import re
import sys
from loguru import logger
def test_serialize_with_record_option():
sink = JsonSink()
logger.add(sink, format="{message}", serialize=True, catch=False)
logger.opt(record=True).info("Test", foo=123)
assert sink.json["text"] == | "Test\n" | assert | string_literal | tests/test_add_option_serialize.py | test_serialize_with_record_option | 133 | null | |
Delgan/loguru | import pytest
from colorama import Back, Fore, Style
from .conftest import parse
@pytest.mark.parametrize(
("text", "expected"),
[
("<bold>1</bold>", Style.BRIGHT + "1" + Style.RESET_ALL),
("<dim>1</dim>", Style.DIM + "1" + Style.RESET_ALL),
("<normal>1</normal>", Style.NORMAL + "1" + ... | expected | assert | variable | tests/test_ansimarkup_basic.py | test_styles | 19 | null | |
Delgan/loguru | import inspect
import logging
from loguru import logger
from .conftest import make_logging_logger
def test_intercept_too_low(writer):
with make_logging_logger("tests.test_interception", InterceptHandler()):
logger.add(writer, format="{message}")
logging.getLogger("tests").error("Nope 1")
... | "" | assert | string_literal | tests/test_interception.py | test_intercept_too_low | 90 | null | |
Delgan/loguru | import datetime
import os
import pathlib
import tempfile
import time
from unittest.mock import Mock
import pytest
import loguru
from loguru import logger
from loguru._ctime_functions import load_ctime_functions
from .conftest import check_dir
def tmp_path_local(reset_logger):
# Pytest 'tmp_path' creates directo... | "4\n" | assert | string_literal | tests/test_filesink_rotation.py | test_time_rotation_reopening_native | 731 | null | |
Delgan/loguru | import json
import re
import sys
from loguru import logger
def test_serialize_exception():
sink = JsonSink()
logger.add(sink, format="{message}", serialize=True, catch=False)
try:
1 / 0 # noqa: B018
except ZeroDivisionError:
logger.exception("Error")
lines = sink.json["text"].sp... | "Error" | assert | string_literal | tests/test_add_option_serialize.py | test_serialize_exception | 50 | null | |
Delgan/loguru | import sys
import time
import pytest
from loguru import logger
@pytest.mark.parametrize("handler_id", [sys.stderr, sys, object(), int])
def test_invalid_handler_id_type(handler_id):
with pytest.raises( | TypeError, match=r"^Invalid handler id.*") | pytest.raises | complex_expr | tests/test_remove.py | test_invalid_handler_id_type | 111 | null | |
Delgan/loguru | import json
import re
import sys
from loguru import logger
def test_serialize_non_ascii_characters():
sink = JsonSink()
logger.add(sink, format="{level.icon} {message}", serialize=True)
logger.debug("天")
assert re.search(r'"message": "([^\"]+)"', sink.message).group(1) == "天"
assert re.search(r'"t... | "🐞 天\n" | assert | string_literal | tests/test_add_option_serialize.py | test_serialize_non_ascii_characters | 36 | null | |
Delgan/loguru | import itertools
import time
from threading import Barrier, Thread
from loguru import logger
def test_safe_removing_while_logging(capsys):
barrier = Barrier(2)
counter = itertools.count()
sink = NonSafeSink(1)
i = logger.add(sink, format="{message}", catch=False)
def thread_1():
barrier.... | "aaa0bbb\n" | assert | string_literal | tests/test_threading.py | test_safe_removing_while_logging | 113 | null | |
Delgan/loguru | import asyncio
import sys
import threading
from unittest.mock import MagicMock
import pytest
from loguru import logger
from loguru._contextvars import load_contextvar_class
def test_contextvars_fallback_352(monkeypatch):
mock_module = MagicMock()
with monkeypatch.context() as context:
context.setattr... | mock_module.ContextVar | assert | complex_expr | tests/test_contextualize.py | test_contextvars_fallback_352 | 221 | null | |
Delgan/loguru | import os
import sys
import threading
import time
from unittest.mock import Mock
import pytest
from loguru import logger
from .conftest import check_dir
@pytest.mark.parametrize("delay", [True, False])
def test_exception_during_compression_at_rotation(freeze_time, tmp_path, capsys, delay):
with freeze_time("201... | 1 | assert | numeric_literal | tests/test_filesink_compression.py | test_exception_during_compression_at_rotation | 207 | null | |
Delgan/loguru | import sys
from unittest.mock import MagicMock
import pytest
from loguru import logger
from .conftest import parse
def test_exception_exc_info(writer):
logger.add(writer, format="{message}")
try:
1 / 0 # noqa: B018
except Exception:
exc_info = sys.exc_info()
logger.opt(exception=e... | "test" | assert | string_literal | tests/test_opt.py | test_exception_exc_info | 89 | null | |
Delgan/loguru | import re
import sys
import time
import pytest
from loguru import logger
from .conftest import default_threading_excepthook
def broken_sink(m):
raise ValueError("Error!")
@pytest.mark.parametrize("enqueue", [False, True])
def test_broken_sink_caught_keep_working(enqueue):
output = ""
def half_broken_s... | "A\nB\n" | assert | string_literal | tests/test_add_option_catch.py | test_broken_sink_caught_keep_working | 126 | null | |
Delgan/loguru | import io
import pathlib
import re
from datetime import datetime
import pytest
from loguru import logger
TEXT = "This\nIs\nRandom\nText\n123456789\nABC!DEF\nThis Is The End\n"
def fileobj():
with io.StringIO(TEXT) as file:
yield file
def test_cast_with_irrelevant_value(tmp_path):
file = tmp_path / ... | dict(a=123, b="Blabla") | assert | func_call | tests/test_parse.py | test_cast_with_irrelevant_value | 128 | null | |
Delgan/loguru | import functools
import pytest
from loguru import logger
from .conftest import parse
def test_get_existing_level():
assert logger.level("DEBUG") == | ("DEBUG", 10, "<blue><bold>", "🐞") | assert | collection | tests/test_levels.py | test_get_existing_level | 131 | null | |
Delgan/loguru | import pytest
from loguru._defaults import env
@pytest.mark.parametrize("value", ["test", ""])
def test_string(value, monkeypatch):
with monkeypatch.context() as context:
key = "VALID_STRING"
context.setenv(key, value)
assert env(key, str) == | value | assert | variable | tests/test_defaults.py | test_string | 11 | null | |
Delgan/loguru | import json
import re
import sys
from loguru import logger
def test_serialize_non_ascii_characters():
sink = JsonSink()
logger.add(sink, format="{level.icon} {message}", serialize=True)
logger.debug("天")
assert re.search(r'"message": "([^\"]+)"', sink.message).group(1) == "天"
assert re.search(r'"... | "🐞 天\\n" | assert | string_literal | tests/test_add_option_serialize.py | test_serialize_non_ascii_characters | 34 | null | |
Delgan/loguru | import io
import pathlib
import re
from datetime import datetime
import pytest
from loguru import logger
TEXT = "This\nIs\nRandom\nText\n123456789\nABC!DEF\nThis Is The End\n"
def fileobj():
with io.StringIO(TEXT) as file:
yield file
def test_positive_lookbehind_pattern():
text = "ab" * 100
pat... | [dict(b="b")] * 100 | assert | collection | tests/test_parse.py | test_positive_lookbehind_pattern | 79 | null | |
Delgan/loguru | def divide(x, y):
x / y
def divide_indirect(a, b):
divide(a, b)
def callme(callback):
callback()
def execute():
exec("divide(1, 0)")
def syntaxerror():
exec("foo =")
def assertionerror(x, y):
assert x == | y | assert | variable | tests/exceptions/source/ownership/usersite/somelib/__init__.py | assertionerror | 22 | null | |
Delgan/loguru | import asyncio
import builtins
import contextlib
import datetime
import io
import logging
import multiprocessing
import os
import pathlib
import re
import sys
import threading
import time
import traceback
import warnings
from typing import NamedTuple
import freezegun
import pytest
import loguru
def new_event_loop_co... | len(files) | assert | func_call | tests/conftest.py | check_dir | 136 | null | |
Delgan/loguru | import sys
import loguru
from loguru._get_frame import load_get_frame_function
def test_get_frame_fallback():
frame_root = frame_a = frame_b = None
def a():
nonlocal frame_a
frame_a = loguru._get_frame.get_frame_fallback(1)
b()
def b():
nonlocal frame_b
frame_b = ... | frame_b | assert | variable | tests/test_get_frame.py | test_get_frame_fallback | 37 | null | |
Delgan/loguru | import pytest
from loguru import logger
def test_function_format_with_exception(writer):
logger.add(writer, format=lambda _: "{message}\n{exception}")
try:
1 / 0 # noqa: B018
except ZeroDivisionError:
logger.exception("Error!")
lines = writer.read().splitlines()
assert lines[0] =... | "Error!" | assert | string_literal | tests/test_add_option_format.py | test_function_format_with_exception | 55 | null | |
Delgan/loguru | import functools
import pytest
from loguru import logger
from .conftest import parse
def test_get_level():
level = ("lvl", 11, "<red>", "[!]")
logger.level(*level)
assert logger.level("lvl") == | level | assert | variable | tests/test_levels.py | test_get_level | 127 | null | |
Delgan/loguru | import os
from unittest.mock import Mock
import pytest
from loguru import logger
from .conftest import check_dir
@pytest.mark.parametrize("delay", [True, False])
@pytest.mark.parametrize("compression", [None, lambda _: None])
def test_file_closed_without_being_logged(tmp_path, delay, compression):
filepath = tm... | False if delay else True | assert | complex_expr | tests/test_filesink_watch.py | test_file_closed_without_being_logged | 148 | null | |
Delgan/loguru | import datetime
import os
from unittest.mock import Mock
import pytest
from loguru import logger
from .conftest import check_dir
@pytest.mark.parametrize("delay", [True, False])
def test_exception_during_retention_at_rotation_not_caught(freeze_time, tmp_path, capsys, delay):
with freeze_time("2022-02-22") as fr... | OSError, match="^Retention error$") | pytest.raises | complex_expr | tests/test_filesink_retention.py | test_exception_during_retention_at_rotation_not_caught | 306 | null | |
Delgan/loguru | import asyncio
import site
import sys
import sysconfig
import threading
import types
import pytest
from loguru import logger
def test_exception_is_none():
err = object()
def writer(msg):
nonlocal err
err = msg.record["exception"]
logger.add(writer)
logger.error("No exception")
... | None | assert | none_literal | tests/test_exceptions_catch.py | test_exception_is_none | 226 | null | |
Delgan/loguru | import sys
from unittest.mock import MagicMock
import pytest
from loguru import logger
from .conftest import parse
def test_kwargs_in_extra_of_record():
message = None
def sink(message_):
nonlocal message
message = message_
logger.add(sink, format="{message}", catch=False)
logger.... | {"foo": 123} | assert | collection | tests/test_opt.py | test_kwargs_in_extra_of_record | 60 | null | |
Delgan/loguru | import asyncio
import builtins
import contextlib
import datetime
import io
import logging
import multiprocessing
import os
import pathlib
import re
import sys
import threading
import time
import traceback
import warnings
from typing import NamedTuple
import freezegun
import pytest
import loguru
def new_event_loop_co... | content | assert | variable | tests/conftest.py | check_dir | 142 | null | |
Delgan/loguru | import asyncio
import contextlib
import datetime
import logging
import pickle
import pytest
from loguru import logger
from .conftest import parse
def print_(message):
print(message, end="")
async def async_print(msg):
print_(msg)
def copied_logger_though_pickle(logger):
pickled = pickle.dumps(logger)
... | "=> Ok" | assert | string_literal | tests/test_pickling.py | test_pickling_standard_handler_root_logger_not_picklable | 166 | null | |
Delgan/loguru | import datetime
import os
import pathlib
import tempfile
import time
from unittest.mock import Mock
import pytest
import loguru
from loguru import logger
from loguru._ctime_functions import load_ctime_functions
from .conftest import check_dir
def tmp_path_local(reset_logger):
# Pytest 'tmp_path' creates directo... | "6\n" | assert | string_literal | tests/test_filesink_rotation.py | test_time_rotation_reopening_native | 746 | null | |
Delgan/loguru | import sys
from unittest.mock import MagicMock
import pytest
from loguru import logger
from .conftest import parse
def test_kwargs_in_extra_of_record():
message = None
def sink(message_):
nonlocal message
message = message_
logger.add(sink, format="{message}", catch=False)
logger.... | "Test 123\n" | assert | string_literal | tests/test_opt.py | test_kwargs_in_extra_of_record | 59 | null | |
Delgan/loguru | import os
import pytest
from loguru import logger
from .conftest import StreamIsattyException, StreamIsattyFalse, StreamIsattyTrue, parse
@pytest.mark.parametrize(
"stream", [StreamIsattyTrue(), StreamIsattyFalse(), StreamIsattyException()]
)
def test_colorize_stream(stream):
logger.add(stream, format="<blu... | parse("<blue>Message</blue>\n") | assert | func_call | tests/test_add_option_colorize.py | test_colorize_stream | 46 | null | |
Delgan/loguru | import inspect
import logging
from loguru import logger
from .conftest import make_logging_logger
def test_multiple_intercept(writer):
with make_logging_logger("test_1", InterceptHandler()) as logging_logger_1:
with make_logging_logger("test_2", InterceptHandler()) as logging_logger_2:
logger... | "1\n2\n" | assert | string_literal | tests/test_interception.py | test_multiple_intercept | 101 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.