code: def launch_broadcast_scheduler(
      in_addr,
      out_addrs,
      mon_addr,
      not_addr,
      reg_addr,
      identity,
      config=None,
      loglevel=logging.DEBUG,
      log_url=None,
      is_leaf=False,
      in_thread=False,
      outgoing_ids=None,
      curve_publickey=None,
      curve_secretkey=None,
      depth=0,
      max_depth=0,
      scheduler_class=BroadcastScheduler,
      logname="broadcast",
  ):
      (
          config,
          ctx,
          loop,
          mons,
          nots,
          querys,
          log,
      ) = get_common_scheduler_streams(
          mon_addr,
          not_addr,
          reg_addr,
          config,
          logname,
          log_url,
          loglevel,
          in_thread,
          curve_serverkey=curve_publickey,
          curve_publickey=curve_publickey,
          curve_secretkey=curve_secretkey,
      )
  
      is_root = depth == 0
      sub_scheduler_id = get_id_with_prefix(identity)
  
      incoming_stream = ZMQStream(ctx.socket(zmq.ROUTER), loop)
      util.set_hwm(incoming_stream, 0)
      incoming_stream.setsockopt(zmq.IDENTITY, sub_scheduler_id)
  
      if is_root:
          util.bind(
              incoming_stream, in_addr, curve_secretkey=curve_secretkey
          )
      else:
          util.connect(
              incoming_stream,
              in_addr,
              curve_serverkey=curve_publickey,
              curve_publickey=curve_publickey,
              curve_secretkey=curve_secretkey,
          )
  
      outgoing_streams = []
      for out_addr in out_addrs:
          out = ZMQStream(ctx.socket(zmq.ROUTER), loop)
          util.set_hwm(out, 0)
          out.setsockopt(zmq.IDENTITY, sub_scheduler_id)
          util.bind(out, out_addr, curve_secretkey=curve_secretkey)
          outgoing_streams.append(out)
  
      scheduler_args = dict(
          client_stream=incoming_stream,
          mon_stream=mons,
          notifier_stream=nots,
          query_stream=querys,
          loop=loop,
          log=log,
          config=config,
          depth=depth,
          max_depth=max_depth,
          name=identity,
      )
      if is_leaf:
          scheduler_args.update(
              engine_stream=outgoing_streams[0], is_leaf=True
          )
      else:
          scheduler_args.update(
              connected_sub_scheduler_ids=[
                  get_id_with_prefix(identity)
                  for identity in outgoing_ids
              ],
              outgoing_streams=outgoing_streams,
          )
  
      scheduler = scheduler_class(**scheduler_args)
  
      scheduler.start()
      if not in_thread:
          try:
              loop.start()
          except KeyboardInterrupt:
              scheduler.log.critical("Interrupted, exiting...")
  
file_path: ipyparallel/ipyparallel/controller/broadcast_scheduler.py
imports: import logging
  import zmq
  from traitlets import Bool, Bytes, Integer, List, Unicode
  from ipyparallel import util
  from ipyparallel.controller.scheduler import Scheduler, ZMQStream, get_common_scheduler_streams
label_desc: Use image node_id 2 for calling a global function with example usage: launch_broadcast_scheduler(in_addr, out_addrs, mon_addr, not_addr, reg_addr, identity, config, loglevel, log_url, is_leaf, in_thread, outgoing_ids, curve_publickey, curve_secretkey, depth, max_depth, scheduler_class, logname) without return types