repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_image.py
test_to_uint8
assert_*
collection
11
import pytest from PIL import Image import numpy as np def test_to_uint8(): from terracotta import image data = np.array([-50, 0, 10, 255, 256, 1000]) np.t
[1, 13, 16, 75, 75, 255])
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_image.py
test_array_to_png_singleband_invalid
pytest.raises
complex_expr
10
import pytest from PIL import Image import numpy as np def test_array_to_png_singleband_invalid(): from terracotta import image, exceptions with pytest.raises(
exceptions.InvalidArgumentsError)
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_image.py
test_contrast_stretch
assert_*
func_call
16
import pytest from PIL import Image import numpy as np def test_contrast_stretch(): from terracotta import image data = np.arange(0, 10) np.testing.assert_array_equal( image.contrast_stretch(data, (0, 10), (10, 20)), np.arange(10, 20) ) np.t
np.array([10, 10, 10, 10, 10, 10, 20, 20, 20, 20]))
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_logs.py
test_logstream
assert
numeric_literal
13
import logging def test_logstream(caplog, capsys): from terracotta import logs assert logs.use_colors logger = logs.set_logger('DEBUG') caplog.set_level('DEBUG', logger='terracotta') logger.warning('test') log_out = caplog.records assert len(log_out) ==
1
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_logs.py
test_logstream
assert
complex_expr
19
import logging def test_logstream(caplog, capsys): from terracotta import logs assert logs.use_colors logger = logs.set_logger('DEBUG') caplog.set_level('DEBUG', logger='terracotta') logger.warning('test') log_out = caplog.records assert len(log_out) == 1 log_out = log_out[0] asse...
captured.err
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_logs.py
test_logstream
assert
complex_expr
15
import logging def test_logstream(caplog, capsys): from terracotta import logs assert logs.use_colors logger = logs.set_logger('DEBUG') caplog.set_level('DEBUG', logger='terracotta') logger.warning('test') log_out = caplog.records assert len(log_out) == 1 log_out = log_out[0] ass...
log_out.message
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_logs.py
test_logstream
assert
complex_expr
16
import logging def test_logstream(caplog, capsys): from terracotta import logs assert logs.use_colors logger = logs.set_logger('DEBUG') caplog.set_level('DEBUG', logger='terracotta') logger.warning('test') log_out = caplog.records assert len(log_out) == 1 log_out = log_out[0] asse...
log_out.levelshortname
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_profile.py
run_test
assert
numeric_literal
20
import pytest import time from moto import mock_xray_client, XRaySegment @mock_xray_client def run_test(): from terracotta import update_settings import terracotta.profile update_settings(XRAY_PROFILE=True) with XRaySegment(): with pytest.raises(NotImplementedErr...
1
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_profile.py
run_test
assert
string_literal
21
import pytest import time from moto import mock_xray_client, XRaySegment @mock_xray_client def run_test(): from terracotta import update_settings import terracotta.profile update_settings(XRAY_PROFILE=True) with XRaySegment(): with pytest.raises(NotImplementedErr...
'foo'
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_profile.py
run_test
assert
string_literal
27
import pytest import time from moto import mock_xray_client, XRaySegment @mock_xray_client def run_test(): from terracotta import update_settings import terracotta.profile update_settings(XRAY_PROFILE=True) @terracotta.profile.trace('dummy') def func_to_trace(): ...
'ERROR'
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_profile.py
run_test
pytest.raises
variable
16
import pytest import time from moto import mock_xray_client, XRaySegment @mock_xray_client def run_test(): from terracotta import update_settings import terracotta.profile update_settings(XRAY_PROFILE=True) with XRaySegment(): with pytest.raises(
NotImplementedError)
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_compute_metadata
assert
numeric_literal
81
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
1e-6
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_compute_metadata_approximate
assert
numeric_literal
69
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
0.05
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_invalid_resampling_method
assert
func_call
34
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
str(exc)
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_get_raster_no_nodata
assert
variable
34
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
tile_size
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_get_raster_tile
assert
collection
41
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
(256, 256)
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_invalid_resampling_method
pytest.raises
variable
32
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
ValueError)
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_compute_metadata
assert_*
func_call
72
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
valid_data.std())
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_compute_metadata
assert_*
func_call
71
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
valid_data.mean())
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DHI/terracotta
9897c84639f721589be21ffd94721c53f656f2b0
62
train
train
tests/test_raster.py
test_compute_metadata
assert
func_call
61
import pytest import numpy as np import rasterio import rasterio.features from shapely.geometry import shape, MultiPolygon def geometry_mismatch(shape1, shape2): """Compute relative mismatch of two shapes""" return shape1.symmetric_difference(shape2).area / shape1.union(shape2).area def convex_hull_exact(src...
str(record[0].message)
9897c84639f721589be21ffd94721c53f656f2b0
62
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_buffers.py
test_device_buffer
assert
variable
54
import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3.common.buffers import DictReplayBuffer, DictRolloutBuffer, ReplayBuffer, RolloutBuffer from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.env_util import...
desired_device
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_eval_success_logging
assert
numeric_literal
48
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_eval_success_logging
assert
numeric_literal
50
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
0.5
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_eval_callback_vec_env
assert
numeric_literal
42
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
100.0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_callbacks
assert
variable
101
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
max_episodes
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_eval_friendly_error
pytest.raises
variable
56
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
AssertionError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_callbacks
assert
variable
103
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
max_episode_length
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_callbacks
assert
complex_expr
76
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
model.num_timesteps
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_callbacks.py
test_callbacks
assert
complex_expr
72
import os import shutil import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( CallbackList, CheckpointCallback, EvalCallback, EveryNTimesteps, StopTrainingOnMaxEpisodes,...
callback.locals["new_obs"]
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_cnn.py
test_image_like_input
pytest.raises
variable
75
import os from copy import deepcopy import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.envs import FakeImageEnv from stable_baselines3.common.preprocessing import is_image_space, is_image_space_channels_f...
AssertionError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_cnn.py
test_features_extractor_target_net
assert
func_call
63
import os from copy import deepcopy import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.envs import FakeImageEnv from stable_baselines3.common.preprocessing import is_image_space, is_image_space_channels_f...
id(model.policy.critic.features_extractor)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_cnn.py
test_features_extractor_target_net
assert
func_call
65
import os from copy import deepcopy import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.envs import FakeImageEnv from stable_baselines3.common.preprocessing import is_image_space, is_image_space_channels_f...
id(model.policy.critic_target.features_extractor)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_deterministic.py
test_deterministic_training_common
assert
func_call
39
import numpy as np import pytest from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.noise import NormalActionNoise N_STEPS_TRAINING = 500 SEED = 0 @pytest.mark.parametrize("algo", [A2C, DQN, PPO, SAC, TD3]) def test_deterministic_training_common(algo): results = [[], []] rewa...
sum(results[1])
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_deterministic.py
test_deterministic_training_common
assert
func_call
40
import numpy as np import pytest from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.noise import NormalActionNoise N_STEPS_TRAINING = 500 SEED = 0 @pytest.mark.parametrize("algo", [A2C, DQN, PPO, SAC, TD3]) def test_deterministic_training_common(algo): results = [[], []] rewa...
sum(rewards[1])
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_dict_env.py
test_vec_normalize_image
assert
complex_expr
18
from typing import Dict, Optional import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.env_util import make_vec_env from stable_baseline...
np.float32
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_dict_env.py
test_policy_hint
pytest.raises
variable
19
from typing import Dict, Optional import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.env_util import make_vec_env from stable_baseline...
ValueError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_dict_env.py
test_dict_nested
pytest.raises
variable
23
from typing import Dict, Optional import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.env_util import make_vec_env from stable_baseline...
NotImplementedError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_distributions.py
test_bijector
assert
numeric_literal
36
from copy import deepcopy from typing import Tuple import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, PPO from stable_baselines3.common.distributions import ( BernoulliDistribution, CategoricalDistribution, DiagGaussianDistribution, MultiCate...
1.0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_distributions.py
test_get_distribution
assert
none_literal
48
from copy import deepcopy from typing import Tuple import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, PPO from stable_baselines3.common.distributions import ( BernoulliDistribution, CategoricalDistribution, DiagGaussianDistribution, MultiCate...
None
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_env_checker.py
__init__
assert
numeric_literal
18
from typing import Any, Dict, Optional, Tuple import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env class LimitedStepsTestEnv(gym.Env): action_space = spaces.Discrete(n=2) observation_space = spaces.Discrete(n=2) ...
1
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_env_checker.py
test_check_env_detailed_error
pytest.raises
complex_expr
97
from typing import Any, Dict, Optional, Tuple import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env @pytest.mark.parametrize( "obs_tuple", [ # Above upper bound ( spaces.Box(low=np.array([0....
AssertionError, match=error_message)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_envs.py
test_custom_envs
assert
numeric_literal
37
import types import warnings import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import ( BitFlippingEnv, FakeImageEnv, IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinar...
0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_envs.py
test_env
assert
numeric_literal
45
import types import warnings import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import ( BitFlippingEnv, FakeImageEnv, IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinar...
1
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_envs.py
test_common_failures_reset
pytest.raises
variable
69
import types import warnings import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import ( BitFlippingEnv, FakeImageEnv, IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinar...
TypeError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_envs.py
test_non_default_action_spaces
pytest.raises
variable
78
import types import warnings import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import ( BitFlippingEnv, FakeImageEnv, IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinar...
ValueError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_envs.py
test_bit_flipping
pytest.raises
variable
52
import types import warnings import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import ( BitFlippingEnv, FakeImageEnv, IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinar...
AssertionError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_envs.py
test_common_failures_reset
assert
func_call
94
import types import warnings import gymnasium as gym import numpy as np import pytest from gymnasium import spaces from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import ( BitFlippingEnv, FakeImageEnv, IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinar...
str(excinfo.value)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_gae.py
test_infinite_horizon
assert
numeric_literal
49
from typing import Dict, Optional import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3 import A2C, PPO, SAC from stable_baselines3.common.callbacks import BaseCallback from stable_baselines3.common.env_checker import check_env from stable_base...
1.0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load
assert
numeric_literal
94
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
2
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load
assert
numeric_literal
119
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
3
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load_replay_buffer
assert
numeric_literal
61
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load_replay_buffer
assert
numeric_literal
66
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
1
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load
assert
numeric_literal
118
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
2.0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_goal_selection_strategy
assert
none_literal
59
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
None
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_performance_her
assert
numeric_literal
56
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
0.90
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_import_error
pytest.raises
variable
21
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
ImportError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load_replay_buffer
pytest.raises
variable
57
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
AttributeError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_import_error
assert
func_call
25
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
str(excinfo.value)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load_replay_buffer
assert
func_call
68
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
str(warning.message)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_her.py
test_save_load
assert
complex_expr
96
import os import pathlib import warnings from copy import deepcopy import numpy as np import pytest import torch as th from stable_baselines3 import DDPG, DQN, SAC, TD3, HerReplayBuffer from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.envs import BitFlippingEnv from stable_base...
custom_objects["learning_rate"]
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_identity.py
test_discrete
assert
func_call
30
import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.envs import IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinary, IdentityEnvMultiDiscrete from stable_baselines3.common.evaluation import evaluate_policy from stable_baselines3.common.noise import...
np.shape(obs)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_set_logger
assert
numeric_literal
110
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
2
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_set_logger
assert
numeric_literal
118
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
3
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_set_logger
assert
collection
91
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
[]
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_key_length
assert
numeric_literal
91
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
36
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_main
assert
variable
93
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
INFO
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_main
assert
variable
95
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
DEBUG
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_make_output_fail
pytest.raises
variable
90
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
ValueError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_set_logger
assert
variable
101
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
new_tmp_path
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_main
assert
func_call
98
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
str(tmp_path)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_human_output_format_custom_test_io
assert
variable
125
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
desired_printed
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_ep_buffers_stats_window_size
assert
variable
96
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
stats_window_size
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_report_video_to_unsupported_format_raises_error
assert
func_call
96
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
str(exec_info.value)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_logger.py
test_report_video_to_unsupported_format_raises_error
pytest.raises
variable
93
import importlib.util import os import sys import time from io import TextIOBase from typing import Sequence from unittest import mock import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from matplotlib import pyplot as plt from pandas.errors import EmptyDataError ...
FormatUnsupportedError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor_load_results
assert
numeric_literal
22
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor_load_results(tmp_path): """ test load_results on log files produced by the monitor wrapper """ tmp_path = str(tmp_path) en...
1
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor_load_results
assert
numeric_literal
41
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor_load_results(tmp_path): """ test load_results on log files produced by the monitor wrapper """ tmp_path = str(tmp_path) en...
2
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor
assert
bool_literal
56
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor(tmp_path): """ Test the monitor wrapper """ env = gym.make("CartPole-v1") env.reset(seed=0) monitor_file = os.path.joi...
True
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor
assert
bool_literal
54
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor(tmp_path): """ Test the monitor wrapper """ env = gym.make("CartPole-v1") env.reset(seed=0) monitor_file = os.path.joi...
False
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor
assert
variable
35
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor(tmp_path): """ Test the monitor wrapper """ env = gym.make("CartPole-v1") env.reset(seed=0) monitor_file = os.path.joi...
total_steps
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor
assert
string_literal
44
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor(tmp_path): """ Test the monitor wrapper """ env = gym.make("CartPole-v1") env.reset(seed=0) monitor_file = os.path.joi...
"CartPole-v1"
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor_load_results
assert
variable
23
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor_load_results(tmp_path): """ test load_results on log files produced by the monitor wrapper """ tmp_path = str(tmp_path) en...
monitor_files
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_monitor.py
test_monitor
assert
func_call
37
import json import os import uuid import gymnasium as gym import pandas from stable_baselines3.common.monitor import Monitor, get_monitor_files, load_results def test_monitor(tmp_path): """ Test the monitor wrapper """ env = gym.make("CartPole-v1") env.reset(seed=0) monitor_file = os.path.joi...
sum(ep_rewards)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_predict.py
test_predict
assert
complex_expr
52
import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import IdentityEnv from stable_baselines3.common.utils import get_...
vec_env_obs.shape[0]
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_predict.py
test_predict
assert
complex_expr
46
import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import IdentityEnv from stable_baselines3.common.utils import get_...
env.action_space.shape
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_predict.py
test_predict
assert
complex_expr
38
import gymnasium as gym import numpy as np import pytest import torch as th from gymnasium import spaces from stable_baselines3 import A2C, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.envs import IdentityEnv from stable_baselines3.common.utils import get_...
model.policy.device.type
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_preprocessing.py
test_get_obs_shape_discrete
assert
collection
8
import torch from gymnasium import spaces from stable_baselines3.common.preprocessing import get_obs_shape, preprocess_obs def test_get_obs_shape_discrete(): assert get_obs_shape(spaces.Discrete(3)) ==
(1,)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_preprocessing.py
test_get_obs_shape_multidiscrete
assert
collection
8
import torch from gymnasium import spaces from stable_baselines3.common.preprocessing import get_obs_shape, preprocess_obs def test_get_obs_shape_multidiscrete(): assert get_obs_shape(spaces.MultiDiscrete([3, 2])) ==
(2,)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_preprocessing.py
test_get_obs_shape_multibinary
assert
collection
8
import torch from gymnasium import spaces from stable_baselines3.common.preprocessing import get_obs_shape, preprocess_obs def test_get_obs_shape_multibinary(): assert get_obs_shape(spaces.MultiBinary(3)) ==
(3,)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_preprocessing.py
test_get_obs_shape_multidimensional_multibinary
assert
collection
8
import torch from gymnasium import spaces from stable_baselines3.common.preprocessing import get_obs_shape, preprocess_obs def test_get_obs_shape_multidimensional_multibinary(): assert get_obs_shape(spaces.MultiBinary([3, 2])) ==
(3, 2)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_preprocessing.py
test_preprocess_obs_discrete
assert_*
variable
10
import torch from gymnasium import spaces from stable_baselines3.common.preprocessing import get_obs_shape, preprocess_obs def test_preprocess_obs_discrete(): actual = preprocess_obs(torch.tensor([2], dtype=torch.long), spaces.Discrete(3)) expected = torch.tensor([[0.0, 0.0, 1.0]], dtype=torch.float32) t...
expected)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_run.py
test_ppo_warnings
assert
numeric_literal
34
import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise normal_action_noise = NormalActionNoise(np.zeros(1)...
0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_run.py
test_train_freq_fail
pytest.raises
variable
14
import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise normal_action_noise = NormalActionNoise(np.zeros(1)...
ValueError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_run.py
test_ppo_warnings
pytest.raises
variable
17
import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise normal_action_noise = NormalActionNoise(np.zeros(1)...
AssertionError)
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_run.py
test_offpolicy_multi_env
assert
complex_expr
61
import gymnasium as gym import numpy as np import pytest from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise normal_action_noise = NormalActionNoise(np.zeros(1)...
train_freq * env.num_envs
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_save_load.py
test_exclude_include_saved_params
assert
numeric_literal
53
import base64 import io import json import os import pathlib import warnings import zipfile from collections import OrderedDict from copy import deepcopy import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.commo...
2
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_save_load.py
test_warn_buffer
assert
numeric_literal
66
import base64 import io import json import os import pathlib import warnings import zipfile from collections import OrderedDict from copy import deepcopy import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.commo...
0
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_save_load.py
test_warn_buffer
assert
numeric_literal
71
import base64 import io import json import os import pathlib import warnings import zipfile from collections import OrderedDict from copy import deepcopy import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.commo...
1
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_save_load.py
test_open_file
assert
variable
53
import base64 import io import json import os import pathlib import warnings import zipfile from collections import OrderedDict from copy import deepcopy import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.commo...
_
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_save_load.py
test_set_env
assert
numeric_literal
67
import base64 import io import json import os import pathlib import warnings import zipfile from collections import OrderedDict from copy import deepcopy import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.commo...
64
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor
DLR-RM/stable-baselines3
16c6a886db529bdff2a1d084126f60888c132695
175
train
train
tests/test_save_load.py
test_dqn_target_update_interval
assert
numeric_literal
44
import base64 import io import json import os import pathlib import warnings import zipfile from collections import OrderedDict from copy import deepcopy import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3 from stable_baselines3.commo...
100
16c6a886db529bdff2a1d084126f60888c132695
175
v2_extractor_at_anchor