code: def interaction_indices(variables: list[Variable]) -> list[list[int]]:
      var_names = [var.name for var in variables]
      indices = []
      for var in variables:
          if hasattr(var, "interaction_fields"):
              interaction_indices = [
                  var_names.index(f) for f in var.interaction_fields
              ]
              indices.append(interaction_indices)
      return indices
  
imports: from __future__ import annotations
  import copyreg
  import pkgutil
  import types
  from typing import TYPE_CHECKING, cast
  import numpy
  import dedupe.variables
  from dedupe.variables.base import FieldType
  from dedupe.variables.base import MissingDataType, Variable
  from dedupe.variables.interaction import InteractionType
label_desc: Use image node_id 5 for calling a global function with example usage: interaction_indices(variables) and returns: indices