Merge two dictionaries; duplicate keys get value from b.

def merge_dictionaries(a, b):
  """Merge two dictionaries; duplicate keys get value from b."""
  res = {}
  for k in a:
    res[k] = a[k]
  for k in b:
    res[k] = b[k]
  return res