import re


def _starts_with_ident(line, ident):
    """Returns true, if line starts with given number of spaces."""
    if ident <= 0:
        return False
    match = re.search(r'^[ ]{%s}[^ ]' % ident, line)
    return match is not None