<commit_before>import logging

import click

logger = logging.getLogger(__name__)

from scout.load import load_institute

@click.command('institute', short_help='Load a institute')
@click.option('-i', '--internal-id',
                required=True
)
@click.option('-d', '--display-name',
)
@click.pass_context
def institute(ctx, internal_id, display_name):
    """
    Create a new institute and add it to the database
    
    """
    adapter = ctx.obj['adapter']
    
    if not internal_id:
        logger.warning("A institute has to have an internal id")
        ctx.abort()
    
    if not display_name:
        display_name = internal_id
    
    try:
        load_institute(
            adapter=adapter, 
            internal_id=internal_id, 
            display_name=display_name, 
            sanger_recipients=None
        )
    except Exception as e:
        logger.warning(e)
        ctx.abort()<commit_msg>Added possibility to supply sanger_recipients when loading institute<commit_after>import logging

import click

logger = logging.getLogger(__name__)

from scout.load import load_institute


@click.command('institute', short_help='Load a institute')
@click.option('-i', '--internal-id',
              required=True)
@click.option('-d', '--display-name')
@click.option('-s', '--sanger-recipients', )
@click.pass_context
def institute(ctx, internal_id, display_name, sanger_recipients):
    """
    Create a new institute and add it to the database

    """
    adapter = ctx.obj['adapter']

    if not internal_id:
        logger.warning("A institute has to have an internal id")
        ctx.abort()

    if not display_name:
        display_name = internal_id

    try:
        load_institute(
            adapter=adapter,
            internal_id=internal_id,
            display_name=display_name,
            sanger_recipients=sanger_recipients
        )
    except Exception as e:
        logger.warning(e)
        ctx.abort()
{'fraction_non_alphanumeric': 0.10374935798664613, 'fraction_numerical': 0.0, 'mean_word_length': 2.641121495327103, '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': '5194817', 'n_tokens_mistral': 587, 'n_tokens_neox': 564, 'n_words': 139}