def get_spaces(deployment_name,
               token_manager=None,
               app_url=defaults.APP_URL):
    """
    get the list of spaces currently in the deployment specified

    """
    deployment_id = get_deployment_id(deployment_name,
                                      token_manager=token_manager,
                                      app_url=app_url)

    headers = token_manager.get_access_token_headers()
    deployment_url = environment.get_deployment_url(app_url=app_url)
    response = requests.get('%s/api/v1/deployments/%s/spaces' %
                            (deployment_url, deployment_id),
                            headers=headers)

    if response.status_code == 200:
        return response.json()
    else:
        raise JutException('Error %s: %s' % (response.status_code, response.text))
dataset/ETHPy150Open jut-io/jut-python-tools/jut/api/deployments.py/get_spaces/original