Load repo infos

@param Repo $repo
@return Repo
16757
protected function loadRepo(Repo $repo = null)
    {
        if (null == $repo) {
            return null;
        }
        $this->loadExtraInfos($repo);
        $this->loadPackagistInfos($repo);

        return $repo;
    }
991306
public function getByTag($user, $repo, $tag)
	{
		// Build the request path.
		$path = "/repos/$user/$repo/releases/tags/$tag";

		// Send the request.
		return $this->processResponse($this->client->get($this->fetchUrl($path)));
	}
1097009
protected function waiting_for_background_update( $repo = null ) {
		$caches = [];
		if ( null !== $repo ) {
			$cache = isset( $repo->slug ) ? $this->get_repo_cache( $repo->slug ) : null;

			return empty( $cache );
		}
		$repos = array_merge(
			Singleton::get_instance( 'Plugin', $this )->get_plugin_configs(),
			Singleton::get_instance( 'Theme', $this )->get_theme_configs()
		);
		foreach ( $repos as $git_repo ) {
			$caches[ $git_repo->slug ] = $this->get_repo_cache( $git_repo->slug );
		}
		$waiting = array_filter(
			$caches,
			function ( $e ) {
				return empty( $e );
			}
		);

		return ! empty( $waiting );
	}
235149
public function show(string $repo, array $params = [])
    {
        $path = $this->buildUsersPath($repo);

        return $this->get($path, $params);
    }
259153
public function create(string $repo, array $params = [])
    {
        $path = $this->buildUsersPath($repo);

        return $this->post($path, $params);
    }
218172
private function getChoices(EntityRepository $repo)
    {
        $choices = [];
        $entities = $repo->findAll();

        foreach ($entities as $entity) {
            $choices[$entity->getId()] = $entity->getName();
        }
        return [
            self::NEW_VALUE_OPTION => 'components.categories.form.new',
            'components.categories.form.existing' => $choices,
        ];
    }
1265588
public function findAll()
    {
        $repos = array();
        foreach ($this->repository->findAll() as $repo) {
            $this->loadPackagistInfos($repo);
            $repos[] = $repo;
        }

        return $repos;
    }
826003
public function repos($language = null, $private = null, $organization = null, $type = null, $imported = null)
    {
        return $this->request(sprintf('github?lang=%s&private=%b&org_name=%s&org_type=%s&page=%d&only_imported=%b',
            $language, $private, $organization, $type, 1, $imported
        ));
    }
1048804
def _load_repo(self):
        
        if self._logg_repo:
            return self._logg_repo

        try:
            _logg_repo = git.Repo(self._engine_path)
            log.debug('Loaded git repo [{0}]'.format(self._engine_path))
        except Exception:
            # FIXME: should this be automatic?
            # log.error("Git repo doesn't exist! run ``idid init``")
            _logg_repo = self._init_repo()
        return _logg_repo
265040
public function loadPackagistInfos(Repo $repo)
    {
        try {
            $this->composerReader->load($repo->getSlug());

            // Load package name
            if ($this->composerReader->has('name')) {
                $repo->setPackagistSlug($this->composerReader->get('name'));
            }

            // Load authors
            if ($this->composerReader->has('authors')) {
                $repo->setAuthors($this->composerReader->get('authors'));
            }

            // Load dependencies
            if ($this->composerReader->has('require')) {
                $repo->setDependencies($this->composerReader->get('require'));
            }
        } catch (\Exception $e) {
            // We do not want to throw exception here!
        }
    }
413420
public static function create($repo_path, $source = null)
    {
        try {
            $repo = new Repository($repo_path);
            $remote = $repo->getRemoteOriginUrl();
            if ($remote===$source || $remote.'.git'===$source || $remote===$source.'.git') {
                $branch = $repo->getCurrentBranch();
                $repo->pull($remote, $branch);
                return $repo;
            }
        } catch (\Exception $e) {
        }
        return Repository::createNew($repo_path, $source);
    }
290570
public function getCoverageBadge(Repo $repo)
    {
        if ($repo->getCoverageBadgeHash()) {
            return sprintf(
                '<img src="%s" />',
                $this->helper->getCoverageBadgeUrl(
                    $repo->getSlug(),
                    $repo->getType(),
                    $repo->getCoverageBadgeHash()
                )
            );
        }

        return '';
    }
635092
public function getDownloadBadge(Repo $repo)
    {
        if ($repo->getPackagistSlug()) {
            return sprintf('<img src="%s" />', $this->helper->getTotalDownloadBadgeUrl($repo->getPackagistSlug()));
        }

        return '';
    }
913757
def get_repo_config(self, repo='default'):
        
        for repo_config in self.repositories:
            if repo_config.name == repo or repo_config.url in RepositoryURL(repo):
                return repo_config

        return None
427867
public function getLicenseBadge(Repo $repo)
    {
        if ($repo->getPackagistSlug()) {
            return sprintf('<img src="%s" />', $this->helper->getLicenseBadgeUrl($repo->getPackagistSlug()));
        }

        return '';
    }
480968
public function update(Repo $repo)
    {
        $rows = array();

        foreach ($this->getRows() as $row) {
            if ($row['id'] == $repo->getId()) {
                $row = array(
                    'slug' => $repo->getSlug(),
                    'qualityBadgeHash' => $repo->getQualityBadgeHash(),
                    'coverageBadgeHash' => $repo->getCoverageBadgeHash(),
                    'type' => $repo->getType(),
                    'id' => $repo->getId()
                );
            }
            $rows[] = $row;
        }

        file_put_contents($this->filename, Yaml::dump($rows));
    }
816229
protected function getRepository($repoId = null){
        if($repoId === null){
          $repo = $this->getRepository(static::REPOSITORY_NAMESPACE);
        }else{
          $repo = $this->getEntityManager()->getRepository($repoId);
        }
        return $repo;
    }