INNER CODE UNIT · Python

dict_put_path

aehrc/VariantSpark · cloud/aws-emr/python/vs_emr/cli.py:86

def dict_put_path(dictionary, path_key, value):
    path = path_key.split(".")
    current_dict = dictionary
    for key in path[:-1]:
        sub_dict = current_dict.get(key)
        if dict != type(sub_dict):
            sub_dict = dict()
            current_dict[key] = sub_dict
        current_dict = sub_dict
    current_dict[path[-1]] = value


""" Make the dict use yaml compatible values for None(null) and Boolean (types)
"""
def yamlize_dict(d):
    def convert_value(v):
        if type(v) == dict:
            return yamlize_dict(v)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…