code: def exit_cleanly(error_number=0):
      
      default = "An Unknown error has occurred!"
      descriptions = \
          {22: 'An improper input error has occurred.  Please see above stmt(s)',
           29: 'An operation failed.  Please see above stmt(s)',
           5: 'An IO Error has occurred.  Pelase see above stmt(s)'}
      try:
          error_number = int(error_number)
      except TypeError:
          stmt = default
          error_number = -1
      if error_number == 0:
          stmt = "No error has been detected!"
      elif not isinstance(error_number, int) and hasattr(errno, error_number):
          error_number = getattr(errno, error_number)
          stmt = descriptions[error_number] if error_number in descriptions \
              else default
      elif error_number in descriptions:
          stmt = descriptions[error_number]
      else:
          stmt = default
      if error_number:
          print("""
  %s [--opt [option]]
      With opts:
          working_directory - the full path to the working directory
          operating_system - the full name of the operating system lower case
          version - the version of the operating system
  
      All of these options must be supplied, and if one is missing or if there is
      no corresponding:
          <working_directory>/*-dist/Docker/<operating_system>/<version>
      Directory, then this script will exit cleanly reporting it as an error.
              """ % sys.argv[0])
      print("(%d) %s" % (error_number, stmt), file=sys.stderr)
      sys.exit(error_number)
docs: exit_cleanly
  
  Performs standard error notification and exiting statements as necessary.  This
  assures more consistent error handling within the script.