<jupyter_start><jupyter_text>Fetch all labels and tags on this account<jupyter_code>try:
    # Call the Gmail API
    service = build('gmail', 'v1', credentials=creds)
    results = service.users().labels().list(userId='me').execute()
    labels = results.get('labels', [])
    if not labels:
        print('No labels found.')
    else:
        print('Labels:')
        for label in labels:
            print(label['name'])

except HttpError as error:
    # TODO(developer) - Handle errors from gmail API.
    print(f'An error occurred: {error}')<jupyter_output><empty_output><jupyter_text>Get unread message IDs in InboxMessages are paginated, thus the iteration code<jupyter_code>try:
    service = build('gmail', 'v1', credentials=creds)
    results = service.users().messages().list(userId='me', q="in:inbox is:unread").execute()
    messages = []
    if 'messages' in results:
        messages.extend(results['messages'])
    while 'nextPageToken' in results:
        page_token = results['nextpagetoken']
        results = service.users().messages().list(userId='me', q="in:inbox is:unread", pageToken=page_token).execut()
        if 'messages' in results:
            messages.extend(results['messages'])

except HttpError as error:
    # TODO(developer) - Handle errors from gmail API.
    print(f'An error occurred: {error}')<jupyter_output><empty_output><jupyter_text>and their countThis is all I want for my polybar notifier<jupyter_code>len(results['messages'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13506320691949433, 'fraction_numerical': 0.0013306719893546241, 'mean_word_length': 4.204152249134948, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '34042', 'license': 'Apache-2.0', 'n_tokens_mistral': 461, 'n_tokens_neox': 461, 'n_words': 112, 'path': 'notebooks/Gmail API.ipynb', 'repo_name': 'gregoryg/homelab', 'size': '1503'}