docs: def related_obj_to_dict(obj, **kwargs):
      """ Covert a known related object to a dictionary. """
  
      # Explicitly discard formatter kwarg, should not be cascaded down.
      kwargs.pop('formatter', None)
  
      # If True, remove fields that start with an underscore (e.g. _secret)
      suppress_private_attr = kwargs.get("suppress_private_attr", False)
  
      # if True, don't store fields with None values into dictionary.
      suppress_empty_values = kwargs.get("suppress_empty_values", False)
  
      # get list of attrs fields
      attrs = fields(obj.__class__)
  
      # instantiate return dict, use OrderedDict type by default
      return_dict = kwargs.get("dict_factory", OrderedDict)()
  
      for a in attrs:
  
          # skip if private attr and flag tells you to skip
          if suppress_private_attr and a.name.startswith("_"):
              continue
  
          metadata = a.metadata or {}
  
          # formatter is a related-specific `attrs` meta field
          #   see fields.DateField
          formatter = metadata.get('formatter')
  
          # get value and call to_dict on it, passing the kwargs/formatter
          value = getattr(obj, a.name)
          value = to_dict(value, formatter=formatter, **kwargs)
  
          # check flag, skip None values
          if suppress_empty_values and value is None:
              continue
  
          # field name can be overridden by the metadata field
          key_name = a.metadata.get('key') or a.name
  
          # store converted / formatted value into return dictionary
          return_dict[key_name] = value
  
      return return_dict