code: def apply_environment(config):
      # type: (Config) -> List[str]
      env_vars = config.get("environment", None)
      if not env_vars:
          return []
      if isinstance(env_vars, (list, tuple)):
          env_vars = dict(env_vars)
  
      keys = list(filter(None, env_vars.keys()))
  
      for key in keys:
          os.environ[str(key)] = str(env_vars[key] or "")
  
      return keys
  
file_path: clearml/clearml/backend_config/utils.py
imports: import base64
  import os
  from os.path import expandvars, expanduser
  from pathlib2 import Path
  from typing import List, TYPE_CHECKING
  from ..utilities.pyhocon import HOCONConverter, ConfigTree
label_desc: Use image node_id 3 for calling a global function with example usage: apply_environment(config) and returns: keys, list