code: def isfile_notempty(inputfile: str) -> bool:
          
          try:
              return isfile(inputfile) and getsize(inputfile) > 0
          except TypeError:
              raise TypeError('inputfile is not a valid type')
docs: Check if the input filename with path is a file and is not empty.