docs: def deref(data, spec: dict):
      """
      Return dereference data
      :param data:
      :param spec:
      :return:
      """
      if isinstance(data, Sequence):
          is_dict = False
          gen = enumerate(data)
      elif not isinstance(data, Mapping):
          return data
      elif '$ref' in data:
          return deref(get_ref(spec, data['$ref']), spec)
      else:
          is_dict = True
          gen = data.items()  # type: ignore
  
      result = None
  
      for k, v in gen:
          new_v = deref(v, spec)
          if new_v is not v:
              if result is not None:
                  pass
              elif is_dict:
                  result = data.copy()
              else:
                  result = data[:]
              result[k] = new_v
      return result or data