code: def clear_input_buffer(self):
          
          if hasattr(self.stdin, 'isatty') and self.stdin.isatty():
              if os.name == 'nt':
                  while msvcrt.kbhit():
                      msvcrt.getch()
              else:
                  try:
                      self.stdin.seek(0, 2)  # may fail in some unseekable file object
                  except IOError:
                      pass
docs: Clear the input buffer.