Get all repositories that the user has access to
970455
async function getRepos(token, endpoint) {
  logger.debug('getRepos(token, endpoint)');
  const opts = hostRules.find({ platform: 'bitbucket' }, { token, endpoint });
  // istanbul ignore next
  if (!opts.token) {
    throw new Error('No token found for getRepos');
  }
  hostRules.update({ ...opts, platform: 'bitbucket', default: true });
  try {
    const repos = await utils.accumulateValues(
      `/2.0/repositories/?role=contributor`
    );
    return repos.map(repo => repo.full_name);
  } catch (err) /* istanbul ignore next */ {
    logger.error({ err }, `bitbucket getRepos error`);
    throw err;
  }
}
246212
def find_repositories_with_locate(path):
    """"""
    command = [b'locate', b'-0']
    for dotdir in DOTDIRS:
        # Escaping the slash (using '\/' rather than '/') is an
        # important signal to locate(1) that these glob patterns are
        # supposed to match the full path, so that things like
        # '.hgignore' files do not show up in the result.
        command.append(br'%s\/%s' % (escape(path), escape(dotdir)))
        command.append(br'%s\/*/%s' % (escape(path), escape(dotdir)))
    try:
        paths = check_output(command).strip(b'\0').split(b'\0')
    except CalledProcessError:
        return []
    return [os.path.split(p) for p in paths
            if not os.path.islink(p) and os.path.isdir(p)]
52680
private CompletableFuture<Collection<Permission>> findPermissions0(String projectName, String repoName,
                                                                       User user) {
        requireNonNull(projectName, "projectName");
        requireNonNull(repoName, "repoName");
        requireNonNull(user, "user");

        return getProject(projectName).thenApply(metadata -> {
            final RepositoryMetadata repositoryMetadata = metadata.repo(repoName);
            final Member member = metadata.memberOrDefault(user.id(), null);

            // If the member is guest.
            if (member == null) {
                return repositoryMetadata.perRolePermissions().guest();
            }
            final Collection<Permission> p = repositoryMetadata.perUserPermissions().get(member.id());
            if (p != null) {
                return p;
            }
            return findPerRolePermissions(repositoryMetadata, member.role());
        });
    }
281414
def public(self, username=None):
        
        username = username or self.bitbucket.username or ''
        url = self.bitbucket.url('GET_USER', username=username)
        response = self.bitbucket.dispatch('GET', url)
        try:
            return (response[0], response[1]['repositories'])
        except TypeError:
            pass
        return response
179857
def custom_repository(self):
        
        custom_dict_repo = {}
        for line in self.custom_repositories_list.splitlines():
            line = line.lstrip()
            if not line.startswith("#"):
                custom_dict_repo[line.split()[0]] = line.split()[1]
        return custom_dict_repo
217050
public function getRepositories()
    {
        $token = Config::getInstance()->get('phpci.github.token');

        if (!$token) {
            return null;
        }

        $cache = Cache::getCache(Cache::TYPE_APC);
        $rtn = $cache->get('phpci_github_repos');

        if (!$rtn) {
            $orgs = $this->makeRequest('/user/orgs', array('access_token' => $token));

            $params = array('type' => 'all', 'access_token' => $token);
            $repos = array('user' => array());
            $repos['user'] = $this->makeRecursiveRequest('/user/repos', $params);

            foreach ($orgs as $org) {
                $repos[$org['login']] = $this->makeRecursiveRequest('/orgs/'.$org['login'].'/repos', $params);
            }

            $rtn = array();
            foreach ($repos as $repoGroup) {
                foreach ($repoGroup as $repo) {
                    $rtn['repos'][] = $repo['full_name'];
                }
            }

            $cache->set('phpci_github_repos', $rtn);
        }

        return $rtn;
    }
1120105
@SuppressWarnings("unchecked")
    public <REPO extends I_CmsRepository> List<REPO> getRepositories(Class<REPO> cls) {

        List<REPO> result = new ArrayList<REPO>();
        for (I_CmsRepository repo : m_repositoryMap.values()) {
            if (cls.isInstance(repo)) {
                result.add((REPO)repo);
            }
        }
        return result;
    }
488995
def get_package_sources(self):
        """"""
        # Checkout local modules
        for config in self.sources.get('local', []):
            self.fetch_local_package(config=config)
        # Checkout S3 repositories specified in config
        for config in self.sources.get('s3', []):
            self.fetch_s3_package(config=config)
        # Checkout git repositories specified in config
        for config in self.sources.get('git', []):
            self.fetch_git_package(config=config)
1146821
def acl(self):
        """"""
        r = fapi.get_repository_method_acl(
            self.namespace, self.name, self.snapshot_id, self.api_url)
        fapi._check_response_code(r, 200)
        return r.json()
867845
public function listUserRepositories(string $username, string $type = AbstractApi::TYPE_OWNER,
                                         string $sort = AbstractApi::SORT_FULL_NAME,
                                         string $direction = AbstractApi::DIRECTION_DESC): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username/repos?:args', $username,
            http_build_query(['type' => $type, 'sort' => $sort, 'direction' => $direction])));
    }
750318
public function listPublicRepositories(string $since = '1970-01-01'): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/repositories?:arg', http_build_query(['since', $since])));
    }
732226
def get_all(root=None):
    '''
    
    '''
    ret = _get_systemd_services(root)
    ret.update(set(_get_sysv_services(root, systemd_services=ret)))
    return sorted(ret)
79323
private function getSiteaccessesByRepository()
    {
        $siteaccesses = [];
        foreach ($this->siteaccesses as $siteaccess) {
            $repository = $this->resolveRepositoryName(
                $this->configResolver->getParameter('repository', null, $siteaccess)
            );

            if (!isset($siteaccesses[$repository])) {
                $siteaccesses[$repository] = [];
            }

            $siteaccesses[$repository][] = $siteaccess;
        }

        return $siteaccesses;
    }
113326
def fetchall(self):
        """"""
        try:
            self.repo.remotes.origin.fetch()
        except git.exc.GitCommandError as err:
            raise GitError(err)
1239233
def get_repository_names(path):
    
    return [subdir
            for subdir in os.listdir(path)
            if os.path.isdir(os.path.join(path, subdir, '.git'))]
336168
public function repository(string $user, string $repo): ?array
    {
        $api = $this->client->api('repo');
        $params = [$user, $repo];

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

        return is_array($repo) ? $repo : null;
    }
704507
protected Collection<JcrRepository> repositories() {
        if (this.state == State.RUNNING) {
            final Lock lock = this.lock.readLock();
            try {
                lock.lock();
                return new ArrayList<JcrRepository>(repositories.values());
            } finally {
                lock.unlock();
            }
        }
        return Collections.emptyList();
    }