from flaky import flaky
from slm_lab.experiment.control import Trial
from slm_lab.experiment.monitor import InfoSpace
from slm_lab.lib import util
from slm_lab.spec import spec_util
import os
import pandas as pd
import pytest
import sys


# helper method to run all tests in test_spec
def run_trial_test(spec_file, spec_name=False):
    spec = spec_util.get(spec_file, spec_name)
    spec = spec_util.override_test_spec(spec)
    info_space = InfoSpace()
    info_space.tick('trial')
    trial = Trial(spec, info_space)
    trial_data = trial.run()
    assert isinstance(trial_data, pd.DataFrame)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/reinforce.json', 'reinforce_mlp_cartpole'),
    ('experimental/reinforce.json', 'reinforce_rnn_cartpole'),
    # ('experimental/reinforce.json', 'reinforce_conv_breakout'),
])
def test_reinforce(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/reinforce.json', 'reinforce_mlp_pendulum'),
    ('experimental/reinforce.json', 'reinforce_rnn_pendulum'),
])
def test_reinforce_cont(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/a2c.json', 'a2c_mlp_shared_cartpole'),
    ('experimental/a2c.json', 'a2c_mlp_separate_cartpole'),
    ('experimental/a2c.json', 'a2c_rnn_shared_cartpole'),
    ('experimental/a2c.json', 'a2c_rnn_separate_cartpole'),
    # ('experimental/a2c.json', 'a2c_conv_shared_breakout'),
    # ('experimental/a2c.json', 'a2c_conv_separate_breakout'),
    ('experimental/a2c.json', 'a2c_mlp_concat_cartpole'),
])
def test_a2c(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/a2c.json', 'a2c_mlp_shared_pendulum'),
    ('experimental/a2c.json', 'a2c_mlp_separate_pendulum'),
    ('experimental/a2c.json', 'a2c_rnn_shared_pendulum'),
    ('experimental/a2c.json', 'a2c_rnn_separate_pendulum'),
])
def test_a2c_cont(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/ppo.json', 'ppo_mlp_shared_cartpole'),
    ('experimental/ppo.json', 'ppo_mlp_separate_cartpole'),
    ('experimental/ppo.json', 'ppo_rnn_shared_cartpole'),
    ('experimental/ppo.json', 'ppo_rnn_separate_cartpole'),
    # ('experimental/ppo.json', 'ppo_conv_shared_breakout'),
    # ('experimental/ppo.json', 'ppo_conv_separate_breakout'),
])
def test_ppo(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/ppo.json', 'ppo_mlp_shared_pendulum'),
    ('experimental/ppo.json', 'ppo_mlp_separate_pendulum'),
    ('experimental/ppo.json', 'ppo_rnn_shared_pendulum'),
    ('experimental/ppo.json', 'ppo_rnn_separate_pendulum'),
])
def test_ppo_cont(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@flaky
@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/ppo_sil.json', 'ppo_sil_mlp_shared_cartpole'),
    ('experimental/ppo_sil.json', 'ppo_sil_mlp_separate_cartpole'),
    ('experimental/ppo_sil.json', 'ppo_sil_rnn_shared_cartpole'),
    ('experimental/ppo_sil.json', 'ppo_sil_rnn_separate_cartpole'),
])
def test_ppo_sil(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@flaky
@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/ppo_sil.json', 'ppo_sil_mlp_shared_pendulum'),
    ('experimental/ppo_sil.json', 'ppo_sil_mlp_separate_pendulum'),
    ('experimental/ppo_sil.json', 'ppo_sil_rnn_shared_pendulum'),
    ('experimental/ppo_sil.json', 'ppo_sil_rnn_separate_pendulum'),
])
def test_ppo_sil_cont(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@flaky
@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/sil.json', 'sil_mlp_shared_cartpole'),
    ('experimental/sil.json', 'sil_mlp_separate_cartpole'),
    ('experimental/sil.json', 'sil_rnn_shared_cartpole'),
    ('experimental/sil.json', 'sil_rnn_separate_cartpole'),
    # ('experimental/sil.json', 'sil_conv_shared_breakout'),
    # ('experimental/sil.json', 'sil_conv_separate_breakout'),
])
def test_sil(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@flaky
@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/sil.json', 'sil_mlp_shared_pendulum'),
    ('experimental/sil.json', 'sil_mlp_separate_pendulum'),
    ('experimental/sil.json', 'sil_rnn_shared_pendulum'),
    ('experimental/sil.json', 'sil_rnn_separate_pendulum'),
])
def test_sil_cont(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/sarsa.json', 'sarsa_mlp_boltzmann_cartpole'),
    ('experimental/sarsa.json', 'sarsa_mlp_epsilon_greedy_cartpole'),
    ('experimental/sarsa.json', 'sarsa_rnn_boltzmann_cartpole'),
    ('experimental/sarsa.json', 'sarsa_rnn_epsilon_greedy_cartpole'),
    # ('experimental/sarsa.json', 'sarsa_conv_boltzmann_breakout'),
    # ('experimental/sarsa.json', 'sarsa_conv_epsilon_greedy_breakout'),
])
def test_sarsa(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/dqn.json', 'vanilla_dqn_cartpole'),
    ('experimental/dqn.json', 'dqn_boltzmann_cartpole'),
    ('experimental/dqn.json', 'dqn_epsilon_greedy_cartpole'),
    ('experimental/dqn.json', 'drqn_boltzmann_cartpole'),
    ('experimental/dqn.json', 'drqn_epsilon_greedy_cartpole'),
    # ('experimental/dqn.json', 'dqn_boltzmann_breakout'),
    # ('experimental/dqn.json', 'dqn_epsilon_greedy_breakout'),
    ('experimental/dqn.json', 'dqn_stack_epsilon_greedy_lunar'),
])
def test_dqn(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/ddqn.json', 'ddqn_boltzmann_cartpole'),
    ('experimental/ddqn.json', 'ddqn_epsilon_greedy_cartpole'),
    ('experimental/ddqn.json', 'ddrqn_boltzmann_cartpole'),
    ('experimental/ddqn.json', 'ddrqn_epsilon_greedy_cartpole'),
    # ('experimental/ddqn.json', 'ddqn_boltzmann_breakout'),
    # ('experimental/ddqn.json', 'ddqn_epsilon_greedy_breakout'),
])
def test_ddqn(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/dueling_dqn.json', 'dueling_dqn_boltzmann_cartpole'),
    ('experimental/dueling_dqn.json', 'dueling_dqn_epsilon_greedy_cartpole'),
    # ('experimental/dueling_dqn.json', 'dueling_dqn_boltzmann_breakout'),
    # ('experimental/dueling_dqn.json', 'dueling_dqn_epsilon_greedy_breakout'),
])
def test_dueling_dqn(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/hydra_dqn.json', 'hydra_dqn_boltzmann_cartpole'),
    ('experimental/hydra_dqn.json', 'hydra_dqn_epsilon_greedy_cartpole'),
    # ('experimental/hydra_dqn.json', 'hydra_dqn_epsilon_greedy_cartpole_2dball'),
])
def test_hydra_dqn(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@flaky
@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/dqn.json', 'dqn_pong'),
    # ('experimental/a2c.json', 'a2c_pong'),
])
def test_atari(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('experimental/reinforce.json', 'reinforce_conv_vizdoom'),
])
def test_reinforce_vizdoom(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('base.json', 'base_case_unity'),
    ('base.json', 'base_case_openai'),
    ('random.json', 'random_cartpole'),
    ('random.json', 'random_pendulum'),
    # ('base.json', 'multi_agent'),
    # ('base.json', 'multi_agent_multi_env'),
])
def test_base(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)


@pytest.mark.parametrize('spec_file,spec_name', [
    ('base.json', 'multi_body'),
    ('base.json', 'multi_env'),
])
def test_base_multi(spec_file, spec_name):
    run_trial_test(spec_file, spec_name)

[((23, 1, 27, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(23, 25, 23, 46): '"""spec_file,spec_name"""', (23, 48, 27, 1): "[('experimental/reinforce.json', 'reinforce_mlp_cartpole'), (\n    'experimental/reinforce.json', 'reinforce_rnn_cartpole')]"}, {}), "('spec_file,spec_name', [(\n    'experimental/reinforce.json', 'reinforce_mlp_cartpole'), (\n    'experimental/reinforce.json', 'reinforce_rnn_cartpole')])", False, 'import pytest\n'), ((32, 1, 35, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(32, 25, 32, 46): '"""spec_file,spec_name"""', (32, 48, 35, 1): "[('experimental/reinforce.json', 'reinforce_mlp_pendulum'), (\n    'experimental/reinforce.json', 'reinforce_rnn_pendulum')]"}, {}), "('spec_file,spec_name', [(\n    'experimental/reinforce.json', 'reinforce_mlp_pendulum'), (\n    'experimental/reinforce.json', 'reinforce_rnn_pendulum')])", False, 'import pytest\n'), ((40, 1, 48, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(40, 25, 40, 46): '"""spec_file,spec_name"""', (40, 48, 48, 1): "[('experimental/a2c.json', 'a2c_mlp_shared_cartpole'), (\n    'experimental/a2c.json', 'a2c_mlp_separate_cartpole'), (\n    'experimental/a2c.json', 'a2c_rnn_shared_cartpole'), (\n    'experimental/a2c.json', 'a2c_rnn_separate_cartpole'), (\n    'experimental/a2c.json', 'a2c_mlp_concat_cartpole')]"}, {}), "('spec_file,spec_name', [('experimental/a2c.json',\n    'a2c_mlp_shared_cartpole'), ('experimental/a2c.json',\n    'a2c_mlp_separate_cartpole'), ('experimental/a2c.json',\n    'a2c_rnn_shared_cartpole'), ('experimental/a2c.json',\n    'a2c_rnn_separate_cartpole'), ('experimental/a2c.json',\n    'a2c_mlp_concat_cartpole')])", False, 'import pytest\n'), ((53, 1, 58, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(53, 25, 53, 46): '"""spec_file,spec_name"""', (53, 48, 58, 1): "[('experimental/a2c.json', 'a2c_mlp_shared_pendulum'), (\n    'experimental/a2c.json', 'a2c_mlp_separate_pendulum'), (\n    'experimental/a2c.json', 'a2c_rnn_shared_pendulum'), (\n    'experimental/a2c.json', 'a2c_rnn_separate_pendulum')]"}, {}), "('spec_file,spec_name', [('experimental/a2c.json',\n    'a2c_mlp_shared_pendulum'), ('experimental/a2c.json',\n    'a2c_mlp_separate_pendulum'), ('experimental/a2c.json',\n    'a2c_rnn_shared_pendulum'), ('experimental/a2c.json',\n    'a2c_rnn_separate_pendulum')])", False, 'import pytest\n'), ((63, 1, 70, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(63, 25, 63, 46): '"""spec_file,spec_name"""', (63, 48, 70, 1): "[('experimental/ppo.json', 'ppo_mlp_shared_cartpole'), (\n    'experimental/ppo.json', 'ppo_mlp_separate_cartpole'), (\n    'experimental/ppo.json', 'ppo_rnn_shared_cartpole'), (\n    'experimental/ppo.json', 'ppo_rnn_separate_cartpole')]"}, {}), "('spec_file,spec_name', [('experimental/ppo.json',\n    'ppo_mlp_shared_cartpole'), ('experimental/ppo.json',\n    'ppo_mlp_separate_cartpole'), ('experimental/ppo.json',\n    'ppo_rnn_shared_cartpole'), ('experimental/ppo.json',\n    'ppo_rnn_separate_cartpole')])", False, 'import pytest\n'), ((75, 1, 80, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(75, 25, 75, 46): '"""spec_file,spec_name"""', (75, 48, 80, 1): "[('experimental/ppo.json', 'ppo_mlp_shared_pendulum'), (\n    'experimental/ppo.json', 'ppo_mlp_separate_pendulum'), (\n    'experimental/ppo.json', 'ppo_rnn_shared_pendulum'), (\n    'experimental/ppo.json', 'ppo_rnn_separate_pendulum')]"}, {}), "('spec_file,spec_name', [('experimental/ppo.json',\n    'ppo_mlp_shared_pendulum'), ('experimental/ppo.json',\n    'ppo_mlp_separate_pendulum'), ('experimental/ppo.json',\n    'ppo_rnn_shared_pendulum'), ('experimental/ppo.json',\n    'ppo_rnn_separate_pendulum')])", False, 'import pytest\n'), ((86, 1, 91, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(86, 25, 86, 46): '"""spec_file,spec_name"""', (86, 48, 91, 1): "[('experimental/ppo_sil.json', 'ppo_sil_mlp_shared_cartpole'), (\n    'experimental/ppo_sil.json', 'ppo_sil_mlp_separate_cartpole'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_shared_cartpole'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_separate_cartpole')]"}, {}), "('spec_file,spec_name', [(\n    'experimental/ppo_sil.json', 'ppo_sil_mlp_shared_cartpole'), (\n    'experimental/ppo_sil.json', 'ppo_sil_mlp_separate_cartpole'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_shared_cartpole'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_separate_cartpole')])", False, 'import pytest\n'), ((97, 1, 102, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(97, 25, 97, 46): '"""spec_file,spec_name"""', (97, 48, 102, 1): "[('experimental/ppo_sil.json', 'ppo_sil_mlp_shared_pendulum'), (\n    'experimental/ppo_sil.json', 'ppo_sil_mlp_separate_pendulum'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_shared_pendulum'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_separate_pendulum')]"}, {}), "('spec_file,spec_name', [(\n    'experimental/ppo_sil.json', 'ppo_sil_mlp_shared_pendulum'), (\n    'experimental/ppo_sil.json', 'ppo_sil_mlp_separate_pendulum'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_shared_pendulum'), (\n    'experimental/ppo_sil.json', 'ppo_sil_rnn_separate_pendulum')])", False, 'import pytest\n'), ((108, 1, 115, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(108, 25, 108, 46): '"""spec_file,spec_name"""', (108, 48, 115, 1): "[('experimental/sil.json', 'sil_mlp_shared_cartpole'), (\n    'experimental/sil.json', 'sil_mlp_separate_cartpole'), (\n    'experimental/sil.json', 'sil_rnn_shared_cartpole'), (\n    'experimental/sil.json', 'sil_rnn_separate_cartpole')]"}, {}), "('spec_file,spec_name', [('experimental/sil.json',\n    'sil_mlp_shared_cartpole'), ('experimental/sil.json',\n    'sil_mlp_separate_cartpole'), ('experimental/sil.json',\n    'sil_rnn_shared_cartpole'), ('experimental/sil.json',\n    'sil_rnn_separate_cartpole')])", False, 'import pytest\n'), ((121, 1, 126, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(121, 25, 121, 46): '"""spec_file,spec_name"""', (121, 48, 126, 1): "[('experimental/sil.json', 'sil_mlp_shared_pendulum'), (\n    'experimental/sil.json', 'sil_mlp_separate_pendulum'), (\n    'experimental/sil.json', 'sil_rnn_shared_pendulum'), (\n    'experimental/sil.json', 'sil_rnn_separate_pendulum')]"}, {}), "('spec_file,spec_name', [('experimental/sil.json',\n    'sil_mlp_shared_pendulum'), ('experimental/sil.json',\n    'sil_mlp_separate_pendulum'), ('experimental/sil.json',\n    'sil_rnn_shared_pendulum'), ('experimental/sil.json',\n    'sil_rnn_separate_pendulum')])", False, 'import pytest\n'), ((131, 1, 138, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(131, 25, 131, 46): '"""spec_file,spec_name"""', (131, 48, 138, 1): "[('experimental/sarsa.json', 'sarsa_mlp_boltzmann_cartpole'), (\n    'experimental/sarsa.json', 'sarsa_mlp_epsilon_greedy_cartpole'), (\n    'experimental/sarsa.json', 'sarsa_rnn_boltzmann_cartpole'), (\n    'experimental/sarsa.json', 'sarsa_rnn_epsilon_greedy_cartpole')]"}, {}), "('spec_file,spec_name', [('experimental/sarsa.json',\n    'sarsa_mlp_boltzmann_cartpole'), ('experimental/sarsa.json',\n    'sarsa_mlp_epsilon_greedy_cartpole'), ('experimental/sarsa.json',\n    'sarsa_rnn_boltzmann_cartpole'), ('experimental/sarsa.json',\n    'sarsa_rnn_epsilon_greedy_cartpole')])", False, 'import pytest\n'), ((143, 1, 152, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(143, 25, 143, 46): '"""spec_file,spec_name"""', (143, 48, 152, 1): "[('experimental/dqn.json', 'vanilla_dqn_cartpole'), (\n    'experimental/dqn.json', 'dqn_boltzmann_cartpole'), (\n    'experimental/dqn.json', 'dqn_epsilon_greedy_cartpole'), (\n    'experimental/dqn.json', 'drqn_boltzmann_cartpole'), (\n    'experimental/dqn.json', 'drqn_epsilon_greedy_cartpole'), (\n    'experimental/dqn.json', 'dqn_stack_epsilon_greedy_lunar')]"}, {}), "('spec_file,spec_name', [('experimental/dqn.json',\n    'vanilla_dqn_cartpole'), ('experimental/dqn.json',\n    'dqn_boltzmann_cartpole'), ('experimental/dqn.json',\n    'dqn_epsilon_greedy_cartpole'), ('experimental/dqn.json',\n    'drqn_boltzmann_cartpole'), ('experimental/dqn.json',\n    'drqn_epsilon_greedy_cartpole'), ('experimental/dqn.json',\n    'dqn_stack_epsilon_greedy_lunar')])", False, 'import pytest\n'), ((157, 1, 164, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(157, 25, 157, 46): '"""spec_file,spec_name"""', (157, 48, 164, 1): "[('experimental/ddqn.json', 'ddqn_boltzmann_cartpole'), (\n    'experimental/ddqn.json', 'ddqn_epsilon_greedy_cartpole'), (\n    'experimental/ddqn.json', 'ddrqn_boltzmann_cartpole'), (\n    'experimental/ddqn.json', 'ddrqn_epsilon_greedy_cartpole')]"}, {}), "('spec_file,spec_name', [('experimental/ddqn.json',\n    'ddqn_boltzmann_cartpole'), ('experimental/ddqn.json',\n    'ddqn_epsilon_greedy_cartpole'), ('experimental/ddqn.json',\n    'ddrqn_boltzmann_cartpole'), ('experimental/ddqn.json',\n    'ddrqn_epsilon_greedy_cartpole')])", False, 'import pytest\n'), ((169, 1, 174, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(169, 25, 169, 46): '"""spec_file,spec_name"""', (169, 48, 174, 1): "[('experimental/dueling_dqn.json', 'dueling_dqn_boltzmann_cartpole'), (\n    'experimental/dueling_dqn.json', 'dueling_dqn_epsilon_greedy_cartpole')]"}, {}), "('spec_file,spec_name', [(\n    'experimental/dueling_dqn.json', 'dueling_dqn_boltzmann_cartpole'), (\n    'experimental/dueling_dqn.json', 'dueling_dqn_epsilon_greedy_cartpole')])", False, 'import pytest\n'), ((179, 1, 183, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(179, 25, 179, 46): '"""spec_file,spec_name"""', (179, 48, 183, 1): "[('experimental/hydra_dqn.json', 'hydra_dqn_boltzmann_cartpole'), (\n    'experimental/hydra_dqn.json', 'hydra_dqn_epsilon_greedy_cartpole')]"}, {}), "('spec_file,spec_name', [(\n    'experimental/hydra_dqn.json', 'hydra_dqn_boltzmann_cartpole'), (\n    'experimental/hydra_dqn.json', 'hydra_dqn_epsilon_greedy_cartpole')])", False, 'import pytest\n'), ((189, 1, 192, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(189, 25, 189, 46): '"""spec_file,spec_name"""', (189, 48, 192, 1): "[('experimental/dqn.json', 'dqn_pong')]"}, {}), "('spec_file,spec_name', [('experimental/dqn.json',\n    'dqn_pong')])", False, 'import pytest\n'), ((197, 1, 199, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(197, 25, 197, 46): '"""spec_file,spec_name"""', (197, 48, 199, 1): "[('experimental/reinforce.json', 'reinforce_conv_vizdoom')]"}, {}), "('spec_file,spec_name', [(\n    'experimental/reinforce.json', 'reinforce_conv_vizdoom')])", False, 'import pytest\n'), ((204, 1, 211, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(204, 25, 204, 46): '"""spec_file,spec_name"""', (204, 48, 211, 1): "[('base.json', 'base_case_unity'), ('base.json', 'base_case_openai'), (\n    'random.json', 'random_cartpole'), ('random.json', 'random_pendulum')]"}, {}), "('spec_file,spec_name', [('base.json',\n    'base_case_unity'), ('base.json', 'base_case_openai'), ('random.json',\n    'random_cartpole'), ('random.json', 'random_pendulum')])", False, 'import pytest\n'), ((216, 1, 219, 2), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(216, 25, 216, 46): '"""spec_file,spec_name"""', (216, 48, 219, 1): "[('base.json', 'multi_body'), ('base.json', 'multi_env')]"}, {}), "('spec_file,spec_name', [('base.json', 'multi_body'),\n    ('base.json', 'multi_env')])", False, 'import pytest\n'), ((14, 11, 14, 46), 'slm_lab.spec.spec_util.get', 'spec_util.get', ({(14, 25, 14, 34): 'spec_file', (14, 36, 14, 45): 'spec_name'}, {}), '(spec_file, spec_name)', False, 'from slm_lab.spec import spec_util\n'), ((15, 11, 15, 45), 'slm_lab.spec.spec_util.override_test_spec', 'spec_util.override_test_spec', ({(15, 40, 15, 44): 'spec'}, {}), '(spec)', False, 'from slm_lab.spec import spec_util\n'), ((16, 17, 16, 28), 'slm_lab.experiment.monitor.InfoSpace', 'InfoSpace', ({}, {}), '()', False, 'from slm_lab.experiment.monitor import InfoSpace\n'), ((18, 12, 18, 35), 'slm_lab.experiment.control.Trial', 'Trial', ({(18, 18, 18, 22): 'spec', (18, 24, 18, 34): 'info_space'}, {}), '(spec, info_space)', False, 'from slm_lab.experiment.control import Trial\n')]