code: def input(self, prompt, type='', defaultLast=False, **kwargs):
          'Get user input, with history of `type`, defaulting to last history item if no input and defaultLast is True.'
          if type:
              histlist = list(self.lastInputs[type].keys())
              ret = self._inputLine(prompt, history=histlist, **kwargs)
              if ret:
                  self.lastInputs[type][ret] = ret
              elif defaultLast:
                  histlist or fail("no previous input")
                  ret = histlist[-1]
          else:
              ret = self._inputLine(prompt, **kwargs)
  
          return ref input(self, prompt, type='', defaultLast=False, **kwargs):
          'Get user input, with history of `type`, defaulting to last history item if no input and defaultLast is True.'
          if type:
              histlist = list(self.lastInputs[type].keys())
              ret = self._inputLine(prompt, history=histlist, **kwargs)
              if ret:
                  self.lastInputs[type][ret] = ret
              elif defaultLast:
                  histlist or fail("no previous input")
                  ret = histlist[-1]
          else:
              ret = self._inputLine(prompt, **kwargs)
  
          return ret
docs: Get user input, with history of `type`, defaulting to last history item if no input and defaultLast is True.