def run_from_command_line():
    opts = docopt(__doc__, version=iepy.__version__)
    relation_name = opts.get("<relation>")
    limit = opts.get("--limit")
    rule_name = opts.get("--rule")
    shuffle = opts.get("--shuffle")
    create_evidences = opts.get("--create-evidences")

    if limit is None:
        limit = -1

    try:
        limit = int(limit)
    except __HOLE__:
        logging.error("Invalid limit value, it must be a number")
        sys.exit(1)

    try:
        relation = models.Relation.objects.get(name=relation_name)
    except ObjectDoesNotExist:
        logging.error("Relation {!r} not found".format(relation_name))
        sys.exit(1)

    # Load rules
    rules = get_rules(rule_name)
    rule_regexes = [
        (rule.__name__, compile_rule(rule, relation), rule.answer) for rule in rules
    ]

    # Load evidences
    if EvidenceCandidate.objects.all().count() == 0:
        create_evidences = True
    evidences = CandidateEvidenceManager.candidates_for_relation(
        relation, create_evidences, seg_limit=limit, shuffle_segs=shuffle
    )
    conflict_solver = CandidateEvidenceManager.conflict_resolution_newest_wins
    answers = CandidateEvidenceManager.labels_for(
        relation, evidences, conflict_solver
    )
    run_tests(rule_regexes, evidences, answers)
dataset/ETHPy150Open machinalis/iepy/iepy/instantiation/rules_verifier.py/run_from_command_line