def line_pad(linestr, padding=''):
    """

    :param linestr: multiple line string with `\n` as line separator.
    :param padding: left padding string to add before each line.
    It could also be a callable object that returns a string.
    This is useful when creating dynamic padding.

    :return: multiple line string with `\n` as line separator, with left padding added.
    """
    lines = linestr.split("\n")

    if type(padding) in (str, bytes):
        lines = [padding + x for x in lines]

    elif callable(padding):
        lines = [padding(x) + x for x in lines]

    lines = "\n".join(lines)

    return lines