def document_pipeline(pipeline): def the_function(*args, **kwargs): return pipeline(*args, **kwargs) if hasattr(pipeline, 'doc'): doc = pipeline.doc elif pipeline.__doc__ is not None: doc = pipeline.__doc__ else: doc = '' the_function.__doc__ = dedent("""%s **Keyword arguments:** %s""") % ( dedent(doc), traits_doc(pipeline.get_all_traits()), ) return the_function
def document_pipeline(pipeline): def the_function(*args, **kwargs): return pipeline(*args, **kwargs) if hasattr(pipeline, 'doc'): doc = pipeline.doc elif pipeline.__doc__ is not None: doc = pipeline.__doc__ else: doc = '' the_function.__doc__ = dedent("""%s **Keyword arguments:** %s""") % (dedent(doc), traits_doc(pipeline.get_all_traits()),) return the_function