<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tabulate_filetypes_rest(attrnames=None, header=None, flag_wrap_description=True, description_width=40, flag_leaf=True):
 """ Generates a reST multirow table Args: attrnames: list of attribute names (keys of FILE_TYPE_INFO_ATTRS). Defaults to all attributes header: list of strings containing headers. If not passed, uses default names flag_wrap_description: whether to wrap the description text description_width: width to wrap the description text (effective only if flag_wrap_description is True) flag_leaf: returns only classes that do not have subclasses ("leaf" nodes as in a class tree graph) """


    infos = get_filetypes_info(editor_quote="``", flag_leaf=flag_leaf)
    rows, header = filetypes_info_to_rows_header(infos, attrnames, header, flag_wrap_description,
                                                 description_width)
    ret = a99.rest_table(rows, header)
    return ret