@memoized
def _get_service_url(request):
    """Get freezer api url"""
    hardcoded_url = getattr(settings, 'FREEZER_API_URL', None)
    if hardcoded_url is not None:
        LOG.warn('Using hardcoded FREEZER_API_URL: {0}'.format(hardcoded_url))
        return hardcoded_url

    e_type = getattr(settings, 'OPENSTACK_ENDPOINT_TYPE', '')
    endpoint_type_priority = [e_type, ['internal', 'internalURL'], ['public',
                              'publicURL']]

    try:
        catalog = (getattr(request.user, "service_catalog", []))
        for c in catalog:
            if c['name'] == 'freezer':
                for endpoint_type in endpoint_type_priority:
                    for e in c['endpoints']:
                        if endpoint_type in e['interface']:
                            return e['url']
        raise ValueError('Could no get FREEZER_API_URL from config'
                         ' or Keystone')
    except Exception:
        LOG.warn('Could no get FREEZER_API_URL from config or Keystone')
        raise
dataset/ETHPy150Open openstack/freezer-web-ui/disaster_recovery/api/api.py/_get_service_url/swapped operands of `in`