e57d05d4b82e5b0b7cb1247a51413ec920530c26,sacred/observers/mongo.py,MongoDbOption,MongoDbOption_1,#,296

Before Change


        r"\.?"
    URL_PATTERN = "(?:" + HOSTNAME_PATTERN + ")" + ":" + "(?:[0-9]{1,5})"
    PRIORITY_PATTERN = "(?P<priority>!-?\d+)?"
    DB_NAME = re.compile("^" + DB_NAME_PATTERN + PRIORITY_PATTERN + "$")
    URL = re.compile("^" + URL_PATTERN + PRIORITY_PATTERN + "$")
    URL_DB_NAME = re.compile("^(?P<url>" + URL_PATTERN + ")" + ":" +
                             "(?P<db_name>" + DB_NAME_PATTERN + ")" +
                             PRIORITY_PATTERN + "$")

After Change



    RUN_ID_PATTERN = r"(?P<run_id>\d{1,12})"
    PORT1_PATTERN = r"(?P<port1>\d{1,5})"
    PORT2_PATTERN = r"(?P<port2>\d{1,5})"
    PRIORITY_PATTERN = "(?P<priority>-?\d+)?"
    DB_NAME_PATTERN = r"(?P<db>[_A-Za-z][0-9A-Za-z//%&"()+\-;=@\[\]^_{}]{0,63})"
    COLL_NAME_PATTERN = r"(?P<coll>[_A-Za-z][0-9A-Za-z//%&"()+\-;=@\[\]^_{}]{0,63})"
    HOSTNAME1_PATTERN = r"(?P<host1>" \
                        r"[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?" \
                        r"(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*)"
    HOSTNAME2_PATTERN = r"(?P<host2>" \
                        r"[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?" \
                        r"(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*)"

    HOST_ONLY = r"^(?:{host}:{port})$".format(host=HOSTNAME1_PATTERN, port=PORT1_PATTERN)
    FULL = r"^(?:{host}:{port}:)?{db}(?:\.{collection}(?::{rid})?)?(?:!{priority})?$".format(
        host=HOSTNAME2_PATTERN,
        port=PORT2_PATTERN,
        db=DB_NAME_PATTERN,
        collection=COLL_NAME_PATTERN,
        rid=RUN_ID_PATTERN,
        priority=PRIORITY_PATTERN)

    PATTERN = r"{host_only}|{full}".format(host_only=HOST_ONLY, full=FULL)

    @classmethod
    def apply(cls, args, run):
        url, db_name, collection, run_id, priority = cls.parse_mongo_db_arg(args)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: IDSIA/sacred
Commit Name: e57d05d4b82e5b0b7cb1247a51413ec920530c26
Time: 2017-10-31
Author: qwlouse@gmail.com
File Name: sacred/observers/mongo.py
Class Name: MongoDbOption
Method Name: MongoDbOption_1


Project Name: coala/coala-bears
Commit Name: 97e98900c388126230d1eef0f2666fb1a5723944
Time: 2018-05-04
Author: viresh16118@iiitd.ac.in
File Name: bears/vcs/git/GitCommitBear.py
Class Name: GitCommitBear
Method Name: check_issue_reference


Project Name: GPflow/GPflow
Commit Name: dec3dcf7b86168234e38e4f40059abecd3245c44
Time: 2017-10-29
Author: art.art.v@gmail.com
File Name: testing/test_profiling.py
Class Name: TestProfiling
Method Name: test_eachtime