a1c0cae864a52f1581bfdbc2c9f855dc9bca7f61,mystic/scripts.py,,,#,1132
Before Change
// initialize doc
try: log_reader()
except TypeError:
pass
try: model_plotter()
except TypeError:
pass
try: collapse_plotter()
After Change
return params, costs
def_get_instance = """
def _get_instance(location, *args, **kwds):
given the import location of a model or model class, return the model
args and kwds will be passed to the constructor of the model class
globals = {}
package, target = location.rsplit(".",1)
code = "from {0} import {1} as model".format(package, target)
code = compile(code, "<string>", "exec")
%(exec_string)s
model = globals["model"]
import inspect
if inspect.isclass(model):
model = model(*args, **kwds)
return model
""" % dict(exec_string=exec_string)
exec(def_get_instance)
del def_get_instance
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: uqfoundation/mystic
Commit Name: a1c0cae864a52f1581bfdbc2c9f855dc9bca7f61
Time: 2017-07-07
Author: mmckerns@968178ea-60bd-409e-af13-df8a517b6005
File Name: mystic/scripts.py
Class Name:
Method Name:
Project Name: bokeh/bokeh
Commit Name: 947e3c02d66cb62192ee1ea5e4a71d47b3477b33
Time: 2015-12-19
Author: bryanv@continuum.io
File Name: examples/embed/widget.py
Class Name:
Method Name:
Project Name: dmlc/gluon-cv
Commit Name: 4b8716fd4bd6f462a9db9eee958f2508576ec019
Time: 2018-06-15
Author: cheungchih@gmail.com
File Name: gluoncv/utils/metrics/coco_detection.py
Class Name: COCODetectionMetric
Method Name: __init__