class_docstr: The ZMQ socket object
  
  To create a Socket, first create a Context::
  
      ctx = zmq.Context.instance()
  
  then call ``ctx.socket(socket_type)``::
  
      s = ctx.socket(zmq.ROUTER)
class_docstr_tok: ["The","ZMQ","socket","object","To","create","a","Socket",",","first","create","a","Context",":",":","ctx","=","zmq.Context.instance","(",")","then","call","``","ctx.socket","(","socket_type",")","``",":",":","s","=","ctx.socket","(","zmq.ROUTER",")"]
docstr: Receive a message with a custom deserialization function.
  
  .. versionadded:: 17
  
  Parameters
  ----------
  deserialize : callable
      The deserialization function to use.
      deserialize will be called with one argument: the list of frames
      returned by recv_multipart() and can return any object.
  flags : int, optional
      Any valid flags for :func:`Socket.recv`.
  copy : bool, optional
      Whether to recv bytes or Frame objects.
  
  Returns
  -------
  obj : object
      The object returned by the deserialization function.
  
  Raises
  ------
  ZMQError
      for any of the reasons :func:`~Socket.recv` might fail
docstr_tok: ["Receive","a","message","with","a","custom","deserialization","function",".","..","versionadded",":",":","17","Parameters","--","--","--","--","--","deserialize",":","callable","The","deserialization","function","to","use",".","deserialize","will","be","called","with","one","argument",":","the","list","of","frames","returned","by","recv_multipart","(",")","and","can","return","any","object",".","flags",":","int",",","optional","Any","valid","flags","for",":","func",":","`","Socket.recv","`",".","copy",":","bool",",","optional","Whether","to","recv","bytes","or","Frame","objects",".","Returns","--","--","--","-","obj",":","object","The","object","returned","by","the","deserialization","function",".","Raises","--","--","--","ZMQError","for","any","of","the","reasons",":","func",":","`","~Socket.recv","`","might","fail"]
code: def recv_serialized(self, deserialize, flags=0, copy=True):
      """Receive a message with a custom deserialization function.
  
      .. versionadded:: 17
  
      Parameters
      ----------
      deserialize : callable
          The deserialization function to use.
          deserialize will be called with one argument: the list of frames
          returned by recv_multipart() and can return any object.
      flags : int, optional
          Any valid flags for :func:`Socket.recv`.
      copy : bool, optional
          Whether to recv bytes or Frame objects.
  
      Returns
      -------
      obj : object
          The object returned by the deserialization function.
  
      Raises
      ------
      ZMQError
          for any of the reasons :func:`~Socket.recv` might fail
      """
      frames = self.recv_multipart(flags=flags, copy=copy)
      return self._deserialize(frames, deserialize)
  
imports: import errno
  import random
  import sys
  import warnings
  import zmq
  from zmq.backend import Socket
  from .poll import Poller
  from .None import constants
  from .attrsettr import AttributeSetter
  from zmq.error import ZMQError, ZMQBindError
  from zmq.utils import jsonapi
  from zmq.utils.strtypes import bytes, unicode, basestring
  from .constants import SNDMORE, ENOTSUP, POLLIN, int64_sockopt_names, int_sockopt_names, bytes_sockopt_names, fd_sockopt_names
label_desc: Use image node_id 24 for calling the Socket obj's underlying member method code with example usage: obj.recv_serialized(deserialize, flags, copy) and returns: self