class_docstr: Defines the protocol for chatting with starcraft.
docstr: Create and send a specific request, and return the response.
  
  For example: send(ping=sc_pb.RequestPing()) => sc_pb.ResponsePing
  
  Args:
    **kwargs: A single kwarg with the name and value to fill in to Request.
  
  Returns:
    The Response corresponding to your request.
  Raises:
    ConnectionError: if it gets a different response.
docstr_tok: ["Create","and","send","a","specific","request",",","and","return","the","response",".","For","example",":","send","(","ping=sc_pb.RequestPing","(",")",")","=",">","sc_pb.ResponsePing","Args",":","*","*","kwargs",":","A","single","kwarg","with","the","name","and","value","to","fill","in","to","Request",".","Returns",":","The","Response","corresponding","to","your","request",".","Raises",":","ConnectionError",":","if","it","gets","a","different","response","."]
code: def send(self, **kwargs):
      """Create and send a specific request, and return the response.
  
      For example: send(ping=sc_pb.RequestPing()) => sc_pb.ResponsePing
  
      Args:
        **kwargs: A single kwarg with the name and value to fill in to Request.
  
      Returns:
        The Response corresponding to your request.
      Raises:
        ConnectionError: if it gets a different response.
      """
      assert len(kwargs) == 1, "Must make a single request."
      name = list(kwargs.keys())[0]
      req = sc_pb.Request(**kwargs)
      req.id = next(self._count)
      try:
          res = self.send_req(req)
      except ConnectionError as e:
          raise ConnectionError(
              "Error during %s: %s" % (name, e)
          ) from e
      if res.HasField("id") and res.id != req.id:
          raise ConnectionError(
              "Error during %s: Got a response with a different id"
              % name
          )
      return getattr(res, name)
  
imports: import contextlib
  import enum
  import itertools
  import os
  import socket
  import sys
  import time
  from absl import flags
  from absl import logging
  from pysc2.lib import stopwatch
  import websocket
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 7 for calling the StarcraftProtocol obj's underlying member method code with example usage: obj.send() and returns: getattr