def get_record(repo_name): lic = get_license(repo_name, gh_username, gh_oauth_key) curr_time = curr_time_utc() curr_commit = curr_commit_master(repo_name, gh_username, gh_oauth_key) return { 'repo_name': repo_name, 'license': lic, 'curr_commit_master': curr_commit, 'time_accessed': curr_time }
def get_records(repo_name): data = get_commits(repo_name, gh_username, gh_oauth_key) try: validate_response_found(data[0]) except ValueError: return None except KeyError: return None curr_time = curr_time_utc() curr_commit = curr_commit_master(repo_name, gh_username, gh_oauth_key) return [get_record(dct, repo_name, curr_time, curr_commit) for dct in data]
def get_records(repo_name): data = get_language_bytes(repo_name, gh_username, gh_oauth_key) curr_time = curr_time_utc() curr_commit = curr_commit_master(repo_name, gh_username, gh_oauth_key) return [{ 'repo_name': repo_name, 'language_name': key, 'language_bytes': data[key], 'curr_commit_master': curr_commit, 'time_accessed': curr_time } for key in data.keys()]
def get_record(repo_name, pr_data): curr_time = curr_time_utc() curr_commit = curr_commit_master(repo_name, gh_username, gh_oauth_key) return {'repo_name': repo_name, 'pr_id': pr_data['id'], 'state': pr_data['state'], 'api_url': pr_data['url'], 'html_url': pr_data['html_url'], 'title': pr_data['title'], 'body': pr_data['body'], 'user_login': pr_data['user']['login'], 'user_id': pr_data['user']['id'], 'curr_commit_master': curr_commit, 'time_accessed': curr_time}
def get_record(repo_name): r = repo.Repo(repo_name, gh_username, gh_oauth_key) curr_time = curr_time_utc() curr_commit = curr_commit_master(repo_name, gh_username, gh_oauth_key) return {'repo_name': r.get_repo_name(), 'api_url': r.get_gh_api_url(), 'html_url': r.get_html_url(), 'description': r.get_description(), 'is_fork': r.is_fork(), 'stargazers_count': r.get_stargazers_count(), 'watchers_count': r.get_watchers_count(), 'forks_count': r.get_forks_count(), 'open_issues_count': r.get_open_issues_count(), 'subscribers_count': r.get_subscribers_count(), 'curr_commit_master': curr_commit, 'time_accessed': curr_time}
def get_file_info_records(repo_name): data = get_file_info(repo_name, gh_username, gh_oauth_key) curr_time = curr_time_utc() curr_commit = curr_commit_master(repo_name, gh_username, gh_oauth_key) return [{ 'repo_name': repo_name, 'file_name': record['name'], 'path': record['path'], 'sha': record['sha'], 'size': record['size'], 'api_url': record['url'], 'html_url': record['html_url'], 'git_url': record['git_url'], 'download_url': record['download_url'], 'type': record['type'], 'curr_commit_master': curr_commit, 'time_accessed': curr_time } for record in data]