def _make_flex_doc(op_name, typ):
op_name = op_name.replace('<STR_LIT>', '<STR_LIT>')<EOL>op_desc = _op_descriptions[op_name]<EOL>if op_desc['<STR_LIT>']:<EOL><INDENT>equiv = '<STR_LIT>' + op_desc['<STR_LIT>'] + '<STR_LIT:U+0020>' + typ<EOL><DEDENT>else:<EOL><INDENT>equiv = typ + '<STR_LIT:U+0020>' + op_desc['<STR_LIT>'] + '<STR_LIT>'<EOL><DEDENT>if typ == '<STR_LIT>':<EOL><INDENT>base_doc = _flex_doc_SERIES<EOL>doc_no_examples = base_doc.format(<EOL>desc=op_desc['<STR_LIT>'],<EOL>op_name=op_name,<EOL>equiv=equiv,<EOL>reverse=op_desc['<STR_LIT>']<EOL>)<EOL>if op_desc['<STR_LIT>']:<EOL><INDENT>doc = doc_no_examples + op_desc['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>doc = doc_no_examples<EOL><DEDENT><DEDENT>elif typ == '<STR_LIT>':<EOL><INDENT>base_doc = _flex_doc_FRAME<EOL>doc = base_doc.format(<EOL>desc=op_desc['<STR_LIT>'],<EOL>op_name=op_name,<EOL>equiv=equiv,<EOL>reverse=op_desc['<STR_LIT>']<EOL>)<EOL><DEDENT>elif typ == '<STR_LIT>':<EOL><INDENT>base_doc = _flex_doc_PANEL<EOL>doc = base_doc.format(<EOL>desc=op_desc['<STR_LIT>'],<EOL>op_name=op_name,<EOL>equiv=equiv,<EOL>reverse=op_desc['<STR_LIT>']<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise AssertionError('<STR_LIT>')<EOL><DEDENT>return doc<EOL>
Make the appropriate substitutions for the given operation and class-typ
into either _flex_doc_SERIES or _flex_doc_FRAME to return the docstring
to attach to a generated method.

Parameters
----------
op_name : str {'__add__', '__sub__', ... '__eq__', '__ne__', ...}
typ : str {series, 'dataframe']}

Returns
-------
doc : str