<commit_before>import argparse

import gevent.monkey
from closeio_api import APIError, Client as CloseIO_API
from gevent.pool import Pool

gevent.monkey.patch_all()

parser = argparse.ArgumentParser(
    description='Restore an array of deleted leads by ID. This CANNOT restore status changes or call recordings.'
)
parser.add_argument('--api-key', '-k', required=True, help='API Key')
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
    '--leads', help='List of lead IDs in a form of a comma separated list'
)
group.add_argument(
    '--leads-file',
    help='List of lead IDs in a form of a textual file with single column of lead IDs',
)
args = parser.parse_args()
api = CloseIO_API(args.api_key)

# Array of Lead IDs. Add the IDs you want to restore here.
if args.leads:
    lead_ids = args.leads.split(",")
elif args.leads_file:
    with open(args.leads_file) as f:
        lines = f.readlines()
    lead_ids = [el.strip() for el in lines]  # Strip new lines
    lead_ids = list(filter(None, lead_ids))  # Strip empty lines<commit_msg>Fix Monkey-patching by reordering the imports<commit_after>import argparse

import gevent.monkey

gevent.monkey.patch_all()
from closeio_api import APIError, Client as CloseIO_API
from gevent.pool import Pool

parser = argparse.ArgumentParser(
    description='Restore an array of deleted leads by ID. This CANNOT restore status changes or call recordings.'
)
parser.add_argument('--api-key', '-k', required=True, help='API Key')
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
    '--leads', help='List of lead IDs in a form of a comma separated list'
)
group.add_argument(
    '--leads-file',
    help='List of lead IDs in a form of a textual file with single column of lead IDs',
)
args = parser.parse_args()
api = CloseIO_API(args.api_key)

# Array of Lead IDs. Add the IDs you want to restore here.
if args.leads:
    lead_ids = args.leads.split(",")
elif args.leads_file:
    with open(args.leads_file) as f:
        lines = f.readlines()
    lead_ids = [el.strip() for el in lines]  # Strip new lines
    lead_ids = list(filter(None, lead_ids))  # Strip empty lines
{'fraction_non_alphanumeric': 0.10257589696412144, 'fraction_numerical': 0.0, 'mean_word_length': 4.166270783847981, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3200850', 'n_tokens_mistral': 714, 'n_tokens_neox': 694, 'n_words': 240}