code: def _doc_object(obj, obj_type, nest=None, config=default_config):
      
      doc = inspect.getdoc(obj)
  
      if not doc and not nest:
          return None
  
      result = {
          'type': obj_type,
          'name': obj.__name__,
          'doc': doc
      }
  
      if nest:
          result['nest'] = nest
  
      return result
docs: Return a dict with type, name, doc and nested doc (if any).