code: def expect(p, prefixes, confidential=False):
      
      resp = p.stdout.readline()
      log.debug('%s -> %r', p.args, resp if not confidential else '********')
      for prefix in prefixes:
          if resp.startswith(prefix):
              return resp[len(prefix):]
      raise UnexpectedError(resp)
docs: Read a line and return it without required prefix.