elif config_file.endswith(".json") or config_file.endswith("json"):
res = json.load(fid)
return res.get(child_name, res) if child_name else res
elif config_file.endswith(".json") or config_file.endswith("json"):
res = json.load(fid)
return res.get(child_name, res) if child_name else res