def indent(str, level):
    """
    Returns string where each line is indented by the given level in tabs.
    """
    if level == 0: return str
    return "\n".join("\t" * level + line for line in str.splitlines())