<commit_before>from imapclient import IMAPClient

HOST = 'imap.host.com'
USERNAME = 'someuser'
PASSWORD = '<PASSWORD>'

server = IMAPClient(HOST, use_uid=True)
server.login(USERNAME, PASSWORD)

number_msgs = server.select_folder('INBOX')
print '%d messages in INBOX' % number_msgs

messages = server.search(['NOT DELETED'])
print "%d messages that aren't deleted" % len(messages)

print
print "Messages:"
response = server.fetch(messages, ['FLAGS', 'RFC822.SIZE'])
for msgid, data in response.iteritems():
    print '   ID %d: %d bytes, flags=%s' % (
            msgid,
            data['RFC822.SIZE'],
            ','.join(data['FLAGS']))<commit_msg>Updated example to match current select_folder response<commit_after>from imapclient import IMAPClient

HOST = 'imap.host.com'
USERNAME = 'someuser'
PASSWORD = '<PASSWORD>'
ssl = False

server = IMAPClient(HOST, use_uid=True, ssl=ssl)
server.login(USERNAME, PASSWORD)

select_info = server.select_folder('INBOX')
print '%d messages in INBOX' % select_info['EXISTS']

messages = server.search(['NOT DELETED'])
print "%d messages that aren't deleted" % len(messages)

print
print "Messages:"
response = server.fetch(messages, ['FLAGS', 'RFC822.SIZE'])
for msgid, data in response.iteritems():
    print '   ID %d: %d bytes, flags=%s' % (
            msgid,
            data['RFC822.SIZE'],
            ','.join(data['FLAGS']))
{'fraction_non_alphanumeric': 0.14909090909090908, 'fraction_numerical': 0.008727272727272728, 'mean_word_length': 4.396078431372549, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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}}
{'dir': 'git-commits-cleaned', 'id': '6157860', 'n_tokens_mistral': 459, 'n_tokens_neox': 445, 'n_words': 116}