def create_training_data(algorithm_env, n=5):
    """Samples from algorithm env and creates 4 variants per sample.

    - executable code sample (Estimator class)
    - executable code sample (Estimator instance)
    - non-executable partially randomized code
    - non-executable fully randomized code
    """
    training_data = []
    for i in range(n):
        sample_data = algorithm_env.sample_algorithm_code()
        training_data.extend([sample_data, algorithm_env.
            algorithm_obj_to_instance(sample_data)])
    return training_data
