def assert_equivalent_trials(A: int, B: int, validation_metrics: List[str]) -> None:
    full_trial_metrics1 = trial_metrics(A)
    full_trial_metrics2 = trial_metrics(B)
    assert (len(full_trial_metrics1['steps']) == len(full_trial_metrics2['steps']))
    for (step1, step2) in zip(full_trial_metrics1['steps'], full_trial_metrics2['steps']):
        metric1 = step1['metrics']['batch_metrics']
        metric2 = step2['metrics']['batch_metrics']
        for (batch1, batch2) in zip(metric1, metric2):
            assert (len(batch1) == len(batch2) == 2)
            assert (batch1['loss'] == pytest.approx(batch2['loss']))
        if ((step1['validation'] is not None) or (step2['validation'] is not None)):
            assert (step1['validation'] is not None)
            assert (step2['validation'] is not None)
            for metric in validation_metrics:
                val1 = step1.get('validation').get('metrics').get('validation_metrics').get(metric)
                val2 = step2.get('validation').get('metrics').get('validation_metrics').get(metric)
                assert (val1 == pytest.approx(val2))
def assert_equivalent_trials(A: int, B: int, validation_metrics: List[str]) -> None:
    full_trial_metrics1 = trial_metrics(A)
    full_trial_metrics2 = trial_metrics(B)
    assert (len(full_trial_metrics1['steps']) == len(full_trial_metrics2['steps']))
    for (step1, step2) in zip(full_trial_metrics1['steps'], full_trial_metrics2['steps']):
        metric1 = step1['metrics']['batch_metrics']
        metric2 = step2['metrics']['batch_metrics']
        for (batch1, batch2) in zip(metric1, metric2):
            assert (len(batch1) == len(batch2) == 2)
            assert (batch1['loss'] == pytest.approx(batch2['loss']))
        if ((step1['validation'] is not None) or (step2['validation'] is not None)):
            assert (step1['validation'] is not None)
            assert (step2['validation'] is not None)
            for metric in validation_metrics:
                val1 = step1.get('validation').get('metrics').get('validation_metrics').get(metric)
                val2 = step2.get('validation').get('metrics').get('validation_metrics').get(metric)
                assert (val1 == pytest.approx(val2))