<commit_before>"""Call backs for the HPSS interface.
"""

from . import logger

import peewee as pw
import click

from ch_util import data_index as di

# Get a reference to the log
log = logger.get_log()

# Reconnect to the database read/write
di.connect_database(read_write=True)


@click.group()
def cli():
    """Call back commands for updating the database from a shell script after an
    HPSS transfer. """
    pass


@cli.command()
@click.argument('file_id', type=int)
@click.argument('node_id', type=int)
def push_failed(file_id, node_id):
    """Update the database to reflect that the HPSS transfer failed.<commit_msg>Tweaked the logging import to reduce the number of messages from alpenhorn_hpss.<commit_after>"""Call backs for the HPSS interface.
"""

import peewee as pw
import click

from ch_util import data_index as di

from . import logger  # Import logger here to avoid connection
                      # messages for transfer

# Get a reference to the log
log = logger.get_log()

# Reconnect to the database read/write
di.connect_database(read_write=True)


@click.group()
def cli():
    """Call back commands for updating the database from a shell script after an
    HPSS transfer. """
    pass


@cli.command()
@click.argument('file_id', type=int)
@click.argument('node_id', type=int)
def push_failed(file_id, node_id):
    """Update the database to reflect that the HPSS transfer failed.
{'fraction_non_alphanumeric': 0.09284195605953224, 'fraction_numerical': 0.0, 'mean_word_length': 4.172161172161172, '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': '7628195', 'n_tokens_mistral': 426, 'n_tokens_neox': 420, 'n_words': 163}