<jupyter_start><jupyter_text>Solution to exercise 1<jupyter_code>import requests
from getpass import getpass
pd = getpass(prompt="Enter you github password: ")
user = "<EMAIL>"
rsp = requests.get("https://api.github.com/user", auth=(user, pd))
rsp.json()<jupyter_output><empty_output><jupyter_text>Solution to exercise 2<jupyter_code>repo = {'name': 'csc2017-test', 'description': 'a test repo created for the CSC institute.'}
rsp = requests.post("https://api.github.com/user/repos", json=repo, auth=(user, pd))
rsp.status_code
rsp.json()<jupyter_output><empty_output><jupyter_text>Solution to exercise 3<jupyter_code>repo = {'name': 'csc2017-test', 'description': 'a test repo created for the CSC institute.'}
rsp = requests.get("https://api.github.com/repos/joestubbs/csc2017-test", json=repo, auth=(user, pd))
rsp.json()<jupyter_output><empty_output><jupyter_text>Solution to exercise 4<jupyter_code>repo = {'name': 'csc2017-test', 'description': 'a test repo created for the CSC institute.', 'has_projects': False, }
rsp = requests.patch("https://api.github.com/repos/joestubbs/csc2017-test", json=repo, auth=(user, pd))
rsp.json()<jupyter_output><empty_output><jupyter_text>Solution to exercise 5<jupyter_code>rsp = requests.delete("https://api.github.com/repos/joestubbs/csc2017-test", auth=(user, pd))
rsp.status_code
rsp.content<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16325036603221083, 'fraction_numerical': 0.0212298682284041, 'mean_word_length': 7.707006369426751, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 5, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '132111', 'license': 'MIT', 'n_tokens_mistral': 516, 'n_tokens_neox': 490, 'n_words': 92, 'path': 'docs/day2/notebooks/Solutions_to_api_auth.ipynb', 'repo_name': 'TACC/CSC2018Institute', 'size': '1379'}