code: def get_value(data, name, field, allow_many_nested=False):
      
      missing_value = missing
      if allow_many_nested and isinstance(field, ma.fields.Nested) and field.many:
          if is_collection(data):
              return data
  
      if not hasattr(data, "get"):
          return missing_value
  
      multiple = is_multiple(field)
      val = data.get(name, missing_value)
      if multiple and val is not missing:
          if hasattr(data, "getlist"):
              return data.getlist(name)
          elif hasattr(data, "getall"):
              return data.getall(name)
          elif isinstance(val, (list, tuple)):
              return val
          if val is None:
              return None
          else:
              return [val]
      return val
docs: Get a value from a dictionary. Handles ``MultiDict`` types when
      ``multiple=True``. If the value is not found, return `missing`.
  
      :param object data: Mapping (e.g. `dict`) or list-like instance to
          pull the value from.
      :param str name: Name of the key.
      :param bool multiple: Whether to handle multiple values.
      :param bool allow_many_nested: Whether to allow a list of nested objects
          (it is valid only for JSON format, so it is set to True in ``parse_json``
          methods).