code: def evaluate_constant(expr: Any) -> Any:
      """Evaluate a value choice expression to a constant. Raise ValueError if it's not a constant."""
      all_options = traverse_all_options(expr)
      if len(all_options) > 1:
          raise ValueError(
              f"{expr} is not evaluated to a constant. All possible values are: {all_options}"
          )
      res = all_options[0]
      return res
  
file_path: nni/nni/nas/oneshot/pytorch/supermodule/_expression_utils.py
imports: from __future__ import annotations
  import operator
  from typing import Any, TypeVar, List, cast, Mapping, Sequence, Optional, Iterable, overload
  import numpy
  import torch
  from nni.mutable import MutableExpression, Categorical
label_desc: Use image node_id 5 for calling a global function with example usage: evaluate_constant(expr) and returns: res