

def dedent(text, *args, **kw):
    "\n    Dedent a string (remove common leading whitespace from all lines).\n\n    Removes common leading whitespace from all lines in the string using\n    :func:`textwrap.dedent()`, removes leading and trailing empty lines using\n    :func:`trim_empty_lines()` and interpolates any arguments using\n    :func:`format()`.\n\n    :param text: The text to dedent (a string).\n    :param args: Any positional arguments are interpolated using :func:`format()`.\n    :param kw: Any keyword arguments are interpolated using :func:`format()`.\n    :returns: The dedented text (a string).\n\n    The :func:`compact()` function's documentation contains an example of how I\n    like to use the :func:`compact()` and :func:`dedent()` functions. The main\n    difference is that I use :func:`compact()` for text that will be presented\n    to the user (where whitespace is not so significant) and :func:`dedent()`\n    for data file and code generation tasks (where newlines and indentation are\n    very significant).\n    "
    dedented_text = textwrap.dedent(text)
    trimmed_text = trim_empty_lines(dedented_text)
    return format(trimmed_text, *args, **kw)

dataset/ETHPy150Open xolox/python-humanfriendly/humanfriendly/text.py dedent/original