def get_spaces(spaces):
    if hasattr(spaces, 'spaces'):
        return zip(*[get_space(space) for space in spaces.spaces])
    else:
        return [(ret,) for ret in get_space(spaces)]
def get_spaces(spaces):
    if hasattr(spaces, 'spaces'):
        return zip(*[get_space(space) for space in spaces.spaces])
    else:
        return [(ret,) for ret in get_space(spaces)]