c472f856ac60d0fff63b90642d912d7e0db1c7dd,dataset/models/base.py,BaseModel,get_from_config,#BaseModel#Any#Any#Any#,33
Before Change
def get_from_config(self, variable, default=None, config=None):
Return a variable from config or a default value
if "/" in variable:
var = variable.split("/")
prefix = var[:-1]
var_name = var[-1]
else:
prefix = []
var_name = variable
config = config or self.config
for p in prefix:
if p in config:
config = config[p]
else:
config = None
break
if config:
return config.get(var_name, default)
return default
After Change
def get_from_config(self, variable, default=None, config=None):
Return a variable from config or a default value
config = config or self.config
try:
value = self.get(variable, config)
except KeyError:
return default
return value
def _make_inputs(self, names=None):
Make model input data using config
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: analysiscenter/batchflow
Commit Name: c472f856ac60d0fff63b90642d912d7e0db1c7dd
Time: 2017-11-16
Author: rhudor@gmail.com
File Name: dataset/models/base.py
Class Name: BaseModel
Method Name: get_from_config
Project Name: arraiy/torchgeometry
Commit Name: 206798edabf99a8ee4bb03ffba25968d2057bb18
Time: 2020-07-30
Author: anguelos.nicolaou@gmail.com
File Name: setup.py
Class Name:
Method Name:
Project Name: pytorch/tutorials
Commit Name: 00e131977b4e2cbe134f8832f3fbac7940644586
Time: 2018-08-29
Author: minkawhich@fb.com
File Name: beginner_source/hybrid_frontend/introduction_to_hybrid_frontend_tutorial.py
Class Name:
Method Name: