code: def set(
      parameter: Ann[
          ConfigVariable,
          Arg(
              help="Configuration variable to set",
              autocompletion=complete_config_variable,
          ),
      ],
      value: str,
  ):
      """Set a Hail configuration parameter."""
      from hailtop.config import (
          get_user_config,
          get_user_config_path,
      )  # pylint: disable=import-outside-toplevel
  
      if parameter not in config_variables():
          print(
              f"Error: unknown parameter {parameter!r}", file=sys.stderr
          )
          sys.exit(1)
  
      section, key, _ = get_section_key_path(parameter.value)
  
      config_variable_info = config_variables()[parameter]
      validation_func, error_msg = config_variable_info.validation
  
      if not validation_func(value):
          print(
              f"Error: bad value {value!r} for parameter {parameter!r} {error_msg}",
              file=sys.stderr,
          )
          sys.exit(1)
  
      config = get_user_config()
      config_file = get_user_config_path()
  
      if section not in config:
          config[section] = {}
      config[section][key] = value
  
      try:
          f = open(config_file, "w", encoding="utf-8")
      except FileNotFoundError:
          os.makedirs(config_file.parent, exist_ok=True)
          f = open(config_file, "w", encoding="utf-8")
      with f:
          config.write(f)
  
file_path: hail/hail/python/hailtop/hailctl/config/cli.py
imports: import os
  import sys
  from typing import Optional, Tuple, Annotated
  from rich import print
  import typer
  from typer import Argument
  from hailtop.config.variables import ConfigVariable
  from .config_variables import config_variables
label_desc: Use image node_id 3 for calling a global function with example usage: set(parameter, value) without return types