def get_code_commentors(repo_name, limit):
  progress("Collecting commentors")

  pri_count = get_pri_count(repo_name)
  if limit == 0:
    minimum = 1
  else:
    minimum = max(1, pri_count - limit)

  users = []
  for index in range(minimum, pri_count + 1):
    users.append(get_user("/repos/%s/pulls/%d" % (repo_name, index)))
    users.append(get_user("/repos/%s/issues/%d" % (repo_name, index)))

    for entry in get_paged_json("/repos/%s/pulls/%d/comments" %
                                (repo_name, index)):
      users.append(get_user_data(entry))

    for entry in get_paged_json("/repos/%s/issues/%d/comments" %
                                (repo_name, index)):
      users.append(get_user_data(entry))

  progress_complete()

  return unique(users)
dataset/ETHPy150Open LABHR/octohatrack/octohatrack/helpers.py/get_code_commentors/original