docstr: This class is to decorate on another function where you want to run in a new process
  with brand new environment variables (e.g. OMP/KMP, LD_PRELOAD, ...)
  an example to use this is
      ```python
      def throughput_helper(model, x):
          st = time.time()
          for _ in range(100):
              model(x)
          return time.time() - st
  
      # make this wrapper
      # note: please name the new function a new func name.
      new_throughput_helper = spawn_new_process(throughput_helper)
  
      # this will run in current process
      duration = new_throughput_helper(model, x)
  
      # this will run in a new process with new env var effective
      duration = new_throughput_helper(model, x, env_var={"OMP_NUM_THREADS": "1",
                                                          "LD_PRELOAD": ...})
      ```
code: def __init__(self, func):
      """
      This class is to decorate on another function where you want to run in a new process
      with brand new environment variables (e.g. OMP/KMP, LD_PRELOAD, ...)
      an example to use this is
          ```python
          def throughput_helper(model, x):
              st = time.time()
              for _ in range(100):
                  model(x)
              return time.time() - st
  
          # make this wrapper
          # note: please name the new function a new func name.
          new_throughput_helper = spawn_new_process(throughput_helper)
  
          # this will run in current process
          duration = new_throughput_helper(model, x)
  
          # this will run in a new process with new env var effective
          duration = new_throughput_helper(model, x, env_var={"OMP_NUM_THREADS": "1",
                                                              "LD_PRELOAD": ...})
          ```
      """
      self.func = func
  
file_path: BigDL/python/nano/src/bigdl/nano/utils/common/subprocess.py
imports: import os
  from multiprocessing import Process
  import multiprocessing
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 1 to create a new spawn_new_process object from inherited base classes: object with example: obj = spawn_new_process(func)