def get_endpoint_region(endpoint):
    return endpoint.get('region_id') or endpoint.get('region')
Common function for getting the region from endpoint.
dataset/ETHPy150Open openstack/django_openstack_auth/openstack_auth/utils.py/get_endpoint_region