def METHOD_NAME(filename, refs, regexs):
    try:
        f = open(filename, 'r')
    except Exception as exc:
        print("Unable to open %s: %s" % (filename, exc), file=verbose_out)
        return False
    data = f.read()
    f.close()
    basename = os.path.basename(filename)
    extension = file_extension(filename)
    if extension != "":
        ref = refs[extension]
    else:
        ref = refs[basename]
    # remove extra content from the top of files
    if extension == "sh":
        p = regexs["shebang"]
        (data, found) = p.subn("", data, 1)
    data = data.splitlines()
    # if our test file is smaller than the reference it surely fails!
    if len(ref) > len(data):
        print('File %s smaller than reference (%d < %d)' %
              (filename, len(data), len(ref)),
              file=verbose_out)
        return False
    # trim our file to the same number of lines as the reference file
    data = data[:len(ref)]
    p = regexs["year"]
    for d in data:
        if p.search(d):
            print('File %s has the YEAR field, but missing the year of date' %
                  filename, file=verbose_out)
            return False
    # Replace all occurrences of regex "2014|2015|2016|2017|2018" with "YEAR"
    p = regexs["date"]
    for i, d in enumerate(data):
        (data[i], found) = p.subn('YEAR', d)
        if found != 0:
            break
    # if we don't match the reference at this point, fail
    if ref != data:
        print("Header in %s does not match reference, diff:" %
              filename, file=verbose_out)
        if args.verbose:
            print(file=verbose_out)
            for line in difflib.unified_diff(
                    ref, data, 'reference', filename, lineterm=''):
                print(line, file=verbose_out)
            print(file=verbose_out)
        return False
    return True