code: def set_aggregation_frequency(
      config: Dict[Any, Any], aggregation_frequency: int
  ) -> Dict[Any, Any]:
      config = config.copy()
      config.setdefault("optimizations", {})
      config["optimizations"][
          "aggregation_frequency"
      ] = aggregation_frequency
      return config
  
imports: import os
  from pathlib import Path
  from typing import Any, Dict, List, Union
  from determined.common import api, util
  from determined.common.api import authentication
label_desc: Use image node_id 16 for calling a global function with example usage: set_aggregation_frequency(config, aggregation_frequency) and returns: config