def getfiletypeunit(nf, filetype):
    for cunit, cvals in nf.items():
        if cvals.filetype.lower() == filetype.lower():
            return cunit
    print('Name file does not contain file of type "{0}"'.format(filetype))
    return None

# function to test if a string is an integer
Method to return unit number of a package from a NamData instance
dataset/ETHPy150Open modflowpy/flopy/flopy/utils/mfreadnam.py/getfiletypeunit