def METHOD_NAME(obs):
    """Flatten a dict to a vector.
    Copied from https://github.com/denisyarats/dmc2gym
    """
    obs_pieces = []
    for v in obs.values():
        flat = np.array([v]) if np.isscalar(v) else v.ravel()
        obs_pieces.append(flat)
    return np.concatenate(obs_pieces, axis=0)