(email)
Given an email, attempt to find a Github username
       associated with the email.

    `$ ddev meta scripts email2ghuser example@datadoghq.com`
Given an email, attempt to find a Github username
       associated with the email.
Given an email attempt to find a Github username associated with the email .
def email2ghuser(email):
    """Given an email, attempt to find a Github username
       associated with the email.

    `$ ddev meta scripts email2ghuser example@datadoghq.com`
    """

    try:
        response = requests.get(f'https://api.github.com/search/users?q={email}')
        response.raise_for_status()
        content = response.json()

        if content.get('total_count') == 0:
            abort(f'No username found for email {email}')

        user = content.get('items')[0]
        username = user.get('login')

        echo_success(f'Found username "{username}" associated with email {email}')

    except Exception as e:
        abort(str(e))
def email2ghuser ( email ) : try : response = requests . get ( f'https://api.github.com/search/users?q={email}' ) response . raise_for_status ( ) content = response . json ( ) if content . get ( 'total_count' ) == 0 : abort ( f'No username found for email {email}' ) user = content . get ( 'items' ) [ 0 ] username = user . get ( 'login' ) echo_success ( f'Found username "{username}" associated with email {email}' ) except Exception as e : abort ( str ( e ) )