docs: def bind(end_point, socket_type):
      """
      Bind to a zmq URL; raise a proper error if the URL is invalid; return
      a zmq socket.
      """
      sock = context.socket(socket_type)
      try:
          sock.bind(end_point)
      except zmq.error.ZMQError as exc:
          sock.close()
          raise exc.__class__('%s: %s' % (exc, end_point))
      return sock