code: def _cleanup():
      '''
      Make sure that any terminal processes still running when __del__ was called
      to the waited and cleaned up.
      '''
      for inst in _ACTIVE[:]:
          res = inst.isalive()
          if res is not True:
              try:
                  _ACTIVE.remove(inst)
              except ValueError:
                  # This can happen if two threads create a new Terminal instance
                  # It's harmless that it was already removed, so ignore.
                  pasf _cleanup():
      '''
      Make sure that any terminal processes still running when __del__ was called
      to the waited and cleaned up.
      '''
      for inst in _ACTIVE[:]:
          res = inst.isalive()
          if res is not True:
              try:
                  _ACTIVE.remove(inst)
              except ValueError:
                  # This can happen if two threads create a new Terminal instance
                  # It's harmless that it was already removed, so ignore.
                  pass
docs: Make sure that any terminal processes still running when __del__ was called
      to the waited and cleaned up.