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
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
reversed_cols)
self.assertEqual
variable
tests/test_arrow.py
test_change_ordering_of_columns
TestArrow
156
null
deepseek-ai/smallpond
import os.path import queue import sys import unittest from concurrent.futures import ThreadPoolExecutor from datetime import datetime from multiprocessing import Manager, Process from typing import List, Optional import fsspec import numpy as np import psutil import pyarrow as arrow import pyarrow.compute as pc impor...
y)
assert_*
variable
tests/test_fabric.py
_compare_arrow_tables
TestFabric
275
null
deepseek-ai/smallpond
import glob import importlib import tempfile import unittest from smallpond.io.arrow import cast_columns_to_large_string from tests.test_fabric import TestFabric class TestDeltaLake(TestFabric, unittest.TestCase): def test_load_mixed_large_dtypes(self): from deltalake import DeltaTable, write_deltalake ...
loaded_table.num_rows)
self.assertEqual
complex_expr
tests/test_deltalake.py
test_load_mixed_large_dtypes
TestDeltaLake
41
null
deepseek-ai/smallpond
import multiprocessing import multiprocessing.dummy import multiprocessing.queues import queue import tempfile import time import unittest from loguru import logger from smallpond.execution.workqueue import ( WorkItem, WorkQueue, WorkQueueInMemory, WorkQueueOnFilesystem, ) from tests.test_fabric impor...
numCollected)
self.assertEqual
variable
tests/test_workqueue.py
test_multi_consumers
WorkQueueTestBase
94
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_random_shuffle(sp: Session): df = sp.from_items(list(range(1000))).repartition(10, by_rows=True) df = df.random_shuffle() shuffled = [d["item"] for d in df.take_all()] asse...
list(range(1000))
assert
func_call
tests/test_dataframe.py
test_random_shuffle
97
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
all(map(os.path.exists, exec_plan.final_output.resolved_paths)))
self.assertTrue
func_call
tests/test_execution.py
test_variable_length_input_datasets
TestExecution
368
null
deepseek-ai/smallpond
import os.path import queue import sys import unittest from concurrent.futures import ThreadPoolExecutor from datetime import datetime from multiprocessing import Manager, Process from typing import List, Optional import fsspec import numpy as np import psutil import pyarrow as arrow import pyarrow.compute as pc impor...
actual.column_names)
self.assertEqual
complex_expr
tests/test_fabric.py
_compare_arrow_tables
TestFabric
266
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_count(sp: Session): df = sp.from_items([1, 2, 3]) assert df.count() ==
3
assert
numeric_literal
tests/test_dataframe.py
test_count
131
null
deepseek-ai/smallpond
import random import subprocess import time import unittest from typing import Iterable from smallpond.utility import ConcurrentIter, execute_command from tests.test_fabric import TestFabric class TestUtility(TestFabric, unittest.TestCase): def test_concurrent_iter_no_error(self): def slow_iterator(iter: ...
sum(range(n)))
self.assertEqual
func_call
tests/test_utility.py
test_concurrent_iter_no_error
TestUtility
21
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_flat_map(sp: Session): df = sp.from_arrow(pa.table({"a": [1, 2, 3], "b": [4, 5, 6]})) df1 = df.flat_map(lambda r: [{"c": r["a"]}, {"c": r["b"]}]) assert df1.to_arrow() ==
pa.table({"c": [1, 4, 2, 5, 3, 6]})
assert
func_call
tests/test_dataframe.py
test_flat_map
67
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
isinstance(final_output, ParquetDataSet))
self.assertTrue
func_call
tests/test_partition.py
test_empty_dataset_partition
TestPartition
98
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
0)
self.assertEqual
numeric_literal
tests/test_arrow.py
test_dump_load_empty_table
TestArrow
69
null
deepseek-ai/smallpond
import unittest from loguru import logger from smallpond.logical.dataset import ParquetDataSet from smallpond.logical.node import ( Context, DataSetPartitionNode, DataSourceNode, EvenlyDistributedPartitionNode, HashPartitionNode, LogicalPlan, SqlEngineNode, ) from smallpond.logical.planner...
AssertionError)
self.assertRaises
variable
tests/test_logical.py
test_partition_dims_not_compatible
TestLogicalPlan
57
null
deepseek-ai/smallpond
from typing import List import pandas as pd import pyarrow as pa import pytest from smallpond.dataframe import Session def test_partial_sql(sp: Session): # no input deps df = sp.partial_sql("select * from range(3)") assert df.to_arrow() ==
pa.table({"range": [0, 1, 2]})
assert
func_call
tests/test_dataframe.py
test_partial_sql
151
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
exec_plan.get_output("random_urls_k5").to_arrow_table().num_rows)
self.assertEqual
func_call
tests/test_execution.py
test_partial_process_func
TestExecution
751
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
final_output.num_rows)
self.assertEqual
complex_expr
tests/test_execution.py
test_temp_outputs_in_final_results
TestExecution
652
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
num_lines)
self.assertEqual
variable
tests/test_execution.py
test_manifest_only_data_sink
TestExecution
591
null
deepseek-ai/smallpond
import glob import os.path import unittest from pathlib import PurePath import duckdb import pandas import pyarrow as arrow import pytest from loguru import logger from smallpond.common import DEFAULT_ROW_GROUP_SIZE, MB from smallpond.logical.dataset import ParquetDataSet from smallpond.utility import ConcurrentIter ...
loaded_table.shape)
self.assertEqual
complex_expr
tests/test_dataset.py
_check_partition_datasets
TestDataSet
55
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
os.path.exists(os.path.join(output_path, "FinalResults")))
self.assertTrue
func_call
tests/test_execution.py
test_override_output_path
TestExecution
679
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len(exec_plan.final_output.load_partitioned_datasets(npartitions, "hash_partitions")))
self.assertEqual
func_call
tests/test_partition.py
test_empty_hash_partition
TestPartition
216
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
loaded_table.schema.metadata)
self.assertEqual
complex_expr
tests/test_arrow.py
test_arrow_schema_metadata
TestArrow
125
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len(exec_plan.final_output.load_partitioned_datasets(npartitions, DATA_PARTITION_COLUMN_NAME)))
self.assertEqual
func_call
tests/test_partition.py
test_hash_partition
TestPartition
144
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): def test_get_nth_part...
get_nth_partition(items, 0, 3))
self.assertListEqual
func_call
tests/test_common.py
test_get_nth_partition
TestCommon
21
null
deepseek-ai/smallpond
import os.path import queue import sys import unittest from concurrent.futures import ThreadPoolExecutor from datetime import datetime from multiprocessing import Manager, Process from typing import List, Optional import fsspec import numpy as np import psutil import pyarrow as arrow import pyarrow.compute as pc impor...
latest_state.success)
self.assertTrue
complex_expr
tests/test_fabric.py
execute_plan
TestFabric
251
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len( exec_plan.get_output("hash_partitions").load_partitioned_datasets( npartitions, DATA_PARTITION_COLUMN_NAME, hive_partitioning, ) ))
self.assertEqual
func_call
tests/test_partition.py
test_hash_partition
TestPartition
148
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
final_output.num_rows)
self.assertEqual
complex_expr
tests/test_partition.py
test_empty_dataset_partition
TestPartition
99
null
deepseek-ai/smallpond
import glob import os.path import unittest from pathlib import PurePath import duckdb import pandas import pyarrow as arrow import pytest from loguru import logger from smallpond.common import DEFAULT_ROW_GROUP_SIZE, MB from smallpond.logical.dataset import ParquetDataSet from smallpond.utility import ConcurrentIter ...
dataset.num_rows)
self.assertEqual
complex_expr
tests/test_dataset.py
test_parquet_file_created_by_pandas
TestDataSet
31
null
deepseek-ai/smallpond
import random import subprocess import time import unittest from typing import Iterable from smallpond.utility import ConcurrentIter, execute_command from tests.test_fabric import TestFabric class TestUtility(TestFabric, unittest.TestCase): def test_execute_command(self): with self.assertRaises(
subprocess.CalledProcessError)
self.assertRaises
complex_expr
tests/test_utility.py
test_execute_command
TestUtility
44
null
deepseek-ai/smallpond
import os.path import random import time import unittest from typing import List, Tuple from loguru import logger from smallpond.execution.scheduler import ExecutorState from smallpond.execution.task import PythonScriptTask, RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.l...
f"remote_executors: {latest_sched_state.remote_executors}")
self.assertLessEqual
string_literal
tests/test_scheduler.py
test_failed_executors
TestScheduler
121
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
dump_to_parquet_files(table_with_meta, output_dir, "arrow_schema_metadata", max_workers=2))
self.assertTrue
func_call
tests/test_arrow.py
test_arrow_schema_metadata
TestArrow
121
null
deepseek-ai/smallpond
import functools import os.path import socket import tempfile import time import unittest from datetime import datetime from typing import Iterable, List, Tuple import pandas import pyarrow as arrow from loguru import logger from pandas.core.api import DataFrame as DataFrame from smallpond.common import GB, MB, split...
exec_plan.successful)
self.assertFalse
complex_expr
tests/test_execution.py
test_task_crash_as_oom
TestExecution
568
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
ok)
self.assertTrue
variable
tests/test_arrow.py
test_dump_load_empty_table
TestArrow
73
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
expected_num_rows)
self.assertEqual
variable
tests/test_arrow.py
test_parquet_batch_reader
TestArrow
97
null
deepseek-ai/smallpond
import glob import os.path import unittest from pathlib import PurePath import duckdb import pandas import pyarrow as arrow import pytest from loguru import logger from smallpond.common import DEFAULT_ROW_GROUP_SIZE, MB from smallpond.logical.dataset import ParquetDataSet from smallpond.utility import ConcurrentIter ...
len(filenames))
self.assertEqual
func_call
tests/test_dataset.py
test_resolved_many_paths
TestDataSet
102
null
deepseek-ai/smallpond
import os.path import tempfile import unittest from typing import List import pyarrow.compute as pc from smallpond.common import DATA_PARTITION_COLUMN_NAME, GB from smallpond.execution.task import RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.logical.node import ( Arr...
len(final_output_partitions3))
self.assertEqual
func_call
tests/test_partition.py
test_load_partitioned_datasets
TestPartition
350
null
deepseek-ai/smallpond
import glob import os.path import tempfile import unittest import pyarrow.parquet as parquet from loguru import logger from smallpond.io.arrow import ( RowRange, build_batch_reader_from_files, cast_columns_to_large_string, dump_to_parquet_files, load_from_parquet_files, ) from smallpond.utility im...
AssertionError)
self.assertRaises
variable
tests/test_arrow.py
test_load_not_exist_column
TestArrow
148
null
deepseek-ai/smallpond
import random import subprocess import time import unittest from typing import Iterable from smallpond.utility import ConcurrentIter, execute_command from tests.test_fabric import TestFabric class TestUtility(TestFabric, unittest.TestCase): def test_concurrent_iter_with_error(self): def broken_iterator(i...
Exception)
self.assertRaises
variable
tests/test_utility.py
test_concurrent_iter_with_error
TestUtility
35
null
deepseek-ai/smallpond
import os.path import random import time import unittest from typing import List, Tuple from loguru import logger from smallpond.execution.scheduler import ExecutorState from smallpond.execution.task import PythonScriptTask, RuntimeContext from smallpond.logical.dataset import DataSet, ParquetDataSet from smallpond.l...
False)
self.assertTrue
bool_literal
tests/test_scheduler.py
check_executor_state
TestScheduler
85
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): def test_get_nth_part...
get_nth_partition(items, 0, 1))
self.assertListEqual
func_call
tests/test_common.py
test_get_nth_partition
TestCommon
16
null
deepseek-ai/smallpond
import itertools import unittest import numpy as np from hypothesis import given from hypothesis import strategies as st from smallpond.common import get_nth_partition, split_into_cols, split_into_rows from tests.test_fabric import TestFabric class TestCommon(TestFabric, unittest.TestCase): @given(st.data()) ...
chunk_size * npartitions)
self.assertEqual
complex_expr
tests/test_common.py
test_split_into_cols
TestCommon
57
null
deepseek-ai/smallpond
import glob import os.path import unittest from pathlib import PurePath import duckdb import pandas import pyarrow as arrow import pytest from loguru import logger from smallpond.common import DEFAULT_ROW_GROUP_SIZE, MB from smallpond.logical.dataset import ParquetDataSet from smallpond.utility import ConcurrentIter ...
DEFAULT_ROW_GROUP_SIZE * 2)
self.assertLessEqual
complex_expr
tests/test_dataset.py
test_to_arrow_table_batch_reader
TestDataSet
129
null
nerfbaselines/nerfbaselines
import numpy as np import pytest import platform import plyfile import urllib.request def test_viewer_simple_http_server(): # Skip test on windows if platform.system() == "Windows": pytest.skip("Windows needs to be tested first.") from nerfbaselines.viewer import Viewer dataset = { "p...
200
assert
numeric_literal
tests/test_viewer.py
test_viewer_simple_http_server
26
null
nerfbaselines/nerfbaselines
import contextlib import sys import shutil import json from typing import cast from pathlib import Path import os import numpy as np from nerfbaselines import Method, MethodInfo, Cameras, RenderOutput, ModelInfo from nerfbaselines.utils import Indices from nerfbaselines.datasets import _colmap_utils as colmap_utils fro...
None
assert
none_literal
tests/test_train_render.py
test_train_command_undistort
307
null
nerfbaselines/nerfbaselines
from contextlib import nullcontext import shutil import subprocess import importlib import gc import copy import tarfile import json import sys import pickle from functools import partial import inspect from unittest import mock import contextlib import os import pytest from pathlib import Path import numpy as np from ...
weight.shape[0]
assert
complex_expr
tests/conftest.py
conv2d
855
null
nerfbaselines/nerfbaselines
import pytest import numpy as np from nerfbaselines import cameras from nerfbaselines import camera_model_to_int, CameraModel, new_cameras from nerfbaselines._types import _get_xnp def _build_camera(camera_model: CameraModel, intrinsics, distortion_parameters=None, image_sizes=None): if image_sizes is None: ...
xy0)
assert_*
variable
tests/test_cameras.py
_test_cam_from_img_to_img
133
null
nerfbaselines/nerfbaselines
import os import pytest from nerfbaselines import get_supported_methods, get_method_spec @pytest.mark.parametrize("method_name", [pytest.param(k, marks=[pytest.mark.method(k)]) for k in get_supported_methods("docker")]) def test_docker_get_dockerfile(method_name): from nerfbaselines.backends._docker import docker_...
0
assert
numeric_literal
tests/test_backends.py
test_docker_get_dockerfile
14
null
nerfbaselines/nerfbaselines
import importlib.resources import sys from typing import cast import numpy as np import pytest from nerfbaselines.metrics import torchmetrics_ssim, dmpix_ssim from nerfbaselines import metrics @pytest.mark.extras @pytest.mark.filterwarnings("ignore::UserWarning:torchvision") @pytest.mark.parametrize("kernel_size", [No...
(3,)
assert
collection
tests/test_metrics.py
test_torchmetrics_ssim
45
null
nerfbaselines/nerfbaselines
import importlib.resources import sys from typing import cast import numpy as np import pytest from nerfbaselines.metrics import torchmetrics_ssim, dmpix_ssim from nerfbaselines import metrics @pytest.mark.filterwarnings("ignore::UserWarning:torchvision") @pytest.mark.parametrize("metric", ["torchmetrics_ssim", "dmpix...
Exception)
pytest.raises
variable
tests/test_metrics.py
test_metric
106
null
nerfbaselines/nerfbaselines
import json from pathlib import Path def test_open_any_directory(tmp_path): from nerfbaselines.io import open_any_directory, open_any with open_any_directory(tmp_path / "data.zip/obj.tar.gz/test/test.zip/ok/pass.zip", "w") as _path: path = Path(_path) (path / "data.txt").write_text("Hello worl...
b"Hello world2"
assert
string_literal
tests/test_io.py
test_open_any_directory
50
null
nerfbaselines/nerfbaselines
from contextlib import nullcontext import shutil import subprocess import importlib import gc import copy import tarfile import json import sys import pickle from functools import partial import inspect from unittest import mock import contextlib import os import pytest from pathlib import Path import numpy as np from ...
test_name
assert
variable
tests/conftest.py
run_test_train_fixture
309
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException def test_tuple_click_type(): import click from nerfbaselines.cli._common import TupleClickType with ...
SystemExit)
pytest.raises
variable
tests/test_utils.py
test_tuple_click_type
87
null
nerfbaselines/nerfbaselines
import contextlib import traceback import sys import json import glob import pprint import logging import os import numpy as np import click from PIL import Image import tempfile from tqdm import trange import nerfbaselines from typing import Type import urllib.request from nerfbaselines import ( build_method_class...
steps
assert
variable
nerfbaselines/cli/_test_method.py
main
332
null
nerfbaselines/nerfbaselines
import importlib.resources import sys from typing import cast import numpy as np import pytest from nerfbaselines.metrics import torchmetrics_ssim, dmpix_ssim from nerfbaselines import metrics def test_psnr(): np.random.seed(42) batch_shapes = [ (3,), (2, 2), ( 2, ...
val2)
assert_*
variable
tests/test_metrics.py
test_psnr
141
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException def test_convert_image_dtype_numpy(): from nerfbaselines.utils import convert_image_dtype # Test keep sa...
1e-5
assert
numeric_literal
tests/test_utils.py
test_convert_image_dtype_numpy
131
null
nerfbaselines/nerfbaselines
import importlib import numpy as np import copy import argparse import sys import os import pytest METHOD_NAME = "taming-3dgs" def taming_source_code(load_source_code): load_source_code("https://github.com/humansensinglab/taming-3dgs.git", "446f2c0d50d082e660e5b899d304da5931351dec") def colmap_dataset(colmap_dat...
splats
assert
variable
tests/methods/test_taming_3dgs.py
_test_taming_3dgs
117
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException def test_convert_image_dtype_numpy(): from nerfbaselines.utils import convert_image_dtype # Test keep sa...
arr
assert
variable
tests/test_utils.py
test_convert_image_dtype_numpy
121
null
nerfbaselines/nerfbaselines
import time import sys import contextlib import threading import pytest import functools import signal def _signal_handler(signum, frame): del signum, frame pytest.fail("Timeout") def timeout(timeout): def decorator(fn): @functools.wraps(fn) def wrapper(*args, **kwargs): if not...
4
assert
numeric_literal
tests/test_rpc_protocol.py
test_protocol_large_message
149
null
nerfbaselines/nerfbaselines
from functools import partial from unittest import mock import contextlib import pytest from typing import Iterable import numpy as np from time import sleep from nerfbaselines import Method, MethodInfo, RenderOutput, ModelInfo, new_cameras from nerfbaselines.utils import CancellationToken, CancelledException def test...
23
assert
numeric_literal
tests/test_communication.py
test_render
47
null
nerfbaselines/nerfbaselines
import sys import contextlib import logging from unittest import mock import math from typing import List, Dict, Any, cast, Union, Type, Iterator, Optional, Tuple import base64 import os import struct from pathlib import Path import json import warnings import numpy as np from .io import open_any from . import ( me...
tuple(supported_outputs)
assert
func_call
nerfbaselines/results.py
get_method_info_from_spec
193
null
nerfbaselines/nerfbaselines
import os from unittest import mock import contextlib import numpy as np import pytest from nerfbaselines import ( get_supported_methods, get_method_spec, ) from nerfbaselines.training import ( get_presets_and_config_overrides, ) from nerfbaselines import build_method_class from nerfbaselines.datasets impor...
None
assert
none_literal
tests/test_methods.py
test_method_conda
84
null
nerfbaselines/nerfbaselines
import numpy as np from unittest import mock import pytest from time import sleep, perf_counter from nerfbaselines.utils import Indices from nerfbaselines.utils import CancellationToken, CancelledException @click.command() @click.option("--val", type=TupleClickType(), default=None) def cmd(val)...
None
assert
none_literal
tests/test_utils.py
cmd
91
null
nerfbaselines/nerfbaselines
from enum import Enum from pathlib import Path import tempfile import pytest import contextlib import numpy as np import sys from unittest import mock METHOD_NAME = "instant-ngp" def _set_camera_to_training_view(x): nonlocal test_view assert image_sizes is not
None
assert
none_literal
tests/methods/_test_ingp.py
_set_camera_to_training_view
47
null
nerfbaselines/nerfbaselines
import contextlib import sys import shutil import json from typing import cast from pathlib import Path import os import numpy as np from nerfbaselines import Method, MethodInfo, Cameras, RenderOutput, ModelInfo from nerfbaselines.utils import Indices from nerfbaselines.datasets import _colmap_utils as colmap_utils fro...
0
assert
numeric_literal
tests/test_train_render.py
render
_Method
326
null
nerfbaselines/nerfbaselines
import pytest import os from functools import partial import threading import pytest import time from time import sleep import gc from unittest import mock from nerfbaselines.utils import CancelledException, CancellationToken from nerfbaselines.backends._common import SimpleBackend from nerfbaselines import backends ...
0
assert
numeric_literal
tests/test_rpc.py
test_rpc_backend_yield
186
null
nerfbaselines/nerfbaselines
import unittest.mock import importlib import numpy as np import copy import argparse import os import pytest METHOD_NAME = "hierarchical-3dgs" def dataloader_noworkers(): from torch.utils.data import DataLoader old_init = DataLoader.__init__ def dl_init(self, *args, **kwargs): kwargs["num_workers"...
render
assert
variable
tests/methods/test_hierarchical_3dgs.py
_test_hierarchical_3dgs
144
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
k)
assert_*
variable
tests/test_results.py
assert_ok_type
104
null
nerfbaselines/nerfbaselines
import time import sys import contextlib import threading import pytest import functools import signal def _signal_handler(signum, frame): del signum, frame pytest.fail("Timeout") def timeout(timeout): def decorator(fn): @functools.wraps(fn) def wrapper(*args, **kwargs): if not...
TimeoutError)
pytest.raises
variable
tests/test_rpc_protocol.py
test_protocol_wait_for_worker_timeout
38
null
nerfbaselines/nerfbaselines
from pathlib import Path from collections import defaultdict import os from dataclasses import dataclass, field from typing import Any, cast import enum import pytest import sys from unittest import mock def setup(): assert config is not
None
assert
none_literal
tests/methods/_test_nerfstudio.py
setup
132
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
method
assert
variable
tests/test_results.py
assert_compile_dataset_results_correct
74
null
nerfbaselines/nerfbaselines
import time import sys import contextlib import threading import pytest import functools import signal def _signal_handler(signum, frame): del signum, frame pytest.fail("Timeout") def timeout(timeout): def decorator(fn): @functools.wraps(fn) def wrapper(*args, **kwargs): if not...
ConnectionError)
pytest.raises
variable
tests/test_rpc_protocol.py
test_protocol_close_connection_worker
216
null
nerfbaselines/nerfbaselines
import pytest import os import numpy as np from typing import Optional, TypeVar from unittest import mock from unittest.mock import MagicMock from nerfbaselines import Method, new_cameras from nerfbaselines import evaluation from PIL import Image import tarfile import zipfile T = TypeVar("T") def _assert_not_none(val...
num_cams
assert
variable
tests/test_render_frames.py
_verify_folder_single
311
null
nerfbaselines/nerfbaselines
import os from unittest import mock import contextlib import numpy as np import pytest from nerfbaselines import ( get_supported_methods, get_method_spec, ) from nerfbaselines.training import ( get_presets_and_config_overrides, ) from nerfbaselines import build_method_class from nerfbaselines.datasets impor...
0
assert
numeric_literal
tests/test_methods.py
test_supported_methods
25
null
nerfbaselines/nerfbaselines
import importlib.resources import sys from typing import cast import numpy as np import pytest from nerfbaselines.metrics import torchmetrics_ssim, dmpix_ssim from nerfbaselines import metrics @pytest.mark.filterwarnings("ignore::UserWarning:torchvision") @pytest.mark.parametrize("metric", ["torchmetrics_ssim", "dmpix...
bs
assert
variable
tests/test_metrics.py
test_metric
103
null
nerfbaselines/nerfbaselines
import os from unittest import mock import contextlib import numpy as np import pytest from nerfbaselines import ( get_supported_methods, get_method_spec, ) from nerfbaselines.training import ( get_presets_and_config_overrides, ) from nerfbaselines import build_method_class from nerfbaselines.datasets impor...
"conda"
assert
string_literal
tests/test_methods.py
test_method_conda
85
null
nerfbaselines/nerfbaselines
import contextlib import sys import shutil import json from typing import cast from pathlib import Path import os import numpy as np from nerfbaselines import Method, MethodInfo, Cameras, RenderOutput, ModelInfo from nerfbaselines.utils import Indices from nerfbaselines.datasets import _colmap_utils as colmap_utils fro...
13
assert
numeric_literal
tests/test_train_render.py
test_train_command_extras
265
null
nerfbaselines/nerfbaselines
import pytest import os import sys import contextlib from unittest import mock from nerfbaselines import Method, MethodInfo, ModelInfo import numpy as np def clear_allowed_methods(): allowed_methods = os.environ.get("NERFBASELINES_ALLOWED_METHODS", None) try: os.environ.pop("NERFBASELINES_ALLOWED_METHO...
set(())
assert
func_call
tests/test_registry.py
test_get_presets_to_apply
146
null
nerfbaselines/nerfbaselines
import pytest import numpy as np from nerfbaselines import cameras from nerfbaselines import camera_model_to_int, CameraModel, new_cameras from nerfbaselines._types import _get_xnp @pytest.mark.parametrize("camera_type", get_args(CameraModel)) def test_camera(camera_type): np.random.seed(42) num_cam = 10 r...
xy_new)
assert_*
variable
tests/test_cameras.py
test_camera
50
null
nerfbaselines/nerfbaselines
import json from pathlib import Path def test_load_and_save_trajectory(tmp_path): from nerfbaselines import io pose = [0.568, -0.102, 0.816, -11.05, 0.178, 0.983, -0.001, 0.059, -0.802, 0.146, 0.577, -7.812] frame = { "pose": pose, "intrinsics": [623.53, 623.53, 640.0, 360.0], "app...
3
assert
numeric_literal
tests/test_io.py
test_load_and_save_trajectory
94
null
nerfbaselines/nerfbaselines
import contextlib import traceback import sys import json import glob import pprint import logging import os import numpy as np import click from PIL import Image import tempfile from tqdm import trange import nerfbaselines from typing import Type import urllib.request from nerfbaselines import ( build_method_class...
im2)
assert_*
variable
nerfbaselines/cli/_test_method.py
main
472
null
nerfbaselines/nerfbaselines
import importlib.resources import sys from typing import cast import numpy as np import pytest from nerfbaselines.metrics import torchmetrics_ssim, dmpix_ssim from nerfbaselines import metrics @pytest.mark.extras @pytest.mark.filterwarnings("ignore::UserWarning:torchvision") @pytest.mark.parametrize("kernel_size", [No...
reference2)
assert_*
variable
tests/test_metrics.py
test_torchmetrics_ssim
51
null
nerfbaselines/nerfbaselines
import pytest import numpy as np from nerfbaselines import cameras from nerfbaselines import camera_model_to_int, CameraModel, new_cameras from nerfbaselines._types import _get_xnp def _build_camera(camera_model: CameraModel, intrinsics, distortion_parameters=None, image_sizes=None): if image_sizes is None: ...
uv0)
assert_*
variable
tests/test_cameras.py
_test_cam_to_cam_from_img
123
null
nerfbaselines/nerfbaselines
import importlib.resources import sys from typing import cast import numpy as np import pytest from nerfbaselines.metrics import torchmetrics_ssim, dmpix_ssim from nerfbaselines import metrics @pytest.mark.filterwarnings("ignore::UserWarning:torchvision") @pytest.mark.parametrize("metric", ["torchmetrics_ssim", "dmpix...
(*bs, 47-10, 31-10, 3)
assert
collection
tests/test_metrics.py
test_metric
114
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
datasets
assert
variable
tests/test_results.py
test_get_supported_datasets
43
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
y)
assert_*
variable
tests/test_results.py
assert_ok_type
100
null
nerfbaselines/nerfbaselines
import contextlib import traceback import sys import json import glob import pprint import logging import os import numpy as np import click from PIL import Image import tempfile from tqdm import trange import nerfbaselines from typing import Type import urllib.request from nerfbaselines import ( build_method_class...
render2_out
assert
variable
nerfbaselines/cli/_test_method.py
test_render
364
null
nerfbaselines/nerfbaselines
import pytest import numpy as np from nerfbaselines import cameras from nerfbaselines import camera_model_to_int, CameraModel, new_cameras from nerfbaselines._types import _get_xnp def _build_camera(camera_model: CameraModel, intrinsics, distortion_parameters=None, image_sizes=None): if image_sizes is None: ...
np.int32
assert
complex_expr
tests/test_cameras.py
test_get_image_pixels_shape
214
null
nerfbaselines/nerfbaselines
import pytest import numpy as np from nerfbaselines import cameras from nerfbaselines import camera_model_to_int, CameraModel, new_cameras from nerfbaselines._types import _get_xnp def _build_camera(camera_model: CameraModel, intrinsics, distortion_parameters=None, image_sizes=None): if image_sizes is None: ...
None
assert
none_literal
tests/test_cameras.py
test_camera_undistort_opencv
205
null
nerfbaselines/nerfbaselines
import logging import shutil import ast import sys import os import contextlib import json from typing import Optional, Dict from nerfbaselines import Method, Dataset, MethodInfo, ModelInfo, RenderOutput, Cameras from nerfbaselines.datasets import _colmap_utils as colmap_utils from nerfbaselines.datasets import colmap ...
None
assert
none_literal
nerfbaselines/methods/threedgrut.py
_get_train_iteration
73
null
nerfbaselines/nerfbaselines
import numpy as np import pytest import platform import plyfile import urllib.request def test_viewer_simple_http_server(): # Skip test on windows if platform.system() == "Windows": pytest.skip("Windows needs to be tested first.") from nerfbaselines.viewer import Viewer dataset = { "p...
None
assert
none_literal
tests/test_viewer.py
test_viewer_simple_http_server
21
null
nerfbaselines/nerfbaselines
import pytest import os from functools import partial import threading import pytest import time from time import sleep import gc from unittest import mock from nerfbaselines.utils import CancelledException, CancellationToken from nerfbaselines.backends._common import SimpleBackend from nerfbaselines import backends ...
1
assert
numeric_literal
tests/test_rpc.py
test_rpc_backend_instance
126
null
nerfbaselines/nerfbaselines
_patch = """diff --git a/scene/__init__.py b/scene/__init__.py index 2b31398..c31679a 100644 --- a/scene/__init__.py +++ b/scene/__init__.py @@ -25 +25 @@ class Scene: - def __init__(self, args : ModelParams, gaussians : GaussianModel, load_iteration=None, shuffle=True, resolution_scales=[1.0]): + def __init__(se...
after
assert
variable
tests/test_patching.py
test_apply_patch
65
null
nerfbaselines/nerfbaselines
from unittest import mock import importlib import numpy as np import copy import argparse import os import pytest from PIL import Image import matplotlib.pyplot from nerfbaselines._registry import collect_register_calls METHOD_ID = "sparsegs" def method_source_code(load_source_code): with collect_register_calls(...
render
assert
variable
tests/methods/test_sparsegs.py
_test_method
135
null
nerfbaselines/nerfbaselines
import pytest import os import sys import contextlib from unittest import mock from nerfbaselines import Method, MethodInfo, ModelInfo import numpy as np def clear_allowed_methods(): allowed_methods = os.environ.get("NERFBASELINES_ALLOWED_METHODS", None) try: os.environ.pop("NERFBASELINES_ALLOWED_METHO...
1
assert
numeric_literal
tests/test_registry.py
test_register_environment_variable
300
null
nerfbaselines/nerfbaselines
import os from unittest import mock import contextlib import numpy as np import pytest from nerfbaselines import ( get_supported_methods, get_method_spec, ) from nerfbaselines.training import ( get_presets_and_config_overrides, ) from nerfbaselines import build_method_class from nerfbaselines.datasets impor...
methods
assert
variable
tests/test_methods.py
test_supported_methods
26
null
nerfbaselines/nerfbaselines
import numpy as np import json import os from unittest import mock import contextlib import pytest def _test_generic_dataset(tmp_path, dataset_name, scene, train_size, test_size): from nerfbaselines.datasets import load_dataset with contextlib.ExitStack() as stack: stack.enter_context(mock.patch("nerf...
"nerf"
assert
string_literal
tests/test_datasets.py
test_blender_dataset
71
null
nerfbaselines/nerfbaselines
import contextlib import traceback import sys import json import glob import pprint import logging import os import numpy as np import click from PIL import Image import tempfile from tqdm import trange import nerfbaselines from typing import Type import urllib.request from nerfbaselines import ( build_method_class...
None
assert
none_literal
nerfbaselines/cli/_test_method.py
main
253
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
4
assert
numeric_literal
tests/test_results.py
test_render_markdown_dataset_results_table
245
null
nerfbaselines/nerfbaselines
import pytest import os import numpy as np from typing import Optional, TypeVar from unittest import mock from unittest.mock import MagicMock from nerfbaselines import Method, new_cameras from nerfbaselines import evaluation from PIL import Image import tarfile import zipfile T = TypeVar("T") def _assert_not_none(val...
(20, 30)
assert
collection
tests/test_render_frames.py
_verify_folder_single
316
null
nerfbaselines/nerfbaselines
import contextlib import sys import shutil import json from typing import cast from pathlib import Path import os import numpy as np from nerfbaselines import Method, MethodInfo, Cameras, RenderOutput, ModelInfo from nerfbaselines.utils import Indices from nerfbaselines.datasets import _colmap_utils as colmap_utils fro...
[13]
assert
collection
tests/test_train_render.py
test_train_command_extras
284
null
nerfbaselines/nerfbaselines
import json import sys import pytest from typing import Any, cast from unittest import mock from nerfbaselines import get_supported_methods, get_supported_datasets from nerfbaselines.results import render_markdown_dataset_results_table def mock_results(results_path, datasets, methods): from nerfbaselines import ge...
0
assert
numeric_literal
tests/test_results.py
assert_compile_dataset_results_correct
59
null