parameters: (self, symbol, func=None, fields="")
return_statement: return (rsp['symbols'], msg)
docstring: Subscribe securites
        
          This function adds new securities to subscribed list on the server. If
          success, return subscribed codes.
        
          If securities is empty, return current subscribed codes.
docstring_summary: Subscribe securites
        
          This function adds new securities to subscribed list on the server. If
          success, return subscribed codes.
        
          If securities is empty, return current subscribed codes.
docstring_tokens: Subscribe securites This function adds new securities to subscribed list on the server . If success return subscribed codes . If securities is empty return current subscribed codes .
function: def subscribe(self, symbol, func=None, fields=""):
          """Subscribe securites
        
          This function adds new securities to subscribed list on the server. If
          success, return subscribed codes.
        
          If securities is empty, return current subscribed codes.
          """
          r, msg = self._check_session()
          if not r:
              return (r, msg)
          
          if func:
              self._on_jsq_callback = func
          
          rpc_params = {"symbol": symbol,
                        "fields": fields}
          
          cr = self._remote.call("jsq.subscribe", rpc_params)
          
          rsp, msg = utils.extract_result(cr, data_format="", class_name="SubRsp")
          if not rsp:
              return (rsp, msg)
          
          new_codes = [x.strip() for x in symbol.split(',') if x]
          
          self._subscribed_set = self._subscribed_set.union(set(new_codes))
          self._schema_id = rsp['schema_id']
          self._schema = rsp['schema']
          self._sub_hash = rsp['sub_hash']
          self._make_schema_map()
          return (rsp['symbols'], msg)
function_tokens: def subscribe ( self , symbol , func = None , fields = "" ) : r , msg = self . _check_session ( ) if not r : return ( r , msg ) if func : self . _on_jsq_callback = func rpc_params = { "symbol" : symbol , "fields" : fields } cr = self . _remote . call ( "jsq.subscribe" , rpc_params ) rsp , msg = utils . extract_result ( cr , data_format = "" , class_name = "SubRsp" ) if not rsp : return ( rsp , msg ) new_codes = [ x . strip ( ) for x in symbol . split ( ',' ) if x ] self . _subscribed_set = self . _subscribed_set . union ( set ( new_codes ) ) self . _schema_id = rsp [ 'schema_id' ] self . _schema = rsp [ 'schema' ] self . _sub_hash = rsp [ 'sub_hash' ] self . _make_schema_map ( ) return ( rsp [ 'symbols' ] , msg )