def to_doc(name, thing, header_level, source_location):
if type(thing) is enum.EnumMeta:<EOL><INDENT>return enum_doc(name, thing, header_level, source_location)<EOL><DEDENT>if inspect.isclass(thing):<EOL><INDENT>header = f"<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>header = f"<STR_LIT>"<EOL><DEDENT>lines = [<EOL>header,<EOL>get_signature(name, thing),<EOL>get_source_link(thing, source_location),<EOL>]<EOL>try:<EOL><INDENT>doc = NumpyDocString(inspect.getdoc(thing))._parsed_data<EOL>lines += summary(doc)<EOL>lines += attributes_section(thing, doc, header_level)<EOL>lines += params_section(thing, doc, header_level)<EOL>lines += returns_section(thing, doc, header_level)<EOL>lines += examples_section(doc, header_level)<EOL>lines += notes_section(doc)<EOL>lines += refs_section(doc)<EOL><DEDENT>except Exception as e:<EOL><INDENT>pass<EOL><DEDENT>return lines<EOL>
Generate markdown for a class or function

Parameters
----------
name : str
    Name of the thing being documented
thing : class or function
    Class or function to document
header_level : int
    Heading level
source_location : str
    URL of repo containing source code