def prefix_lines(lines, prefix):
    """Add the prefix to each of the lines.

    >>> prefix_lines(['foo', 'bar'], '  ')
    ['  foo', '  bar']
    >>> prefix_lines('foo\\nbar', '  ')
    ['  foo', '  bar']

    :param list or str lines: A string or a list of strings. If a string is
        passed, the string is split using splitlines().
    :param str prefix: Prefix to add to the lines. Usually an indent.
    :returns: list
    """
    if isinstance(lines, bytes):
        lines = lines.decode('utf-8')
    if isinstance(lines, str):
        lines = lines.splitlines()
    return [prefix + line for line in lines]
Add the prefix to each of the lines.

    >>> prefix_lines(['foo', 'bar'], '  ')
    ['  foo', '  bar']
    >>> prefix_lines('foo\\nbar', '  ')
    ['  foo', '  bar']

    :param list or str lines: A string or a list of strings. If a string is
        passed, the string is split using splitlines().
    :param str prefix: Prefix to add to the lines. Usually an indent.
    :returns: list