Get cached files for anime.
5060
def get_files(conn, aid: int) -> AnimeFiles:
    """"""
    with conn:
        cur = conn.cursor().execute(
            'SELECT anime_files FROM cache_anime WHERE aid=?',
            (aid,))
        row = cur.fetchone()
        if row is None:
            raise ValueError('No cached files')
        return AnimeFiles.from_json(row[0])
597852
public function loadCacheDetails()
    {
        $cacheFile = md5($this->url);
        $this->fileName = $this->saveFolder . $cacheFile;
        $this->fileJson = $this->fileName . ".json";
        if (is_readable($this->fileJson)) {
            $this->cache = json_decode(file_get_contents($this->fileJson), true);
        }
    }
911869
def cache(self):
      """"""
      msg = 'Saving updates from more recent "%s" to "%s"'
      log.info(msg, self.filename, self.cachename)
      with open(self.cachename, 'wb') as output:
          cPickle.dump(self._dict, output, -1)
241315
def get_files():
    """"""

    files = dict()

    for k, v in request.files.items():
        content_type = request.files[k].content_type or 'application/octet-stream'
        val = json_safe(v.read(), content_type)
        if files.get(k):
            if not isinstance(files[k], list):
                files[k] = [files[k]]
            files[k].append(val)
        else:
            files[k] = val

    return files
400980
protected function cacheMediaAssetFiles()
    {
        $aAssetFileFilters = array();
        $aAssetFiles = array();

        //Retrieve asset files cache manager
        $oAssetFilesCacheManager = $this->getAssetFilesCacheManager();

        // Retrieve asset file filters manager
        $oAssetFileFiltersManager = $this->getAssetFileFiltersManager();
        $bIsProduction = $this->getOptions()->isProduction();

        foreach ($this->getAssetFilesConfiguration()->getAssetFiles(\AssetsBundle\AssetFile\AssetFile::ASSET_MEDIA) as $oAssetFile) {
            if ($oAssetFilesCacheManager->isAssetFileCached($oAssetFile)) {
                $aAssetFiles[] = $oAssetFilesCacheManager->getAssetFileCachePath($oAssetFile);
                continue;
            }
            if ($bIsProduction) {
                if (array_key_exists($sAssetFileExtension = $oAssetFile->getAssetFileExtension(), $aAssetFileFilters)) {
                    $oMediaFileFilter = $aAssetFileFilters[$sAssetFileExtension];
                } else {
                    $oMediaFileFilter = $aAssetFileFilters[$sAssetFileExtension] = $oAssetFileFiltersManager->has($sAssetFileExtension) ? $oAssetFileFiltersManager->get($sAssetFileExtension) : null;
                }
            } else {
                $oMediaFileFilter = null;
            }

            if ($oMediaFileFilter) {
                $oTmpAssetFile = $this->createTmpAssetFile(\AssetsBundle\AssetFile\AssetFile::ASSET_MEDIA);
                $oTmpAssetFile->setAssetFileContents($oMediaFileFilter->filterAssetFile($oAssetFile), false);

                // Cache asset file
                $aAssetFiles[] = $oAssetFilesCacheManager->cacheAssetFile($oTmpAssetFile, $oAssetFile);
            } else {
                // Cache asset file
                $aAssetFiles[] = $oAssetFilesCacheManager->cacheAssetFile($oAssetFile);
            }
        }

        return $aAssetFiles;
    }
401250
def search_anime(self, query):
        

        r = self._query_('/search/anime', 'GET',
                         params={'query': query})

        results = [Anime(item) for item in r.json()]
        return results
806498
public function getCache()
    {
        // make sure filters are parsed again if cache expired
        if (!$this->isValidFile($this->path)) {
            return false;
        }

        $data = unserialize(file_get_contents($this->path));

        return $data;
    }
1249087
def get_translated_items(fapi, file_uri, use_cache, cache_dir=None):
    
    items = None
    cache_file = os.path.join(cache_dir, sha1(file_uri)) if use_cache else None
    if use_cache and os.path.exists(cache_file):
        print("Using cache file %s for translated items for: %s" % (cache_file, file_uri))
        items = json.loads(read_from_file(cache_file))
    if not items:
        print("Downloading %s from smartling" % file_uri)
        (response, code) = fapi.last_modified(file_uri)
        items = response.data.items
        if cache_file:
            print("Caching %s to %s" % (file_uri, cache_file))
            write_to_file(cache_file, json.dumps(items))
    return items
993874
def _GetContents(self):
        """"""
        try:
            self._RealGetContents()
        except BadZipfile:
            if not self._filePassed:
                self.fp.close()
                self.fp = None
            raise
258741
def get_content(self, uri, disable_proxy=False):
        """"""
        return self.get(uri=uri, disable_proxy=disable_proxy)
531773
def _load_cache(self, filename):
        """"""
        try:
            with open(filename + self.CACHE_EXTENSION, 'rb') as file:
                prev_number_of_pages, prev_page_references = pickle.load(file)
        except (IOError, TypeError):
            prev_number_of_pages, prev_page_references = {}, {}
        return prev_number_of_pages, prev_page_references
504254
def get_file(self, cache_id_obj, section=None):
        """"""
        section = "default" if section is None else section
        if "/" in section:
            raise ValueError("invalid section '{0}'".format(section))
        cache_id = "{:08x}".format(
            zlib.crc32(b"&".join(sorted([
                str(k).encode('utf8') + b"=" + str(v).encode('utf8')
                for k, v in cache_id_obj.items()
            ]))) & 0xffffffff)
        return os.path.join(self._full_base,
                            os.path.join(section,
                                         os.path.join(
                                             "{0}".format(cache_id[:2]),
                                             "{0}.tmp".format(cache_id[2:]))))
300575
def get_all(self):
        
        result = cache.lrange(self.key, 0, -1)
        return (json.loads(item.decode('utf-8')) for item in result if
                item) if self.serialize else result
697468
def get_stored_files(self):
        """"""
        method = 'GET'
        endpoint = '/rest/v1/storage/{}'.format(self.client.sauce_username)
        return self.client.request(method, endpoint)
688809
def get_content(path):
    """"""
    with codecs.open(abs_path(path), encoding='utf-8') as f:
        return f.read()
200892
def _get_cached(self):
        """"""
        lines = self.context.cachedstr[self.icached[0]:self.icached[1]]
        return self._get_statements(lines, self.icached[0])
340507
def get_item(key):
    """"""
    CACHED_KEY_FILE = os.path.join(CURRENT_DIR, key)

    try:
        return json.loads(open(CACHED_KEY_FILE, "rb").read().decode('UTF-8'))["_"]
    except (IOError, ValueError):
        return None