code: def set_action_env_var(
      environ_cp,
      var_name,
      query_item,
      enabled_by_default,
      question=None,
      yes_reply=None,
      no_reply=None,
      bazel_config_name=None,
  ):
      """Set boolean action_env variable.
  
      Ask user if query_item will be enabled. Default is used if no input is given.
      Set environment variable and write to .bazelrc.
  
      Args:
        environ_cp: copy of the os.environ.
        var_name: string for name of environment variable, e.g. "TF_NEED_CUDA".
        query_item: string for feature related to the variable, e.g. "CUDA for
          Nvidia GPUs".
        enabled_by_default: boolean for default behavior.
        question: optional string for how to ask for user input.
        yes_reply: optional string for reply when feature is enabled.
        no_reply: optional string for reply when feature is disabled.
        bazel_config_name: adding config to .bazelrc instead of action_env.
      """
      var = int(
          get_var(
              environ_cp,
              var_name,
              query_item,
              enabled_by_default,
              question,
              yes_reply,
              no_reply,
          )
      )
  
      if not bazel_config_name:
          write_action_env_to_bazelrc(var_name, var)
      elif var:
          write_to_bazelrc("build --config=%s" % bazel_config_name)
      environ_cp[var_name] = str(var)
  
imports: import argparse
  import os
  import pathlib
  import platform
  import re
  import subprocess
  import sys
label_desc: Use image node_id 16 for calling a global function with example usage: set_action_env_var(environ_cp, var_name, query_item, enabled_by_default, question, yes_reply, no_reply, bazel_config_name) without return types