class_docstr: Magics to interact with the underlying OS (shell-type functionality).
      
class_docstr_tok: ["Magics","to","interact","with","the","underlying","OS","(","shell-type","functionality",")","."]
docstr: Update the alias table with all executable files in $PATH.
  
  rehashx explicitly checks that every entry in $PATH is a file
  with execute access (os.X_OK).
  
  Under Windows, it checks executability as a match against a
  '|'-separated string of extensions, stored in the IPython config
  variable win_exec_ext.  This defaults to 'exe|com|bat'.
  
  This function also resets the root module cache of module completer,
  used on slow filesystems.
docstr_tok: ["Update","the","alias","table","with","all","executable","files","in","$","PATH",".","rehashx","explicitly","checks","that","every","entry","in","$","PATH","is","a","file","with","execute","access","(","os.X_OK",")",".","Under","Windows",",","it","checks","executability","as","a","match","against","a","'|'-separated","string","of","extensions",",","stored","in","the","IPython","config","variable","win_exec_ext",".","This","defaults","to","'exe|com|bat","'",".","This","function","also","resets","the","root","module","cache","of","module","completer",",","used","on","slow","filesystems","."]
code: def rehashx(self, parameter_s=""):
      """Update the alias table with all executable files in $PATH.
  
      rehashx explicitly checks that every entry in $PATH is a file
      with execute access (os.X_OK).
  
      Under Windows, it checks executability as a match against a
      '|'-separated string of extensions, stored in the IPython config
      variable win_exec_ext.  This defaults to 'exe|com|bat'.
  
      This function also resets the root module cache of module completer,
      used on slow filesystems.
      """
      from IPython.core.alias import InvalidAliasError
  
      # for the benefit of module completer in ipy_completers.py
      del self.shell.db["rootmodules_cache"]
  
      path = [
          os.path.abspath(os.path.expanduser(p))
          for p in os.environ.get("PATH", "").split(os.pathsep)
      ]
  
      syscmdlist = []
      savedir = os.getcwd()
  
      # Now walk the paths looking for executables to alias.
      try:
          # write the whole loop for posix/Windows so we don't have an if in
          # the innermost part
          if self.is_posix:
              for pdir in path:
                  try:
                      os.chdir(pdir)
                  except OSError:
                      continue
  
                  # for python 3.6+ rewrite to: with os.scandir(pdir) as dirlist:
                  dirlist = os.scandir(path=pdir)
                  for ff in dirlist:
                      if self.isexec(ff):
                          fname = ff.name
                          try:
                              # Removes dots from the name since ipython
                              # will assume names with dots to be python.
                              if not self.shell.alias_manager.is_alias(
                                  fname
                              ):
                                  self.shell.alias_manager.define_alias(
                                      fname.replace(".", ""), fname
                                  )
                          except InvalidAliasError:
                              pass
                          else:
                              syscmdlist.append(fname)
          else:
              no_alias = Alias.blacklist
              for pdir in path:
                  try:
                      os.chdir(pdir)
                  except OSError:
                      continue
  
                  # for python 3.6+ rewrite to: with os.scandir(pdir) as dirlist:
                  dirlist = os.scandir(pdir)
                  for ff in dirlist:
                      fname = ff.name
                      base, ext = os.path.splitext(fname)
                      if (
                          self.isexec(ff)
                          and base.lower() not in no_alias
                      ):
                          if ext.lower() == ".exe":
                              fname = base
                              try:
                                  # Removes dots from the name since ipython
                                  # will assume names with dots to be python.
                                  self.shell.alias_manager.define_alias(
                                      base.lower().replace(".", ""),
                                      fname,
                                  )
                              except InvalidAliasError:
                                  pass
                              syscmdlist.append(fname)
  
          self.shell.db["syscmdlist"] = syscmdlist
      finally:
          os.chdir(savedir)
  
imports: import io
  import os
  import pathlib
  import re
  import sys
  from pprint import pformat
  from IPython.core import magic_arguments
  from IPython.core import oinspect
  from IPython.core import page
  from IPython.core.alias import AliasError, Alias
  from IPython.core.error import UsageError
  from IPython.core.magic import Magics, compress_dhist, magics_class, line_magic, cell_magic, line_cell_magic
  from IPython.testing.skipdoctest import skip_doctest
  from IPython.utils.openpy import source_to_unicode
  from IPython.utils.process import abbrev_cwd
  from IPython.utils.terminal import set_term_title
  from traitlets import Bool
  from warnings import warn
label_desc: Use image node_id 7 for calling the OSMagics obj's underlying member method code with example usage: obj.rehashx(parameter_s) without return types