def _getlines(f):
    """Get lines from filelike `f`, skipping empty lines and lines with "#"."""
    for line in f:
        line = line.strip()
        if line and line[0] != '#':
            yield line
