code: def pyagent(
      sweep_id, function, entity=None, project=None, count=None
  ):
      """Generic agent entrypoint, used for CLI or jupyter.
  
      Arguments:
          sweep_id (dict): Sweep ID generated by CLI or sweep API
          function (func, optional): A function to call instead of the "program"
          entity (str, optional): W&B Entity
          project (str, optional): W&B Project
          count (int, optional): the number of trials to run.
      """
      if not callable(function):
          raise Exception("function paramter must be callable!")
      agent = Agent(
          sweep_id,
          function=function,
          entity=entity,
          project=project,
          count=count,
      )
      agent.run()
  
imports: import ctypes
  import logging
  import os
  import queue
  import socket
  import threading
  import time
  import wandb
  from wandb import wandb_sdk
  from wandb.apis import InternalApi
  from wandb.sdk.launch.sweeps import utils
label_desc: Use image node_id 2 for calling a global function with example usage: pyagent(sweep_id, function, entity, project, count) without return types