code: def subscribe(client, name, method, cmd, *args, **kwargs):
      """Subscribe to an event that occurs on the Perspective server
      implementation, like `on_update`."""
      arguments = list(args)
      callback = None
  
      for i in range(len(arguments)):
          if callable(arguments[i]):
              callback = arguments.pop(i)
  
      if len(kwargs) > 0:
          arguments.append(kwargs)
  
      # Instead of storing in a global map, store the callbacks on the
      # client itself.
      client._callback_id += 1
      client._callback_cache[callback] = client._callback_id
      client._callback_id_cache[client._callback_id] = callback
  
      msg = {
          "cmd": cmd,
          "name": name,
          "method": method,
          "args": arguments,
          "subscribe": True,
          "callback_id": client._callback_id,
      }
  
      client.post(msg, keep_alive=True)
  
label_desc: Use image node_id 2 for calling a global function with example usage: subscribe(client, name, method, cmd) without return types