def METHOD_NAME(filename):
    """Check if `filename` is a GENESIS/KINETIKIT file.
    """
    pattern = re.compile('include\s+kkit') # KKIT files must have "include kkit" statement somewhere
    with open(filename, 'r') as infile:
        while True:
            sentence = ''
            contd = False # Flags if we are inside a multi-line entry
            line = infile.readline()
            if not line: # End of file
                return False
            line = line.strip()
            # print 'read:', line
            if line.find('//') == 0: # skip c++ style comment lines
                # print 'c++ comment'
                continue
            # Skip C style multi-line comments
            comment_start = line.find('/*')
            if comment_start >= 0:
                sentence = line[:comment_start]
                # print 'cstart', comment_start, sentence
            while comment_start >= 0 and line:
                # print '#', line
                comment_end = line.find('*/')
                if comment_end >= 0:
                    comment_start = -1;
                    line = line[comment_end+2:] # keep the rest of the line
                    break
                line = infile.readline()
                if line:
                    line = line.strip()
            # Keep extending the sentence with next line if current
            # line ends with continuation token '\'
            if line:
                contd = line.endswith('\\')
            while line and contd:
                sentence += ' ' + line[:-1]
                line = infile.readline()
                if line:
                    line = line.strip()
                    contd = line.endswith('\\')
            # if contd turned false, the last line came out of the
            # while loop unprocessed
            if line:
                sentence += ' ' + line
            # print '>', sentence
            if re.search(pattern, sentence):
                return True
    return False