<jupyter_start><jupyter_text>How many code repositories does `hanisaf` own?Use the API endpoint https://api.github.com/users/:owner/reposReplace :owner with username (i.e., hanisaf)<jupyter_code>username = "hanisaf"
endpoint = f"https://api.github.com/users/{username}/repos"

response = requests.get(endpoint)
if response.status_code == 200:
    data = response.json()
    repos = len(data)
repos
data<jupyter_output><empty_output><jupyter_text>Which repositories were created in 2019?Use the API endpoint https://api.github.com/repos/:owner/:repoReplace "owner with username and :repo with the repo<jupyter_code>repo_names = [d['full_name'] for d in data]
repo_names
endpoints = [f"https://api.github.com/repos/{r}" for r in repo_names ]
endpoints
repo_data = [requests.get(url).json() for url in endpoints]
repo_data
created = [(rd['name'], rd['created_at']) for rd in repo_data]
created
df = pd.DataFrame(created)
df.columns = ['repo', 'creation']
df
df['date'] = pd.to_datetime(df['creation'])
df
df['year'] = df['date'].apply(lambda x: x.year)
df
df[df['year']==2019]
df.groupby('year')['repo'].count()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1608084358523726, 'fraction_numerical': 0.009666080843585237, 'mean_word_length': 6.301282051282051, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '118998', 'license': 'MIT', 'n_tokens_mistral': 413, 'n_tokens_neox': 388, 'n_words': 91, 'path': '26-warmup-solution_apis_json_rest_graphql.ipynb', 'repo_name': 'hanisaf/advanced-data-management-and-analytics', 'size': '1138'}