code: def interactions(
      definitions: Iterable[VariableDefinition],
      primary_variables: list[FieldVariable],
  ) -> list[InteractionType]:
      field_d = {field.name: field for field in primary_variables}
  
      interactions = []
      for definition in definitions:
          if definition["type"] == "Interaction":
              var = InteractionType(definition)
              var.expandInteractions(field_d)
              interactions.extend(var.higher_vars)
      return interactions
  
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 3 for calling a global function with example usage: interactions(definitions, primary_variables) and returns: interactions