code: def clear():
      
      if not isatty(sys.stdout):
          return
      # If we're on Windows and we don't have colorama available, then we
      # clear the screen by shelling out.  Otherwise we can use an escape
      # sequence.
      if WIN:
          os.system('cls')
      else:
          sys.stdout.write('\033[2J\033[1;1H')
docs: Clears the terminal screen.  This will have the effect of clearing
      the whole visible space of the terminal and moving the cursor to the
      top left.  This does not do anything if not connected to a terminal.
  
      .. versionadded:: 2.0