Blob Blame Raw

# this file may be used from any of other project files
# so don't import any project files here to avoid recursive imports

def mergedict(dest, src, prefix = None, allow_collisions = False, overwrite = True):
  for k, v in src.items():
    kk = k if prefix is None else prefix + k
    assert allow_collisions or kk not in dest
    if overwrite or kk not in dest:
      dest[kk] = v