def _get_endpoint_region(endpoint):
 return (endpoint.get('region_id') or endpoint.get('region'))

def _get_endpoint_region ( endpoint ) : return ( endpoint . get ( 'region_id' ) or endpoint . get ( 'region' ) )
common function for getting the region from endpoint .