Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)
Merge the dictionary 'outof' into the dictionary 'into'. If matching keys are found and the value is a
dictionary, then the sub dictionary is merged.

        def merge_dictionaries(outof, into, prefix='\t'):
    """Merge the dictionary 'outof' into the dictionary 'into'. If matching keys are found and the value is a
    dictionary, then the sub dictionary is merged."""
    for k in outof.keys():
        if k in into:
            if isinstance(outof[k], dict):
                LOG.debug("%sMerging:%s", prefix, k)
                into[k] = merge_dictionaries(outof[k], into[k], prefix + '\t')
            else:
                LOG.debug("%sSkipping:%s", prefix, k)
        else:
            into[k] = outof[k]
    return into
        


src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/json2json.py   turbulenz_tools(Download)
# pylint: disable=W0403
from stdtool import simple_options
from turbulenz_tools.utils.json_utils import float_to_string, log_metrics, merge_dictionaries
# pylint: enable=W0403
 
                j = json_load(source)
                if isinstance(j, dict):
                    merged = merge_dictionaries(j, merged)
                else:
                    merged = j

src/t/u/turbulenz_tools-HEAD/turbulenz_tools/tools/json2json.py   turbulenz_tools(Download)
# pylint: disable=W0403
from stdtool import simple_options
from turbulenz_tools.utils.json_utils import float_to_string, log_metrics, merge_dictionaries
# pylint: enable=W0403
 
                j = json_load(source)
                if isinstance(j, dict):
                    merged = merge_dictionaries(j, merged)
                else:
                    merged = j

src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/stdtool.py   turbulenz_tools(Download)
# pylint: disable=W0403
from asset2json import JsonAsset
from turbulenz_tools.utils.json_utils import merge_dictionaries
# pylint: enable=W0403
 
                with open(infile, 'r') as infile_file:
                    infile_json = json_load(infile_file)
                    definitions = merge_dictionaries(infile_json, definitions)
            else:
                LOG.error('Missing file: %s', infile)

src/t/u/turbulenz_tools-HEAD/turbulenz_tools/tools/stdtool.py   turbulenz_tools(Download)
# pylint: disable=W0403
from asset2json import JsonAsset
from turbulenz_tools.utils.json_utils import merge_dictionaries
# pylint: enable=W0403
 
                with open(infile, 'r') as infile_file:
                    infile_json = json_load(infile_file)
                    definitions = merge_dictionaries(infile_json, definitions)
            else:
                LOG.error('Missing file: %s', infile)