code: def set_env(global_seed=None):
      """
      set_env 用于显式告知 fastNLP 将要使用的相关环境变量是什么，必须在代码最开端运行。以下的环境变量设置，优先级分别为：（1）在代码开始
      的位置显式调用设置；（2）通过环境变量注入的；（3）通过读取配置文件（如果有）。
  
      :param backend: 目前支持的 backend 有 torch, jittor, paddle 。设置特定的 backend 后，fastNLP 将不再加载其它 backend ，可以
          提高加载速度。该值对应环境变量中的 FASTNLP_BACKEND 。
      :param int global_seed: 对应环境变量为 FASTNLP_GLOBAL_SEED 。设置 fastNLP 的全局随机数。
      :param str log_level: 可选 ['INFO','WARNING', 'DEBUG', 'ERROR'] ，对应环境变量为 FASTNLP_LOG_LEVEL 。
      :return:
      """
  
      _need_set_envs = [FASTNLP_GLOBAL_SEED]
      _env_values = defaultdict(list)
  
      if global_seed is not None:
          assert isinstance(global_seed, int)
          _env_values[FASTNLP_GLOBAL_SEED].append(global_seed)
  
      # 直接读取环境变量的，这里应当是用户自己注入的环境变量
      for env_name in _need_set_envs:
          if env_name in os.environ:
              _env_values[env_name].append(os.environ.get(env_name))
  
      if FASTNLP_GLOBAL_SEED in _env_values:
          os.environ[FASTNLP_GLOBAL_SEED] = _env_values[
              FASTNLP_GLOBAL_SEED
          ][0]
  
      # 针对不同的backend，做特定的设置
      backend = os.environ.get(FASTNLP_BACKEND, "")
      if backend == "paddle":
          assert _module_available(
              backend
          ), f"You must have {backend} available to use {backend} backend."
  
      if backend == "jittor":
          assert _module_available(
              backend
          ), f"You must have {backend} available to use {backend} backend."
  
      if backend == "torch":
          assert _module_available(
              backend
          ), f"You must have {backend} available to use {backend} backend."
  
      if backend == "oneflow":
          assert _module_available(
              backend
          ), f"You must have {backend} available to use {backend} backend."
  
file_path: fastNLP/fastNLP/envs/set_backend.py
imports: import os
  import json
  import sys
  from collections import defaultdict
  from fastNLP.envs.env import FASTNLP_BACKEND, FASTNLP_GLOBAL_RANK, USER_CUDA_VISIBLE_DEVICES, FASTNLP_GLOBAL_SEED
  from fastNLP.envs.utils import _module_available, get_gpu_count
label_desc: Use image node_id 2 for calling a global function with example usage: set_env(global_seed) without return types