def traverse_dict(data, key, default, delimiter=DEFAULT_TARGET_DELIM):
 try:
  for each in key.split(delimiter):
   data = data[each]
 except (KeyError, IndexError, TypeError):
  return default
 return data

def traverse_dict ( data , key , default , delimiter = DEFAULT_TARGET_DELIM ) : try : for each in key . split ( delimiter ) : data = data [ each ] except ( KeyError , IndexError , TypeError ) : return default return data
traverse a dict using a colon-delimited target string .