code: def _iglob(self, pathname, recursive, dironly):
      dirname, basename = self._fs.path_split(
          pathname.replace(os.path.sep, "/")
      )
      if not has_magic(pathname):
          assert not dironly
          if basename:
              if self._fs.exists(pathname):
                  yield pathname
          else:  # pragma: no cover
              # Patterns ending with a slash should match only directories
              if self._fs.isdir(dirname):
                  yield pathname
          return
      if not dirname:  # pragma: no cover
          if recursive and _isrecursive(basename):
              yield from self._glob2(dirname, basename, dironly)
          else:
              yield from self._glob1(dirname, basename, dironly)
          return
      # `os.path.split()` returns the argument itself as a dirname if it is a
      # drive or UNC path.  Prevent an infinite recursion if a drive or UNC path
      # contains magic characters (i.e. r'\\?\C:').
      if dirname != pathname and has_magic(dirname):
          dirs = self._iglob(dirname, recursive, True)
      else:
          dirs = [dirname]
      if has_magic(basename):
          if recursive and _isrecursive(basename):
              glob_in_dir = self._glob2
          else:
              glob_in_dir = self._glob1
      else:
          glob_in_dir = self._glob0
      for dirname in dirs:
          for name in glob_in_dir(dirname, basename, dironly):
              if dirname:
                  yield self._fs.path_join(dirname, name)
              else:
                  yield name
  
file_path: mars/mars/lib/filesystem/_glob.py
imports: import fnmatch
  import os
  import re
  from .core import FileSystem
label_desc: Use image node_id 4 for calling the FileSystemGlob obj's underlying member method code with example usage: obj._iglob(pathname, recursive, dironly) without return types