def indent(text, times=1, tab='    '):
    """ Returns indented text

    Inserts times number of tabs for each line and at the beginning
    """
    if not text:
        return ''

    tabs = tab * times
    return tabs + text.replace('\n', "\n%s" % tabs)