<commit_before>#!/usr/bin/env python

import json
import os
import re
import redis
import time

from argparse import ArgumentParser, RawTextHelpFormatter
from datetime import datetime
from getpass import getpass
from six import iteritems
from string import ascii_lowercase as alpha

from webrecorder.redisman import init_manager_for_cli
from webrecorder.redisutils import RedisTable


def main(args=None):
    parser = ArgumentParser(formatter_class=RawTextHelpFormatter)
    parser.add_argument('-c', '--create-user',
                        dest='create_user',
                        nargs='*',
                        default=None,
                        help=('Interface to add a new user. \n\n'
                              'supply arguments e.g.\n'
                              '`python admin.py -c <email> <username> <passwd> <role> \'<full name>\'`\n'
                              '\n or simply `python admin.py -c` for interactive creation.'))

    parser.add_argument('-m', '--modify-user', dest='modify_user',
                        action='store_true', help='Interface to modify a user (role, email)')
    parser.add_argument('-d', '--delete-user', dest='delete_user',
                        action='store_true', help='Interface to delete a user.')
    parser.add_argument('-i', '--invite')
    parser.add_argument('-l', '--list', action='store_true')
    parser.add_argument('-b', '--backlog')
    parser.add_argument('-a', '--invite-all', action='store_true', default=False)

    r = parser.parse_args(args=args)
    m = init_manager_for_cli()

    if r.backlog:
        do_invite_backlog(m, r.backlog)
    elif r.list:
        list_not_invited(m, r.invite_all)
    elif r.invite:
        do_invite(m, r.invite)
    elif r.create_user is not None:
        create_user(m, *r.create_user)
    elif r.modify_user:
        modify_user(m)<commit_msg>admin.py: reremove obsolete option<commit_after>#!/usr/bin/env python

import json
import os
import re
import redis
import time

from argparse import ArgumentParser, RawTextHelpFormatter
from datetime import datetime
from getpass import getpass
from six import iteritems
from string import ascii_lowercase as alpha

from webrecorder.redisman import init_manager_for_cli
from webrecorder.redisutils import RedisTable


def main(args=None):
    parser = ArgumentParser(formatter_class=RawTextHelpFormatter)
    parser.add_argument('-c', '--create-user',
                        dest='create_user',
                        nargs='*',
                        default=None,
                        help=('Interface to add a new user. \n\n'
                              'supply arguments e.g.\n'
                              '`python admin.py -c <email> <username> <passwd> <role> \'<full name>\'`\n'
                              '\n or simply `python admin.py -c` for interactive creation.'))

    parser.add_argument('-m', '--modify-user', dest='modify_user',
                        action='store_true', help='Interface to modify a user (role, email)')
    parser.add_argument('-d', '--delete-user', dest='delete_user',
                        action='store_true', help='Interface to delete a user.')
    parser.add_argument('-i', '--invite')
    parser.add_argument('-l', '--list', action='store_true')
    parser.add_argument('-b', '--backlog')

    r = parser.parse_args(args=args)
    m = init_manager_for_cli()

    if r.backlog:
        do_invite_backlog(m, r.backlog)
    elif r.list:
        list_not_invited(m, r.invite_all)
    elif r.invite:
        do_invite(m, r.invite)
    elif r.create_user is not None:
        create_user(m, *r.create_user)
    elif r.modify_user:
        modify_user(m)
{'fraction_non_alphanumeric': 0.12040315990193408, 'fraction_numerical': 0.0, 'mean_word_length': 2.4, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2209937', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1104, 'n_words': 272}