Get the navigation portlet icon for the brain or object

        The cache key ensures that the lookup is done only once per domain name
490796
def get_icon_for(self, brain_or_object):
        
        portal_types = api.get_tool("portal_types")
        fti = portal_types.getTypeInfo(api.get_portal_type(brain_or_object))
        icon = fti.getIcon()
        if not icon:
            return ""
        # Always try to get the big icon for high-res displays
        icon_big = icon.replace(".png", "_big.png")
        # fall back to a default icon if the looked up icon does not exist
        if self.context.restrictedTraverse(icon_big, None) is None:
            icon_big = None
        portal_url = api.get_url(api.get_portal())
        title = api.get_title(brain_or_object)
        html_tag = "<img title='{}' src='{}/{}' width='16' />".format(
            title, portal_url, icon_big or icon)
        logger.info("Generated Icon Tag for {}: {}".format(
            api.get_path(brain_or_object), html_tag))
        return html_tag
1046031
def cache_key(self):
        
        return '%s:%s' % (super(EntryPublishedVectorBuilder, self).cache_key,
                          Site.objects.get_current().pk)
970194
def _cache_get_entry(self, entry_name, key=ENTIRE_ENTRY_KEY, default=False):
        
        if key is self.ENTIRE_ENTRY_KEY:
            return self._cache[entry_name]
        return self._cache[entry_name].get(key, default)
1316107
def _get_context_key(self, **kwargs):
        
        return str(kwargs.get(self._resource.parent.id_name))
435061
def _objectdata_cache_key(func, obj):
    
    uid = api.get_uid(obj)
    modified = api.get_modification_date(obj).millis()
    review_state = api.get_review_status(obj)
    return "{}-{}-{}".format(uid, review_state, modified)
1186011
def get_endpoint(brain_or_object, default=DEFAULT_ENDPOINT):
    
    portal_type = get_portal_type(brain_or_object)
    resource = portal_type_to_resource(portal_type)

    # Try to get the right namespaced endpoint
    endpoints = router.DefaultRouter.view_functions.keys()
    if resource in endpoints:
        return resource  # exact match
    endpoint_candidates = filter(lambda e: e.endswith(resource), endpoints)
    if len(endpoint_candidates) == 1:
        # only return the namespaced endpoint, if we have an exact match
        return endpoint_candidates[0]

    return default
881955
def get(self, object_type, cache_key):
        
        if object_type not in self.mapping or self.disabled:
            return None
        cache = self.mapping[object_type]
        if cache_key in cache:
            log.debug("Cache HIT: [%s %s]" % (object_type.capitalize(), cache_key))
            return cache[cache_key]
        else:
            log.debug('Cache MISS: [%s %s]' % (object_type.capitalize(), cache_key))
135031
function (navigation) {
        "use strict";
    
        var root = '';
        if (navigation.mode === 'hash') {
            root = location.pathname;
        }
        else if (beyond.params.local) {
    
            var pathname = location.pathname.split('/');
            root = [''];
    
            if (pathname[1] === 'applications') root = root.concat(pathname.splice(1, 2));
            if (pathname[1] === 'languages') root = root.concat(pathname.splice(1, 2));
    
            root = root.join('/');
    
        }
    
        Object.defineProperty(navigation, 'root', {
            'get': function () {
                return root;
            }
        });
    
        Object.defineProperty(navigation, 'pathname', {
            'get': function () {
    
                if (navigation.mode === 'hash') {
    
                    var hash = location.hash;
                    if (hash.substr(0, 1) === '#') {
                        hash = hash.substr(1);
    
                        var index = hash.indexOf('?');
                        if (index !== -1) {
                            hash = hash.substr(0, index);
                        }
                    }
                    return '/' + hash;
    
                }
    
                var pathname = location.pathname.substr(root.length);
    
                if (!pathname) pathname = '/';
                else if (pathname && pathname.substr(0, 1) !== '/') pathname = '/' + pathname;
    
                return pathname;
    
            }
        });
    
    }
1167810
def lookup(self, key_name, headers=None, callback=None):
        
        return self.get_key(key_name, headers=headers, callback=callback)
724349
def get_docs_url(self, role, name):
        

        # Expand partial names to full names
        name = self.get_full_name(role, name)
        # Look up domain corresponding to role
        dom = IntersphinxInventory.roledomain[role]
        # Get the inventory entry tuple corresponding to the name
        # of the referenced type
        itpl = self.inv[dom][name]
        # Get the required path postfix from the inventory entry
        # tuple
        path = itpl[2]
        # Construct link url, appending the base url or note
        # depending on the addbase flag
        return self.baseurl + path if self.addbase else path
446907
function getUseTpl(entrance) {

        var entranceMap = null,
            tmp = {},
            entranceName = entrance;

        if (entrance) {

            if (moduleMapping.hasOwnProperty(entrance)) {
                entrance = moduleMapping[entrance];
            } else if (idMapping.hasOwnProperty(entrance)) {
                entrance = idMapping[entrance];
            } else {
                entrance = null;
            }

        }

        if (!isNumber(entrance)) {
            entranceMap = 'var moduleMapping = ' + JSON.stringify(moduleMapping) + ';';
        } else {
            tmp[entranceName] = entrance;
            entranceMap = 'var moduleMapping = ' + JSON.stringify(tmp) + ';';
        }

        return entranceMap + '\nfunction use (name) {' + depsPoolName + '.r([moduleMapping[name]]);}';

    }
1198807
private static String getCacheKey(String url, int maxWidth, int maxHeight, ScaleType scaleType) {
        return "#W" + maxWidth + "#H" + maxHeight + "#S" + scaleType.ordinal() + url;
    }
760918
@Nullable
    public static DnsCacheEntry getDnsCache(String host) {
        try {
            return InetAddressCacheUtil.getInetAddressCache(host);
        } catch (Exception e) {
            throw new DnsCacheManipulatorException("Fail to getDnsCache, cause: " + e.toString(), e);
        }
    }
543233
@Override
    public WebserviceEndpoint getWebserviceEndpoint(String portComponentName) {
        if (portComponentName == null)
            return null;
        WebserviceEndpoint returnValue = webserviceEndpointTypeMap.get(portComponentName);

        if (returnValue == null && delegate != null)
            return delegate.getWebserviceEndpoint(portComponentName);

        return returnValue;
    }
340112
function lookup(uri, opts) {
    if (typeof uri === "object") {
      opts = uri;
      uri = undefined;
    }

    opts = opts || {};

    var parsed = url_1(uri);
    var source = parsed.source;
    var id = parsed.id;
    var path = parsed.path;
    var sameNamespace = cache[id] && path in cache[id].nsps;
    var newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace;

    var io;

    if (newConnection) {
      debug("ignoring socket cache for %s", source);
      io = manager(source, opts);
    } else {
      if (!cache[id]) {
        debug("new io instance for %s", source);
        cache[id] = manager(source, opts);
      }
      io = cache[id];
    }
    if (parsed.query && !opts.query) {
      opts.query = parsed.query;
    }
    return io.socket(parsed.path, opts);
  }
378816
def _lookup(self, skip_cache, fun, *args, **kwargs):
        
        if args not in self.cache or skip_cache:
            self.cache[args] = fun(*args, **kwargs)
        return self.cache[args]
1153914
function loadIconsFromDiskCache (loader, query, cacheFile, fileHash, callback) {
  // Stop if cache is disabled
  if (!query.persistentCache) return callback(null);
  var resolvedCacheFile = path.resolve(loader._compiler.parentCompilation.compiler.outputPath, cacheFile);

  fs.exists(resolvedCacheFile, function (exists) {
    if (!exists) return callback(null);
    fs.readFile(resolvedCacheFile, function (err, content) {
      if (err) return callback(err);
      var cache;
      try {
        cache = JSON.parse(content);
        // Bail out if the file or the option changed
        if (!isCacheValid(cache, fileHash, query)) {
          return callback(null);
        }
      } catch (e) {
        return callback(e);
      }
      callback(null, cache.result);
    });
  });
}