def _indent(docstring, text):
    if not docstring:
        return text
    lines = docstring.expandtabs().splitlines()
    indent = _min_indent(lines)
    if indent < _maxsize:
        newlines = _trim(text, return_lines=True)
        return "\n" + ("\n".join([(" " * indent) + line for line in newlines]))
    else:
        return "\n" + text
Returns text indented at appropriate indententation level.
dataset/ETHPy150Open Calysto/metakernel/metakernel/magic.py/_indent