code: def pr(self, script=False, expanded=False, verbose=False) -> str:
          
          if verbose:
              ret_str = self.listformat.format(self.idx, str(self).rstrip())
              if self != self.expanded:
                  ret_str += self.ex_listformat.format(self.idx, self.expanded.rstrip())
          else:
              if script:
                  # display without entry numbers
                  if expanded or self.statement.multiline_command:
                      ret_str = self.expanded.rstrip()
                  else:
                      ret_str = str(self)
              else:
                  # display a numbered list
                  if expanded or self.statement.multiline_command:
                      ret_str = self.listformat.format(self.idx, self.expanded.rstrip())
                  else:
                      ret_str = self.listformat.format(self.idx, str(self).rstrip())
          return ret_str
docs: Represent a HistoryItem in a pretty fashion suitable for printing.
  
          If you pass verbose=True, script and expanded will be ignored
  
          :return: pretty print string version of a HistoryItem