parameters: (self, stream_options)
docstring: Creates filters and sets them to the StreamOptions.
docstring_summary: Creates filters and sets them to the StreamOptions.
docstring_tokens: Creates filters and sets them to the StreamOptions .
function: def setup_stream_options(self, stream_options):
          """Creates filters and sets them to the StreamOptions."""
  
          class _OutgoingMessageFilter(object):
  
              def __init__(self, parent):
                  self._parent = parent
  
              def filter(self, message, end=True, binary=False):
                  return self._parent._process_outgoing_message(
                      message, end, binary)
  
          class _IncomingMessageFilter(object):
  
              def __init__(self, parent):
                  self._parent = parent
                  self._decompress_next_message = False
  
              def decompress_next_message(self):
                  self._decompress_next_message = True
  
              def filter(self, message):
                  message = self._parent._process_incoming_message(
                      message, self._decompress_next_message)
                  self._decompress_next_message = False
                  return message
  
          self._outgoing_message_filter = _OutgoingMessageFilter(self)
          self._incoming_message_filter = _IncomingMessageFilter(self)
          stream_options.outgoing_message_filters.append(
              self._outgoing_message_filter)
          stream_options.incoming_message_filters.append(
              self._incoming_message_filter)
  
          class _OutgoingFrameFilter(object):
  
              def __init__(self, parent):
                  self._parent = parent
                  self._set_compression_bit = False
  
              def set_compression_bit(self):
                  self._set_compression_bit = True
  
              def filter(self, frame):
                  self._parent._process_outgoing_frame(
                      frame, self._set_compression_bit)
                  self._set_compression_bit = False
  
          class _IncomingFrameFilter(object):
  
              def __init__(self, parent):
                  self._parent = parent
  
              def filter(self, frame):
                  self._parent._process_incoming_frame(frame)
  
          self._outgoing_frame_filter = _OutgoingFrameFilter(self)
          self._incoming_frame_filter = _IncomingFrameFilter(self)
          stream_options.outgoing_frame_filters.append(
              self._outgoing_frame_filter)
          stream_options.incoming_frame_filters.append(
              self._incoming_frame_filter)
  
          stream_options.encode_text_message_to_utf8 = False
function_tokens: def setup_stream_options ( self , stream_options ) : class _OutgoingMessageFilter ( object ) : def __init__ ( self , parent ) : self . _parent = parent def filter ( self , message , end = True , binary = False ) : return self . _parent . _process_outgoing_message ( message , end , binary ) class _IncomingMessageFilter ( object ) : def __init__ ( self , parent ) : self . _parent = parent self . _decompress_next_message = False def decompress_next_message ( self ) : self . _decompress_next_message = True def filter ( self , message ) : message = self . _parent . _process_incoming_message ( message , self . _decompress_next_message ) self . _decompress_next_message = False return message self . _outgoing_message_filter = _OutgoingMessageFilter ( self ) self . _incoming_message_filter = _IncomingMessageFilter ( self ) stream_options . outgoing_message_filters . append ( self . _outgoing_message_filter ) stream_options . incoming_message_filters . append ( self . _incoming_message_filter ) class _OutgoingFrameFilter ( object ) : def __init__ ( self , parent ) : self . _parent = parent self . _set_compression_bit = False def set_compression_bit ( self ) : self . _set_compression_bit = True def filter ( self , frame ) : self . _parent . _process_outgoing_frame ( frame , self . _set_compression_bit ) self . _set_compression_bit = False class _IncomingFrameFilter ( object ) : def __init__ ( self , parent ) : self . _parent = parent def filter ( self , frame ) : self . _parent . _process_incoming_frame ( frame ) self . _outgoing_frame_filter = _OutgoingFrameFilter ( self ) self . _incoming_frame_filter = _IncomingFrameFilter ( self ) stream_options . outgoing_frame_filters . append ( self . _outgoing_frame_filter ) stream_options . incoming_frame_filters . append ( self . _incoming_frame_filter ) stream_options . encode_text_message_to_utf8 = False