@_assure_identity
def set_credentials(username, api_key=None, password=None, region=None,
        tenant_id=None, authenticate=True):
    global regions, services
    pw_key = password or api_key
    region = _safe_region(region)
    tenant_id = tenant_id or settings.get("tenant_id")
    identity.set_credentials(username=username, password=pw_key,
            tenant_id=tenant_id, region=region, authenticate=authenticate)
    regions = tuple(identity.regions)
    services = tuple(identity.services.keys())
    connect_to_services(region=region)
About the simplest problem you could ask for:
dataset/ETHPy150Open rackspace/pyrax/pyrax/__init__.py/set_credentials--crossover with--dataset/ETHPy150Open hyperopt/hyperopt/hyperopt/tests/test_domains.py/quadratic1