Accessing the attributes by function getattr() and putting into the OrderedDict()
from collections import OrderedDict
del_attr = ["function", "module"]
def parse_config(cfg_module):
args = [ i for i in dir(cfg_module) if not i.startswith("__")]
config = OrderedDict()
for arg in args:
k = arg
v = getattr(cfg_module, arg)
import pdb
pdb.set_trace()
if type(v).__name__ in del_attr and k != "device":
continue
else:
config[k] = v
return config