Exemplo n.º 1
0
def main(project_name):
    '''
    #input: developer_list, the repository name, the dictionary of member_experience
    #output: Issues and comments on the issue for this repo before tool adoption date.

    '''

    project_name = project_name.replace('\n', '')

    auth_set = get_login()

    headers = {'Accept': 'application/vnd.github.squirrel-girl-preview+json'}

    # requests for comments on issues

    url = 'https://api.github.com/repos/{}/contributors'.format(project_name)

    #print(commits_url)

    r = requests.get(url, headers=headers, auth=random.choice(auth_set))

    if not r.ok:

        # print(r)

        # print(url)

        return []

    else:

        contributors = json.loads(r.text or r.content)

        if len(contributors) >= 10:

            print('get one!')

            return [project_name]

        else:

            return []
Exemplo n.º 2
0
    return [sorted_comments, project_name]


#-----------------------------------------------------------------------

print("Start loading...")

#find out all the tool names. and make sure that they are included in all the comments.

#--------------------Start setting the parameters----------------------

project_id = 0

project_comments = {}

auth_set = get_login()

headers = {'Accept': 'application/vnd.github.squirrel-girl-preview+json'}

#--------------------End setting the parameters----------------------

print('Processing the data...')

total_number_of_projects = len(project_name_list)

# this dict is used to look up comment related information (e.g., created date, comment type) for later usage...
# rst_dict = {}

with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:

    for rst_comments_index, project_name in executor.map(