'Try to guess if the file is a SDF2 file.
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname(\'drugbank_drugs.sdf\')
>>> SDF().sniff(fname)
True
>>> fname = get_test_fname(\'drugbank_drugs.cml\')
>>> SDF().sniff(fname)
False'

def sniff(self, filename):

    counter = (count_special_lines('^M\\s*END', filename) + count_special_lines('^\\$\\$\\$\\$', filename))
    if ((counter > 0) and ((counter % 2) == 0)):
        return True
    else:
        return False
