class_docstr: Creates socket server that sends the received data to the DeepPavlov model and returns model response.
  
  The server receives bytes array consists of the `header` and the `body`. The `header` is the first 4 bytes
  of the array - `body` length in bytes represented by a packed unsigned int (byte order is little-endian).
  `body` is dictionary serialized to JSON formatted bytes array that server sends to the model. The dictionary
  keys should match model arguments names, the values should be lists or tuples of inferenced values.
  
  Socket server request creation example:
      >>> from deeppavlov.utils.socket import encode
      >>> request = encode({"context":["Elon Musk launched his cherry Tesla roadster to the Mars orbit"]})
      >>> request
      b'I{"x": ["Elon Musk launched his cherry Tesla roadster to the Mars orbit"]}'
  
  Socket server response, like the request, consists of the header and the body. Response body is dictionary
  {'status': status, 'payload': payload} serialized to a JSON formatted byte array, where:
      status (str): 'OK' if the model successfully processed the data, else - error message.
      payload: (Optional[List[Tuple]]): The model result if no error has occurred, otherwise None.
class_docstr_tok: ["Creates","socket","server","that","sends","the","received","data","to","the","DeepPavlov","model","and","returns","model","response",".","The","server","receives","bytes","array","consists","of","the","`","header","`","and","the","`","body","`",".","The","`","header","`","is","the","first","4","bytes","of","the","array","-","`","body","`","length","in","bytes","represented","by","a","packed","unsigned","int","(","byte","order","is","little-endian",")",".","`","body","`","is","dictionary","serialized","to","JSON","formatted","bytes","array","that","server","sends","to","the","model",".","The","dictionary","keys","should","match","model","arguments","names",",","the","values","should","be","lists","or","tuples","of","inferenced","values",".","Socket","server","request","creation","example",":",">",">",">","from","deeppavlov.utils.socket","import","encode",">",">",">","request","=","encode","(","{","``","context","''",":","[","``","Elon","Musk","launched","his","cherry","Tesla","roadster","to","the","Mars","orbit","''","]","}",")",">",">",">","request","b","'","I\u0000\u0000\u0000","{","``","x","''",":","[","``","Elon","Musk","launched","his","cherry","Tesla","roadster","to","the","Mars","orbit","''","]","}","'","Socket","server","response",",","like","the","request",",","consists","of","the","header","and","the","body",".","Response","body","is","dictionary","{","'status","'",":","status",",","'payload","'",":","payload","}","serialized","to","a","JSON","formatted","byte","array",",","where",":","status","(","str",")",":","'OK","'","if","the","model","successfully","processed","the","data",",","else","-","error","message",".","payload",":","(","Optional","[","List","[","Tuple","]","]",")",":","The","model","result","if","no","error","has","occurred",",","otherwise","None","."]
docstr: Launches socket server
docstr_tok: ["Launches","socket","server"]
code: def start(self) -> None:
      """Launches socket server"""
      log.info(self._launch_msg)
      try:
          self._loop.run_forever()
      except KeyboardInterrupt:
          pass
      except Exception as e:
          log.error(f"got exception {e} while running server")
      finally:
          self._loop.close()
  
file_path: DeepPavlov/deeppavlov/utils/socket/socket.py
imports: import asyncio
  import json
  from logging import getLogger
  from pathlib import Path
  from struct import pack, unpack
  from typing import Any, List, Optional, Tuple, Union
  from deeppavlov.core.commands.infer import build_model
  from deeppavlov.core.common.chainer import Chainer
  from deeppavlov.core.data.utils import jsonify_data
  from deeppavlov.utils.connector import DialogLogger
  from deeppavlov.utils.server import get_server_params
label_desc: Use image node_id 2 for calling the SocketServer obj's underlying member method code with example usage: obj.start() without return types