Returns repo cached data.

@access protected

@param string|bool $repo Repo name or false.

@return array|bool The repo cache. False if expired.
171432
public function get_repo_cache( $repo = false ) {
		if ( ! $repo ) {
			$repo = isset( $this->type->slug ) ? $this->type->slug : 'ghu';
		}
		$cache_key = 'ghu-' . md5( $repo );
		$cache     = get_site_option( $cache_key );

		if ( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
			return false;
		}

		return $cache;
	}
886503
public function getFile(Repo $repo)
    {
        $file = tempnam(sys_get_temp_dir(), 'composer');
        $content = file_get_contents($this->helper->getRawFileUrl($repo->getSlug(), 'master', 'composer.json'));
        file_put_contents($file, $content);

        return $file;
    }
708754
public function get($object = false)
    {
        $this->prepare();

        return $this->prepareResult($this->_map, $object);
    }
1147758
public function getCache($key)
    {
        if ($this->sqlInitialized()) {
            if ($this->sql) {
                $_key = $this->sql->real_escape_string($key);
                if ($this->lifetime == self::IMMORTAL_LIFETIME) {
                    if ($response = $this->sql->query("
                        SELECT *
                            FROM `{$this->table}`
                            WHERE
                                `{$this->key}` = '$_key' AND
                                `expire` IS NULL
                    ")) {
                        if ($cache = $response->fetch_assoc()) {
                            return unserialize($cache[$this->cache]);
                        }
                    }
                } else {
                    $liveCache = date('Y-m-d H:i:s', time() - $this->lifetime);
                    if ($response = $this->sql->query("
                        SELECT *
                            FROM `{$this->table}`
                            WHERE
                                `{$this->key}` = '$_key' AND (
                                    (
                                        `timestamp` > '{$liveCache}' AND
                                        `expire` IS NULL
                                    ) OR (
                                        `expire` > NOW()
                                    )
                                )
                    ")) {
                        if ($cache = $response->fetch_assoc()) {
                            return unserialize($cache[$this->cache]);
                        }
                    }
                }
            }
            return false;
        }
    }
635092
public function getDownloadBadge(Repo $repo)
    {
        if ($repo->getPackagistSlug()) {
            return sprintf('<img src="%s" />', $this->helper->getTotalDownloadBadgeUrl($repo->getPackagistSlug()));
        }

        return '';
    }
1096629
public function get($key)
    {
        $file = $this->makePath($key);
        if (!($data = @file_get_contents($file))) {
            return false;
        }

        if (!($data = @unserialize($data))) {
            $this->delete($key); /* Delete corrupted. */
            return false;
        }

        list($expiry, $value) = $data;
        if ($expiry !== false && ($expiry < microtime(true))) {
            $this->delete($key);
            return false;
        }

        return $value;
    }
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;
    }
309262
public function getData($refresh=false)
	{
		if($this->_data===null || $refresh)
			$this->_data=$this->fetchData();
		return $this->_data;
	}
154613
private function getCachedDataByObject($object)
    {
        return $this->getCachedDataByReference(
            $this->mm->getMetadataForObject($object)->getReferenceForObject($object)
        );
    }
921167
public function getTheReadme($owner, $repo, $ref = null)
	{
		$data = array();
		if(!is_null($ref))
			$data['ref'] = $ref;
		
		return $this->client->request("/repos/$owner/$repo/readme", 'GET', $data, 200, 'GitHubRepoContent');
	}
350857
public function getDailyDownloadBadge(Repo $repo)
    {
        if ($repo->getPackagistSlug()) {
            return sprintf('<img src="%s" />', $this->helper->getDailyDownloadBadgeUrl($repo->getPackagistSlug()));
        }

        return '';
    }
249789
def _get_repo_metadata(self):
        '''
        
        '''
        cache = salt.cache.Cache(self.opts, self.opts['spm_cache_dir'])
        metadata = {}

        def _read_metadata(repo, repo_info):
            if cache.updated('.', repo) is None:
                log.warning('Updating repo metadata')
                self._download_repo_metadata({})

            metadata[repo] = {
                'info': repo_info,
                'packages': cache.fetch('.', repo),
            }

        self._traverse_repos(_read_metadata)
        return metadata
786575
public function get($key)
    {
        $context = $this->_context;

        if ($context->cache !== null && array_key_exists($key, $context->cache)) {
            return $context->cache[$key];
        } elseif ($this->_enabled) {
            if ($this->_is_cli) {
                if (($r = apcu_fetch($this->_prefix ? ($this->_prefix . $key) : $key)) === false) {
                    return false;
                }
                return time() <= $r[0] ? $r[1] : false;
            } else {
                return apcu_fetch($this->_prefix ? ($this->_prefix . $key) : $key);
            }
        } else {
            return false;
        }
    }
104081
private function repositoryAlreadySet($config, $repo)
    {
        if (!$config->repositories) {
            return false;
        } else {
            if (in_array($repo, $config->repositories)) {
                return true;
            } else {
                return false;
            }
        }
    }
589572
public function urlForRepository(string $user, string $repo): string
    {
        $key = sprintf(self::CACHE_KEY_TEMPLATE, md5($user . $repo), 'repo_url');

        if (($latest = $this->getFromCache($key)) !== null) {
            return $latest;
        }

        $api = $this->client->api('repo');
        $params = [$user, $repo];

        $repo = $this->callGitHub([$api, 'show'], $params);

        $url = $repo['html_url'] ?? '';

        $this->setToCache($key, $url, 30);
        return $url;
    }
730251
public function create(Repo $repo)
    {
        $rows = $this->getRows();
        $id = sizeof($rows) + 1;

        $rows[] = array(
            'id' => $id,
            'slug' => $repo->getSlug(),
            'type' => $repo->getType(),
            'qualityBadgeHash' => $repo->getQualityBadgeHash(),
            'coverageBadgeHash' => $repo->getCoverageBadgeHash(),
        );

        file_put_contents($this->filename, Yaml::dump($rows));
    }
1283829
def get_repo(repo, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    repos = list_repos()

    if repos:
        for source in six.itervalues(repos):
            for sub in source:
                if sub['name'] == repo:
                    return sub
    return {}