code: def write_bazelrc(
      *,
      python_bin_path,
      remote_build,
      cuda_toolkit_path,
      cudnn_install_path,
      cuda_version,
      cudnn_version,
      rocm_toolkit_path,
      cpu,
      cuda_compute_capabilities,
      rocm_amdgpu_targets,
      bazel_options,
      target_cpu_features,
      wheel_cpu,
      enable_mkl_dnn,
      enable_cuda,
      enable_nccl,
      enable_rocm,
      build_gpu_plugin,
  ):
      tf_cuda_paths = []
  
      with open("../.jax_configure.bazelrc", "w") as f:
          if not remote_build and python_bin_path:
              f.write(
                  textwrap.dedent(
                      """\
          build --strategy=Genrule=standalone
          build --repo_env PYTHON_BIN_PATH="{python_bin_path}"
          build --action_env=PYENV_ROOT
          build --python_path="{python_bin_path}"
          """
                  ).format(python_bin_path=python_bin_path)
              )
  
          if cuda_toolkit_path:
              tf_cuda_paths.append(cuda_toolkit_path)
              f.write(
                  'build --action_env CUDA_TOOLKIT_PATH="{cuda_toolkit_path}"\n'.format(
                      cuda_toolkit_path=cuda_toolkit_path
                  )
              )
          if cudnn_install_path:
              # see https://github.com/tensorflow/tensorflow/issues/51040
              if cudnn_install_path not in tf_cuda_paths:
                  tf_cuda_paths.append(cudnn_install_path)
              f.write(
                  'build --action_env CUDNN_INSTALL_PATH="{cudnn_install_path}"\n'.format(
                      cudnn_install_path=cudnn_install_path
                  )
              )
          if len(tf_cuda_paths):
              f.write(
                  'build --action_env TF_CUDA_PATHS="{tf_cuda_paths}"\n'.format(
                      tf_cuda_paths=",".join(tf_cuda_paths)
                  )
              )
          if cuda_version:
              f.write(
                  'build --action_env TF_CUDA_VERSION="{cuda_version}"\n'.format(
                      cuda_version=cuda_version
                  )
              )
          if cudnn_version:
              f.write(
                  'build --action_env TF_CUDNN_VERSION="{cudnn_version}"\n'.format(
                      cudnn_version=cudnn_version
                  )
              )
          if cuda_compute_capabilities:
              f.write(
                  f'build:cuda --action_env TF_CUDA_COMPUTE_CAPABILITIES="{cuda_compute_capabilities}"\n'
              )
          if rocm_toolkit_path:
              f.write(
                  'build --action_env ROCM_PATH="{rocm_toolkit_path}"\n'.format(
                      rocm_toolkit_path=rocm_toolkit_path
                  )
              )
          if rocm_amdgpu_targets:
              f.write(
                  f'build:rocm --action_env TF_ROCM_AMDGPU_TARGETS="{rocm_amdgpu_targets}"\n'
              )
          if cpu is not None:
              f.write(f"build --cpu={cpu}\n")
  
          for o in bazel_options:
              f.write(f"build {o}\n")
          if target_cpu_features == "release":
              if wheel_cpu == "x86_64":
                  f.write(
                      "build --config=avx_windows\n"
                      if is_windows()
                      else "build --config=avx_posix\n"
                  )
          elif target_cpu_features == "native":
              if is_windows():
                  print(
                      "--target_cpu_features=native is not supported on Windows; ignoring."
                  )
              else:
                  f.write("build --config=native_arch_posix\n")
  
          if enable_mkl_dnn:
              f.write("build --config=mkl_open_source_only\n")
          if enable_cuda:
              f.write("build --config=cuda\n")
              if not enable_nccl:
                  f.write("build --config=nonccl\n")
          if enable_rocm:
              f.write("build --config=rocm\n")
              if not enable_nccl:
                  f.write("build --config=nonccl\n")
          if build_gpu_plugin:
              f.write("build --config=cuda_plugin\n")
  
imports: import argparse
  import collections
  import hashlib
  import os
  import platform
  import re
  import shutil
  import stat
  import subprocess
  import sys
  import textwrap
  import urllib.request
  import logging
label_desc: Use image node_id 13 for calling a global function with example usage: write_bazelrc() without return types