code: def _is_of_type(self, path, st_flag, follow_symlinks=True):
          
          path = make_string_path(path)
          if path is None:
              raise TypeError
          try:
              obj = self.resolve(path, follow_symlinks)
              if obj:
                  self.raise_for_filepath_ending_with_separator(
                      path, obj, macos_handling=not follow_symlinks)
                  return S_IFMT(obj.st_mode) == st_flag
          except (IOError, OSError):
              return False
          return False
docs: Helper function to implement isdir(), islink(), etc.
  
          See the stat(2) man page for valid stat.S_I* flag values
  
          Args:
              path: Path to file to stat and test
              st_flag: The stat.S_I* flag checked for the file's st_mode
  
          Returns:
              (boolean) `True` if the st_flag is set in path's st_mode.
  
          Raises:
            TypeError: if path is None