<commit_before>import asyncio
import click
import schedule
import time
from datetime import datetime

from importer import (
    update as do_update,
    migrate as do_migrate,
    reimport as do_reimport,
)


@click.group()
def import_():
    pass


@import_.command()
def migrate():
    """
    Create a new index, copy old data into it if any, switch.
    """
    run_sync(do_migrate())


@import_.command()
@click.option('--all', is_flag=True, help="Load all events, including past ones")
def update(all):
    """
    Import events and places from KudaGo.
    """
    since = None if all else get_today()
    run_sync(do_update(since))


@import_.command()
def reimport():
    """
    Import all data from KudaGo into a new index and switch.
    """
    run_sync(do_reimport())


@import_.command()
def autoupdate():
    """
    Start automatic update on schedule.

    Quick (actual-only) updates are run every hour.
    Full updates are run every Monday.
    """
    schedule.every().monday.do(lambda: run_sync(do_update(None)))
    schedule.every().hour.do(lambda: run_sync(do_update(get_today())))
    while True:<commit_msg>Update docstrings for import commands<commit_after>import asyncio
import click
import schedule
import time
from datetime import datetime

from importer import (
    update as do_update,
    migrate as do_migrate,
    reimport as do_reimport,
)


@click.group()
def import_():
    pass


@import_.command()
def migrate():
    """
    Create a new index, copy old data, switch.
    """
    run_sync(do_migrate())


@import_.command()
@click.option('--all', is_flag=True, help="Load all events, including past ones")
def update(all):
    """
    Import events and places from KudaGo.
    """
    since = None if all else get_today()
    run_sync(do_update(since))


@import_.command()
def reimport():
    """
    Import all data into a new index and switch.
    """
    run_sync(do_reimport())


@import_.command()
def autoupdate():
    """
    Start automatic update on schedule.

    Quick (actual-only) updates are run every hour.
    Full updates are run every Monday.
    """
    schedule.every().monday.do(lambda: run_sync(do_update(None)))
    schedule.every().hour.do(lambda: run_sync(do_update(get_today())))
    while True:
{'fraction_non_alphanumeric': 0.11931064958020327, 'fraction_numerical': 0.0, 'mean_word_length': 3.483168316831683, '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': '2439646', 'n_tokens_mistral': 714, 'n_tokens_neox': 701, 'n_words': 217}