Return a cache region plus key.
13725
def _get_cache_plus_key(self):
        """"""
        key = getattr(self, '_cache_key', self.key_from_query())
        return self._cache.cache, key
267461
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Socket(key)
        if key not in Socket._member_map_:
            extend_enum(Socket, key, default)
        return Socket[key]
739037
def reload_localzone():
    """"""
    global _cache_tz
    _cache_tz = pytz.timezone(get_localzone_name())
    utils.assert_tz_offset(_cache_tz)
    return _cache_tz
934321
def get_action_cache_key(name, argument):
    """"""
    tokens = [str(name)]
    if argument:
        tokens.append(str(argument))
    return '::'.join(tokens)
230576
def cache_key(model, pk):
    ""
    app = model._meta.app_label
    name = model._meta.module_name
    return 'api:{0}:{1}:{2}'.format(app, name, pk)
1356397
def get(self, key, bucket):
        

        try:
            return self._cache[bucket][key]
        except (KeyError, TypeError):
            return None
391059
def cache_key(self, method_name):
        """"""
        key = ""
        method = getattr(self, "cache_key_{}".format(method_name), None)
        if method:
            key = method()

        return key
289105
def retrieve(self, key):
        """"""
        column_file = os.path.join(self._hash_dir, '%s.json' % key)
        cache_file = os.path.join(self._hash_dir, '%s.npy' % key)

        if os.path.exists(cache_file):
            data = np.load(cache_file)
            if os.path.exists(column_file):
                with open(column_file, 'r') as json_file:
                    columns = json.load(json_file)
                data = pd.DataFrame(data, columns=columns)
        else:
            return None

        return data
625003
def _get_code(self, key):
        

        data = self.grid.code_array(key)
        self.grid.code_array.result_cache.clear()

        return data
734211
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return DI(key)
        if key not in DI._member_map_:
            extend_enum(DI, key, default)
        return DI[key]
66292
def get_cache_key(self, section, name):
        """"""
        if not self.instance:
            return 'dynamic_preferences_{0}_{1}_{2}'.format(self.model.__name__, section, name)
        return 'dynamic_preferences_{0}_{1}_{2}_{3}'.format(self.model.__name__, self.instance.pk, section, name, self.instance.pk)
403113
def cache_get(cache_dir, cache_key, default=None):
    
    filename = os.path.join(cache_dir, cache_key)

    if os.path.isfile(filename):
        with open(filename, 'r') as f:
            return f.read()

    return default
1003977
def get(self, key, no_cache=False):
        
        section, name = self.parse_lookup(key)
        preference = self.registry.get(
            section=section, name=name, fallback=False)
        if no_cache or not preferences_settings.ENABLE_CACHE:
            return self.get_db_pref(section=section, name=name).value

        try:
            return self.from_cache(section, name)
        except CachedValueNotFound:
            pass

        db_pref = self.get_db_pref(section=section, name=name)
        self.to_cache(db_pref)
        return db_pref.value
1111187
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return TOS_REL(key)
        if key not in TOS_REL._member_map_:
            extend_enum(TOS_REL, key, default)
        return TOS_REL[key]
1351062
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Setting(key)
        if key not in Setting._member_map_:
            extend_enum(Setting, key, default)
        return Setting[key]
927746
function cacheGet(key, options) {
    if (shouldCache(options)) {
      return;
    }

    if (self.options.cache === 'memory') {
      return self.cache[key];
    }

    return self.options.cache.get(key);
  }
359603
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return TOS_THR(key)
        if key not in TOS_THR._member_map_:
            extend_enum(TOS_THR, key, default)
        return TOS_THR[key]