code: def expect(self, pattern, timeout=-1):
          
  
          if self.blocking:
              raise RuntimeError("expect can only be used on non-blocking commands.")
  
          try:
              self.subprocess.expect(pattern=pattern, timeout=timeout)
          except pexpect.EOF:
              pass
docs: Waits on the given pattern to appear in std_out