code: def validate_gpu_indices(indices):
      if indices is None:
          return
      if len(set(indices)) != len(indices):
          raise ValueError(
              f"Duplication detected in GPU indices {indices}"
          )
      if any(idx < 0 for idx in indices):
          raise ValueError(
              f"Negative detected in GPU indices {indices}"
          )
  
file_path: nni/nni/experiment/config/utils/public.py
imports: import dataclasses
  import math
  from pathlib import Path
  from typing import Union
label_desc: Use image node_id 3 for calling a global function with example usage: validate_gpu_indices(indices) without return types