<commit_before>import click
import requests
from   ..api   import show_response
from   ..edit  import edit_as_mail
from   ..local import get_github_repo

@click.command('edit')
def cli():
    """ Edit repository details """
    owner, repo = get_github_repo()
    url = 'https://api.github.com/repos/{}/{}'.format(owner, repo)
    s = requests.Session()
    r = s.get(url)
    if not r.ok:
        show_response(r)
    about = r.json()
    edited = edit_as_mail(about, 'name private description homepage'
                                 ' default_branch has_wiki has_issues'.split())
    if not edited:
        click.echo('No modifications made; exiting')
    else:
        r = s.patch(url, json=edited)
        if not r.ok:
            show_response(r)<commit_msg>Did GitHub just start enforcing this?<commit_after>import click
import requests
from   ..api   import show_response
from   ..edit  import edit_as_mail
from   ..local import get_github_repo

@click.command('edit')
def cli():
    """ Edit repository details """
    owner, repo = get_github_repo()
    url = 'https://api.github.com/repos/{}/{}'.format(owner, repo)
    s = requests.Session()
    r = s.get(url)
    if not r.ok:
        show_response(r)
    about = r.json()
    edited = edit_as_mail(about, 'name private description homepage'
                                 ' default_branch has_wiki has_issues'.split())
    if not edited:
        click.echo('No modifications made; exiting')
    else:
        # DO NOT default the name to `repo`, as that will differ from
        # `about["name"]` when the GitHub repository has been renamed (leaving
        # a redirect) but the local repository's remote URLs haven't been
        # updated yet.
        edited.setdefault("name", about["name"])
        r = s.patch(url, json=edited)
        if not r.ok:
            show_response(r)
{'fraction_non_alphanumeric': 0.11507293354943274, 'fraction_numerical': 0.0, 'mean_word_length': 2.500945179584121, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6308464', 'n_tokens_mistral': 555, 'n_tokens_neox': 538, 'n_words': 163}