code: def _unpack_tuple(tensor: tuple) -> Any:
      """Return a single element if a single-element tuple. Otherwise a tuple."""
      if len(tensor) == 1:
          return tensor[0]
      else:
          return tensor
  
imports: from __future__ import annotations
  from typing import Any, cast
  import torch
  import torch.nn
  from nni.mutable import Categorical, Mutable, Sample, SampleValidationError, MutableExpression, label_scope, auto_label
  from nni.nas.nn.pytorch import Repeat, recursive_freeze
  from .base import BaseSuperNetModule
  from .differentiable import DifferentiableMixedLayer, DifferentiableMixedInput
  from ._expression_utils import traverse_all_options
label_desc: Use image node_id 4 for calling a global function with example usage: _unpack_tuple(tensor) and returns: tensor, tensor