import re


def adjust_header_indent(line, section_level):
    """
    Parses a line for a markdown header and fixes the
    indent for the specified section level

    eg. '## Header' with section_level=1 will become
    '# Header"

    Arguments:

    - line(str)
    - section_level(int)

    Returns:

    - str
    """

    m = re.match("[#+] (.+)", line)
    if m:
        line = "{} {}".format("#" * (section_level), m.group(1))
    return line