def copy_with_meta(class_to_copy, meta_src):
    """
    Return a copy of "class_to_copy" but with metadata
    (n_actions and n_obs) copied from meta_src. Usually
    class_to_copy is an agent-class and meta_src is an
    environment-class in whose instances instances of
    class_to_copy are to be run.
    """
    class result(class_to_copy):
        n_actions, n_obs = meta_src.n_actions, meta_src.n_obs

    result.__name__ = class_to_copy.__name__
    result.__qualname__ = class_to_copy.__qualname__
    return result