<commit_before>from bureaucrate import init

mailboxes_base = '~/mail/test_account'
mailboxes_names = ['INBOX', 'notifications', 'love of my life']

# You can also omit `mailboxes_names`, and init() will try to
# get mailbox in `mailboxes_base`
mailboxes = init(mailboxes_base, mailboxes_names)

for message in mailboxes['INBOX']:
    # move the message to mailbox _notifications_, and mark as read if the word
    # 'notification' is in the subject
    message.subject_has('notification').mark_as_read().move_to('notifications')

    # sort every mail from <EMAIL> to 'love of my life' as starred
    message.is_from('<EMAIL>').move_to('love of my life').star()

# delete mails older than 60 days in mb 'notifications'
for message in mailboxes['notifications']:
    message.older_than('60d').delete()

for message in mailboxes['Spam']:
    message.older_than('60d').delete()<commit_msg>Add example<commit_after>from bureaucrate import init

mailboxes_base = '~/mail/test_account'
mailboxes_names = ['INBOX', 'notifications', 'love of my life']

# You can also omit `mailboxes_names`, and init() will try to
# get mailbox in `mailboxes_base`
mailboxes = init(mailboxes_base, mailboxes_names)

for message in mailboxes['INBOX']:
    # move the message to mailbox _notifications_, and mark as read if the word
    # 'notification' is in the subject
    message.subject_has('notification').mark_as_read().move_to('notifications')

    # sort every mail from <EMAIL> to 'love of my life' as starred
    message.is_from('<EMAIL>').move_to('love of my life').star()

# delete mails older than 60 days in mb 'notifications'
for message in mailboxes['notifications']:
    message.older_than('60d').delete()

for message in mailboxes['Spam']:
    message.older_than('60d').has_replied().negate().delete()
{'fraction_non_alphanumeric': 0.1203342618384401, 'fraction_numerical': 0.006685236768802228, 'mean_word_length': 5.236111111111111, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2799387', 'n_tokens_mistral': 562, 'n_tokens_neox': 546, 'n_words': 176}