cd8726cd9455abd8a0f11106c4251c11721255f4,opts.py,,parse_opt,#,5

Before Change


        cn = CfgNode.load_yaml_with_base(args.cfg)
        for k,v in cn.items():
            if hasattr(args, k):
                setattr(args, k, v)
            else:
                print("Warning: key %s not in args" %k)
        args = parser.parse_args(namespace=args)

After Change


        for k,v in cn.items():
            if not hasattr(args, k):
                print("Warning: key %s not in args" %k)
            setattr(args, k, v)
        args = parser.parse_args(namespace=args)

    // Check if args are valid
    assert args.rnn_size > 0, "rnn_size should be greater than 0"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: ruotianluo/ImageCaptioning.pytorch
Commit Name: cd8726cd9455abd8a0f11106c4251c11721255f4
Time: 2020-03-10
Author: rluo@ttic.edu
File Name: opts.py
Class Name:
Method Name: parse_opt


Project Name: matthewwithanm/django-imagekit
Commit Name: 5e00de5204ff2f0a18db91f710bf1888a6e45057
Time: 2011-09-09
Author: matthew@exanimo.com
File Name: imagekit/models.py
Class Name: ImageModelBase
Method Name: __init__