<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_markdown_levels(lines, levels=set((0, 1, 2, 3, 4, 5, 6))):
 r""" Return a list of 2-tuples with a level integer for the heading levels [(0, 'paragraph '), (2, 'bad'), (0, '# hello'), (3, 'world')] [(0, '- bullet '), (2, 'bad'), (0, '# hello'), (3, 'world')] [(2, 'bad')] [] """

    if isinstance(levels, (int, float, basestring, str, bytes)):
        levels = [float(levels)]
    levels = set([int(i) for i in levels])
    if isinstance(lines, basestring):
        lines = lines.splitlines()
    level_lines = []
    for line in lines:
        level_line = None
        if 0 in levels:
            level_line = (0, line)
        lstripped = line.lstrip()
        for i in range(6, 1, -1):
            if lstripped.startswith('#' * i):
                level_line = (i, lstripped[i:].lstrip())
                break
        if level_line and level_line[0] in levels:
            level_lines.append(level_line)
    return level_lines