code: def _check_output_name(
      input_name: Optional[str],
      output_name: Optional[str],
      input_to_reducers: Dict[str, list],
  ) -> str:
      # reuse the input name for the output name per default
      if output_name is None:
          output_name = input_name
  
      if output_name in input_to_reducers:
          if output_name is None:
              raise ValueError(
                  "non-unique output name, please specify the output_name"
              )
  
          raise ValueError(
              "duplicated output name {}".format(output_name)
          )
  
      return output_name
  
file_path: maze/maze/core/log_stats/event_decorators.py
imports: import inspect
  from collections import defaultdict
  from typing import Callable, Optional, List, Dict
  from maze.core.log_stats.log_stats import LogStatsLevel
label_desc: Use image node_id 3 for calling a global function with example usage: _check_output_name(input_name, output_name, input_to_reducers) and returns: output_name