code: def test_move_state_into():
      # all keys from the source
      source = {"apple": 1, "cocofruit": 2}
      destination = {"banana": 100}
      _move_state_into(source, destination)
      assert source == {}
      assert destination == {"apple": 1, "cocofruit": 2, "banana": 100}
  
      # subset of keys from the source
      source = {"apple": 1, "cocofruit": 2}
      destination = {"banana": 100}
      keys = {"apple"}
      _move_state_into(source, destination, keys=keys)
      assert source == {"cocofruit": 2}
      assert destination == {"apple": 1, "banana": 100}
  
      # with stateful objects in destination
      class Fruit:
          count = 1
  
          def state_dict(self):
              return {"count": self.count}
  
          def load_state_dict(self, state_dict):
              self.count = state_dict["count"]
  
      source = {"cocofruit": 2, "banana": {"count": 100}}
      destination = {"banana": Fruit()}
      _move_state_into(source, destination)
      assert source == {}
      assert destination["cocofruit"] == 2
      assert destination["banana"].count == 100
  
file_path: pytorch-lightning/tests/tests_fabric/utilities/test_load.py
imports: import pytest
  import torch
  import torch.nn
  from lightning.fabric.utilities.load import _lazy_load, _materialize_tensors, _move_state_into, _NotYetLoadedTensor
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 6 for calling a global function with example usage: test_move_state_into() and returns: dict