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",")","."]
code: def __init__(self, shell=None, **kwargs):
      # Now define isexec in a cross platform manner.
      self.is_posix = False
      self.execre = None
      if os.name == "posix":
          self.is_posix = True
      else:
          try:
              winext = (
                  os.environ["pathext"]
                  .replace(";", "|")
                  .replace(".", "")
              )
          except KeyError:
              winext = "exe|com|bat|py"
          try:
              self.execre = re.compile(
                  r"(.*)\.(%s)$" % winext, re.IGNORECASE
              )
          except re.error:
              warn(
                  "Seems like your pathext environmental "
                  "variable is malformed. Please check it to "
                  "enable a proper handle of file extensions "
                  "managed for your system"
              )
              winext = "exe|com|bat|py"
              self.execre = re.compile(
                  r"(.*)\.(%s)$" % winext, re.IGNORECASE
              )
  
      # call up the chain
      super().__init__(shell=shell, **kwargs)
  
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 1 to create a new OSMagics object from inherited base classes: Magics with example: obj = OSMagics(shell)