def type_list(signature, doc, header):
lines = []<EOL>docced = set()<EOL>lines.append(header)<EOL>try:<EOL><INDENT>for names, types, description in doc:<EOL><INDENT>names, types = _get_names(names, types)<EOL>unannotated = []<EOL>for name in names:<EOL><INDENT>docced.add(name)<EOL>try:<EOL><INDENT>typ = signature.parameters[name].annotation<EOL>if typ == inspect._empty:<EOL><INDENT>raise AttributeError<EOL><DEDENT>default = signature.parameters[name].default<EOL>type_string = string_annotation(typ, default)<EOL>lines.append(f"<STR_LIT>")<EOL>lines.append("<STR_LIT>")<EOL><DEDENT>except (AttributeError, KeyError):<EOL><INDENT>unannotated.append(name)  <EOL><DEDENT><DEDENT>if len(unannotated) > <NUM_LIT:0>:<EOL><INDENT>lines.append("<STR_LIT>")<EOL>lines.append("<STR_LIT:U+002CU+0020>".join(f"<STR_LIT>" for name in unannotated))<EOL>if types != "<STR_LIT>" and len(unannotated) > <NUM_LIT:0>:<EOL><INDENT>lines.append(f"<STR_LIT>")<EOL><DEDENT><DEDENT>lines.append("<STR_LIT>")<EOL>lines.append(f"<STR_LIT>")<EOL><DEDENT>for names, types, description in doc:<EOL><INDENT>names, types = _get_names(names, types)<EOL>for name in names:<EOL><INDENT>if name not in docced:<EOL><INDENT>try:<EOL><INDENT>typ = signature.parameters[name].annotation<EOL>default = signature.parameters[name].default<EOL>type_string = string_annotation(typ, default)<EOL>lines.append(f"<STR_LIT>")<EOL>lines.append("<STR_LIT>")<EOL><DEDENT>except (AttributeError, KeyError):<EOL><INDENT>lines.append(f"<STR_LIT>")<EOL>lines.append("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>print(e)<EOL><DEDENT>return lines if len(lines) > <NUM_LIT:1> else []<EOL>
Construct a list of types, preferring type annotations to
docstrings if they are available.

Parameters
----------
signature : Signature
    Signature of thing
doc : list of tuple
    Numpydoc's type list section

Returns
-------
list of str
    Markdown formatted type list