def update(self, new_frozen_value: LabeledVariableValue):
    """Updates the value of this variable to match a frozen variable."""
    if self.get_slot() != new_frozen_value.get_slot():
      raise ValueError(
          f"Cannot update variable {self} with incompatible value"
          f"{new_frozen_value}!"
      )
    self.value = new_frozen_value.value
Updates the value of this variable to match a frozen variable.
penzai/core/variables.py