def get_documenter(obj, parent):
 from sphinx.ext.autodoc import AutoDirective, DataDocumenter, ModuleDocumenter
 if inspect.ismodule(obj):
  return ModuleDocumenter
 if (parent is not None):
  parent_doc_cls = get_documenter(parent, None)
 else:
  parent_doc_cls = ModuleDocumenter
 if hasattr(parent, '__name__'):
  parent_doc = parent_doc_cls(FakeDirective(), parent.__name__)
 else:
  parent_doc = parent_doc_cls(FakeDirective(), '')
 classes = [cls for cls in AutoDirective._registry.values() if cls.can_document_member(obj, '', False, parent_doc)]
 if classes:
  classes.sort(key=(lambda cls: cls.priority))
  return classes[(-1)]
 else:
  return DataDocumenter

def get_documenter ( obj , parent ) : from sphinx . ext . autodoc import AutoDirective , DataDocumenter , ModuleDocumenter if inspect . ismodule ( obj ) : return ModuleDocumenter if ( parent is not None ) : parent_doc_cls = get_documenter ( parent , None ) else : parent_doc_cls = ModuleDocumenter if hasattr ( parent , '__name__' ) : parent_doc = parent_doc_cls ( FakeDirective ( ) , parent . __name__ ) else : parent_doc = parent_doc_cls ( FakeDirective ( ) , '' ) classes = [ cls for cls in AutoDirective . _registry . values ( ) if cls . can_document_member ( obj , '' , False , parent_doc ) ] if classes : classes . sort ( key = ( lambda cls : cls . priority ) ) return classes [ ( - 1 ) ] else : return DataDocumenter
get an autodoc .