code: def launch_bps(cls, func):
      def wrapper(*args, **kwargs):
          def run(env):
              subprocess.check_call(
                  args=["bpslaunch"],
                  shell=True,
                  stdout=sys.stdout,
                  stderr=sys.stderr,
                  env=env,
              )
  
          print("bps init")
          scheduler = threading.Thread(
              target=run, args=(cls.SCHEDULER_ENV,)
          )
          server = threading.Thread(target=run, args=(cls.SERVER_ENV,))
          scheduler.daemon = True
          server.daemon = True
          scheduler.start()
          server.start()
  
          bps.init()
          func(*args, **kwargs)
          bps.shutdown()
  
          scheduler.join()
          server.join()
          print("bps shutdown")
          time.sleep(2)
  
      return wrapper
  
file_path: byteps/tests/meta_test.py
imports: import copy
  import time
  import os
  import subprocess
  import sys
  import threading
  import byteps.mxnet
label_desc: Use image node_id 2 for calling the MetaTest obj's underlying member method code with example usage: obj.launch_bps(cls, func) and returns: wrapper