code: def _op_proc_op_env(op):
      env = {}
      env.update(op.cmd_env)
      if op.opref:
          env["GUILD_OP"] = op.opref.to_opspec()
      env["GUILD_HOME"] = config.guild_home()
      env["GUILD_SOURCECODE"] = _guild_sourcecode_env(op)
      env["LOG_LEVEL"] = _log_level()
      env["CMD_DIR"] = os.getcwd()
      return env
  
imports: import logging
  import os
  import subprocess
  import time
  from guild import config
  from guild import exit_code
  from guild import log
  from guild import op_dep
  from guild import op_util
  from guild import run
  from guild import util
label_desc: Use image node_id 29 for calling a global function with example usage: _op_proc_op_env(op) and returns: env