code: def get(vals, key, default_val=None):
      
      val = vals
      for part in key.split('.'):
          if isinstance(val, dict):
              val = val.get(part, None)
              if val is None:
                  return default_val
          else:
              return default_val
      return val
docs: Returns a dictionary value