List repo followers

 = Examples
  bitbucket = BitBucket.new :user => 'user-name', :repo => 'repo-name'
  bitbucket.repos.following.followers
  bitbucket.repos.following.followers { |watcher| ... }
776134
def followers(user_name, repo_name, params={})
      _update_user_repo_params(user_name, repo_name)
      _validate_user_repo_params(user, repo) unless user? && repo?
      normalize! params

      response = get_request("/1.0/repositories/#{user}/#{repo.downcase}/followers/", params)
      return response unless block_given?
      response.each { |el| yield el }
    end
1083327
def get_unique_repositories(repo_list):
        
        unique_list = list()
        included = defaultdict(lambda: False)
        for repo in repo_list:
            if not included[repo.full_name]:
                unique_list.append(repo)
                included[repo.full_name] = True
        return unique_list
348092
def _repo_name(self):
        

        if self._git_repo_name is not None:
            return self._git_repo_name
        else:
            reponame = self.repo.git_dir.split(os.sep)[-2]
            if reponame.strip() == '':
                return 'unknown_repo'
            return reponame
627995
function repo (options, callback) {
  var user = options.user
  var repo = options.repo
  var path = options.path || null
  var branch = options.branch || 'master'
  var token = options.token || null

  if (!user || !repo) {
    return callback(new Error('must specify user, repo'))
  }

  if (path) {
    var contentsUrl = '/repos/' + user + '/' + repo + '/contents/'
    return request({
      url: contentsUrl,
      qs: {
        access_token: token,
        ref: branch
      }
    }, function (err, data) {
      if (err) {
        var msg = 'Error requesting data from ' + contentsUrl + ': ' + err.message
        return callback(new Error(msg))
      }

      var isDir = false
      // assume the extension of the requested file is '.geojson', unless proven otherwise
      var extension = '.geojson'

      data.forEach(function (f) {
        // find out the extension of the file requested by the user
        var filenameArray = f.name.split('.')
        if (path === filenameArray[0]) {
          extension = '.' + filenameArray[1]
        }

        if (f.name === path && f.type === 'dir') isDir = true
      })

      if (isDir) {
        var url = '/repos/' + user + '/' + repo + '/contents/' + path

        return request({
          url: url,
          qs: {
            access_token: token,
            ref: branch
          }
        }, function (err, json) {
          if (err) return callback(err)

          var files = []

          json.forEach(function (file) {
            if (file.name.match(/geojson/)) {
              files.push(file)
            }
          })

          if (files.length) {
            return repoFiles({
              url: 'https://raw.github.com/' + user + '/' + repo + '/' + branch + '/' + path + '/',
              files: files
            }, callback)
          }

          callback(new Error('could not find any geojson files at ' + url))
        })
      }

      var urls = [
        'https://api.github.com/repos/' + user + '/' + repo + '/contents/' + path + extension,
        'https://raw.github.com/' + user + '/' + repo + '/' + branch + '/' + path + extension
      ]

      async.map(urls, function (url, cb) {
        request({
          url: url,
          qs: {
            access_token: token,
            ref: branch
          }
        }, cb)
      }, function (err, files) {
        if (err) return callback(err)

        var file = files[0]
        var json = files[1]
        var name = file.name
        var sha = file.sha
        var geojson = null

        if (json.type && json.type === 'FeatureCollection') {
          json.name = name
          json.sha = sha
          geojson = json
        }

        if (geojson) return callback(null, geojson)
        callback(new Error('could not find any geojson: ' + err.message))
      })
    })
  }

  var url = '/repos/' + user + '/' + repo + '/contents'

  request({
    url: url,
    qs: {
      access_token: token,
      ref: branch
    }
  }, function (err, json) {
    if (err) return callback(err)

    var files = []

    json.forEach(function (file) {
      if (file.name.match(/geojson/)) {
        files.push(file)
      }
    })

    if (files.length) {
      return repoFiles({
        url: 'https://raw.github.com/' + user + '/' + repo + '/' + branch + '/',
        files: files
      }, callback)
    }

    callback(new Error('could not find any geojson files at ' + url))
  })
}
1356482
def create_fork(self, repo):
        
        assert isinstance(repo, github.Repository.Repository), repo
        url_parameters = {
            "org": self.login,
        }
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            "/repos/" + repo.owner.login + "/" + repo.name + "/forks",
            parameters=url_parameters
        )
        return github.Repository.Repository(self._requester, headers, data, completed=True)
155165
def do_list(self, line):
        '''
        
        '''
        repo_names = self.network.repo_names
        print('Known repos:')
        print('    ' + '\n    '.join(repo_names))
606180
function Repo(name, username) {
  this.name = name;
  this.username = username;
  this.isLoaded = Deferred();
  this.isCloned = Deferred();
  this.isClonning = false;
  this.branch = null;
}
37525
def find_git_repo(session, name, candidates):
    

    repos = filter_repo_urls(candidates=candidates)

    # if we are lucky and there isn't a valid repo URL in our URL candidates, we need to go deeper
    # and check the URLs if they contain a link to a repo
    if not repos:
        logger.info("No repo found, trying to find one on related sites {}".format(candidates))
        repos = set(find_repo_urls(session, name, candidates))

    urls = []
    for repo in repos:
        username, reponame = repo.split("/")[3:5]
        if "github.com" in repo:
            urls.append(
                "https://github.com/{username}/{reponame}.git".format(
                    username=username, reponame=reponame
                )
            )
        elif "bitbucket.org" in repo:
            urls.append(
                "https://bitbucket.org/{username}/{reponame}".format(
                    username=username, reponame=reponame
                )
            )
    return set(urls), repos
1175058
def build_follow_url(host=None, **params):
        

        # template = '?{params}'
        config = ExampleConfig()
        template = '/follow?{params}'

        if not host:
            host = config.get('example_web_hostname')

        return ExampleUrlBuilder.build(
            template=template,
            host=host,
            params=ExampleUrlBuilder.encode_params(**params)
        )
631628
public List<User> followers(Map<String, ?> options) {
        return client.blogFollowers(this.name, options);
    }
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;
  }
}
138220
def watch(self, *names):
        
        watches = []
        for watch in names:
            if isinstance(watch, RedisField):
                watch = watch.key
            watches.append(watch)
        return super(_Pipeline, self).watch(*watches)
366514
def get_forks_stars_watchers(repository)
      {
        forks: @octokit.forks(repository).length,
        stars: @octokit.stargazers(repository).length,
        watchers: @octokit.subscribers(repository).length
      }
    end
859695
def do_http_repo(self, repo):
        '''
        
        '''
        self.abort_on_missing_effective_repo_name(repo, 'http_repo')
        repo_name = self.get_effective_repo_name(repo)
        try:
            self.network.set(repo_name, REPO.TYPE, REPOTYPE.HTTP)
        except UnknownRepoError:
            self.network.define_http_repo(repo_name)
        self.network.active_repo = repo_name
385115
def initialize_repo(self):
        

        logging.info('Repo {} doesn\'t exist. Cloning...'.format(self.repo_dir))
        clone_args = ['git', 'clone']
        if self.depth and self.depth > 0:
            clone_args.extend(['--depth', str(self.depth)])
        clone_args.extend(['--branch', self.branch_name])
        clone_args.extend([self.git_url, self.repo_dir])
        yield from execute_cmd(clone_args)
        yield from execute_cmd(['git', 'config', 'user.email', 'nbgitpuller@example.com'], cwd=self.repo_dir)
        yield from execute_cmd(['git', 'config', 'user.name', 'nbgitpuller'], cwd=self.repo_dir)
        logging.info('Repo {} initialized'.format(self.repo_dir))
308868
def fetch_followers(account_file, outfile, limit, do_loop):
    
    print('Fetching followers for accounts in %s' % account_file)
    niters = 1
    while True:
        outf = gzip.open(outfile, 'wt')
        for screen_name in iter_lines(account_file):
            timestamp = datetime.datetime.now().isoformat()
            print('collecting followers for', screen_name)
            followers = twutil.collect.followers_for_screen_name(screen_name, limit)
            if len(followers) > 0:
                outf.write('%s %s %s\n' % (timestamp, screen_name, ' '.join(followers)))
                outf.flush()
            else:
                print('unknown user', screen_name)
        outf.close()
        if not do_loop:
            return
        else:
            if niters == 1:
                outfile = '%s.%d' % (outfile, niters)
            else:
                outfile = outfile[:outfile.rindex('.')] + '.%d' % niters
            niters += 1
381353
def all(self):
        
        url = self.bitbucket.url('GET_USER', username=self.bitbucket.username)
        response = self.bitbucket.dispatch('GET', url, auth=self.bitbucket.auth)
        try:
            return (response[0], response[1]['repositories'])
        except TypeError:
            pass
        return response