def stats(self):
    from utils.task_helpers import stats
    parser = ArgParseDefault(description='Output various stats about project', usage=STATS_USAGE_DESC)
    parser.add_argument('command', choices=['all', 'overview', 'sample', 'annotation', 'annotator_outliers', 'annotation_cleaned'], help='Subcommand to run')
    args = parser.parse_args(sys.argv[2:3])
    if (args.command == 'annotation'):
        parser = ArgParseDefault(description='Print stats about annotations')
        parser.add_argument('-m', '--mode', choices=['all', 'mturk', 'local', 'public', 'other', '*'], type=str, required=False, default='all', help='Print stats for certain annotation modes only.')
        args = parser.parse_args(sys.argv[3:])
        stats('annotation', **vars(args))
    elif (args.command == 'annotator_outliers'):
        parser = ArgParseDefault(description='Find annotators which have under-performed compared to others')
        parser.add_argument('-m', '--mode', choices=['mturk', 'local', 'public', 'other'], type=str, required=False, default='mturk', help='Print stats for certain annotation modes only.')
        parser.add_argument('-b', '--batch-name', type=str, required=False, dest='batch_name', default='*', help='Only analyse for specific local/mturk batch name (this looks for a pattern in filename). Default: All data')
        parser.add_argument('--agreement-cutoff', dest='agreement_cutoff', type=float, required=False, default=3, help='Z-value cutoff for inter-worker agreement deviation')
        parser.add_argument('--time-cutoff', dest='time_cutoff', type=float, required=False, default=3, help='Z-value cutoff for average task duration per worker')
        parser.add_argument('--min-tasks', dest='min_tasks', type=int, required=False, default=3, help='Min tasks for worker to have completed before considered as outlier')
        parser.add_argument('--min-comparisons-count', dest='min_comparisons_count', type=int, required=False, default=20, help='Min number of questions to compare for a worker needed to compute agreement score')
        args = parser.parse_args(sys.argv[3:])
        stats('annotator_outliers', **vars(args))
    else:
        stats(args.command)
def stats(self):
    from utils.task_helpers import stats
    parser = ArgParseDefault(description='Output various stats about project', usage=STATS_USAGE_DESC)
    parser.add_argument('command', choices=['all', 'overview', 'sample', 'annotation', 'annotator_outliers', 'annotation_cleaned'], help='Subcommand to run')
    args = parser.parse_args(sys.argv[2:3])
    if (args.command == 'annotation'):
        parser = ArgParseDefault(description='Print stats about annotations')
        parser.add_argument('-m', '--mode', choices=['all', 'mturk', 'local', 'public', 'other', '*'], type=str, required=False, default='all', help='Print stats for certain annotation modes only.')
        args = parser.parse_args(sys.argv[3:])
        stats('annotation', **vars(args))
    elif (args.command == 'annotator_outliers'):
        parser = ArgParseDefault(description='Find annotators which have under-performed compared to others')
        parser.add_argument('-m', '--mode', choices=['mturk', 'local', 'public', 'other'], type=str, required=False, default='mturk', help='Print stats for certain annotation modes only.')
        parser.add_argument('-b', '--batch-name', type=str, required=False, dest='batch_name', default='*', help='Only analyse for specific local/mturk batch name (this looks for a pattern in filename). Default: All data')
        parser.add_argument('--agreement-cutoff', dest='agreement_cutoff', type=float, required=False, default=3, help='Z-value cutoff for inter-worker agreement deviation')
        parser.add_argument('--time-cutoff', dest='time_cutoff', type=float, required=False, default=3, help='Z-value cutoff for average task duration per worker')
        parser.add_argument('--min-tasks', dest='min_tasks', type=int, required=False, default=3, help='Min tasks for worker to have completed before considered as outlier')
        parser.add_argument('--min-comparisons-count', dest='min_comparisons_count', type=int, required=False, default=20, help='Min number of questions to compare for a worker needed to compute agreement score')
        args = parser.parse_args(sys.argv[3:])
        stats('annotator_outliers', **vars(args))
    else:
        stats(args.command)