human
I wrote the below code

    if (subroutines is not None):
        subroutines = [x.lower() for x in subroutines]
    def split_file(fname):
        with open(fname, 'rb') as f:
            lines = f.readlines()
            subs = []
            need_split_next = True
            for (ix, line) in enumerate(lines):
                m = re.match('^\\s+subroutine\\s+([a-z0-9_]+)\\s*\\(', line, re.I)
                if (m and (line[0] not in 'Cc!*')):
                    if (subroutines is not None):
                        subr_name = m.group(1).decode('ascii').lower()
                        subr_wanted = (subr_name in subroutines)
                    else:
                        subr_wanted = True
                    if (subr_wanted or need_split_next):
                        need_split_next = subr_wanted
                        subs.append(ix)
            if (len(subs) <= 1):
                return [fname]
            new_fnames = []
            num_files = len(subs)
            for nfile in range(num_files):
                new_fname = (((fname[:(-2)] + '_subr_') + str(nfile)) + '.f')
                new_fnames.append(new_fname)
                if (not newer(fname, new_fname)):
                    continue
                with open(new_fname, 'wb') as fn:
                    if ((nfile + 1) == num_files):
                        fn.writelines(lines[subs[nfile]:])
                    else:
                        fn.writelines(lines[subs[nfile]:subs[(nfile + 1)]])
        return new_fnames
    exclude_pattern = re.compile('_subr_[0-9]')
    source_fnames = [f for f in glob.glob(os.path.join(source_dir, '*.f')) if (not exclude_pattern.search(os.path.basename(f)))]
    fnames = []
    for source_fname in source_fnames:
        created_files = split_file(source_fname)
        if (created_files is not None):
            for cfile in created_files:
                fnames.append(os.path.basename(cfile))
    return fnames

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def split_fortran_files(source_dir, subroutines=None):