code: def is_dir(self, pathobj):
          
          try:
              stat = self.stat(pathobj)
  
              return stat.is_dir
          except OSError as exc:
              if exc.errno != errno.ENOENT:
                  raise
              return False
docs: Returns True if given path is a directory