code: def get_repositores(owner_url, token, nrepos):
      
      all_repos = []
  
      url = owner_url
  
      while True:
          logging.debug("Getting repos from: %s" % (url))
          try:
              r = requests.get(url,
                               params=get_payload(),
                               headers=get_headers(token))
  
              r.raise_for_status()
              all_repos += r.json()
  
              logging.debug("Rate limit: %s" % (r.headers['X-RateLimit-Remaining']))
  
              if 'next' not in r.links:
                  break
  
              url = r.links['next']['url']  # Loving requests :)
          except requests.exceptions.ConnectionError:
              logging.error("Can not connect to GitHub")
              break
  
      # Remove forks
      nrepos_recent = [repo for repo in all_repos if not repo['fork']]
      # Sort by updated_at and limit to nrepos
      nrepos_sorted = sorted(nrepos_recent, key=lambda repo: parser.parse(repo['updated_at']), reverse=True)
      nrepos_sorted = nrepos_sorted[0:nrepos]
      # First the small repositories to feedback the user quickly
      nrepos_sorted = sorted(nrepos_sorted, key=lambda repo: repo['size'])
      for repo in nrepos_sorted:
          logging.debug("%s %i %s" % (repo['updated_at'], repo['size'], repo['name']))
      return nrepos_sorted
docs: owner could be an org or and user