code: def _server_env(load_library, work_path=None):
      """Server environment function return temp dir"""
      if work_path:
          temp = work_path
      else:
          temp = utils.tempdir()
  
      # pylint: disable=unused-variable
      @tvm._ffi.register_func("tvm.rpc.server.workpath", override=True)
      def get_workpath(path):
          return temp.relpath(path)
  
      @tvm._ffi.register_func(
          "tvm.rpc.server.load_module", override=True
      )
      def load_module(file_name):
          """Load module from remote side."""
          path = temp.relpath(file_name)
          m = _load_module(path)
          logger.info("load_module %s", path)
          return m
  
      @tvm._ffi.register_func(
          "tvm.rpc.server.download_linked_module", override=True
      )
      def download_linked_module(file_name):
          """Load module from remote side."""
          # pylint: disable=import-outside-toplevel
          path = temp.relpath(file_name)
  
          if path.endswith(".o"):
              # Extra dependencies during runtime.
              from tvm.contrib import cc as _cc
  
              _cc.create_shared(path + ".so", path)
              path += ".so"
          elif path.endswith(".tar"):
              # Extra dependencies during runtime.
              from tvm.contrib import cc as _cc, tar as _tar
  
              tar_temp = utils.tempdir(
                  custom_path=path.replace(".tar", "")
              )
              _tar.untar(path, tar_temp.temp_dir)
              files = [tar_temp.relpath(x) for x in tar_temp.listdir()]
              _cc.create_shared(path + ".so", files)
              path += ".so"
          elif path.endswith(".dylib") or path.endswith(".so"):
              pass
          else:
              raise RuntimeError(f"Do not know how to link {file_name}")
          logger.info("Send linked module %s to client", path)
          return bytearray(open(path, "rb").read())
  
      libs = []
      load_library = load_library.split(":") if load_library else []
      for file_name in load_library:
          file_name = find_lib_path(file_name)[0]
          libs.append(ctypes.CDLL(file_name, ctypes.RTLD_GLOBAL))
          logger.info("Load additional library %s", file_name)
      temp.libs = libs
      return temp
  
imports: import os
  import ctypes
  import socket
  import select
  import struct
  import logging
  import threading
  import multiprocessing
  import time
  import errno
  import tvm._ffi
  from tvm._ffi.base import py_str
  from tvm._ffi.libinfo import find_lib_path
  from tvm.runtime.module import load_module
  from tvm.contrib import utils
  from tvm.contrib.popen_pool import PopenWorker
  from .None import _ffi_api
  from .None import base
  from .None import testing
  from .base import TrackerCode
label_desc: Use image node_id 1 for calling a global function with example usage: _server_env(load_library, work_path) and returns: temp, temp, m, bytearray