code: def _fix_projection_head_keys(state_dict):
      """Makes the state_dict compatible with the refactored projection heads.
  
      TODO: Remove once the models are refactored and the old checkpoints were
      replaced! Relevant issue: https://github.com/lightly-ai/lightly/issues/379
  
      Prevents unexpected key error when loading old checkpoints.
  
      """
  
      projection_head_identifier = "projection_head"
      prediction_head_identifier = "prediction_head"
      projection_head_insert = "layers"
  
      new_state_dict = {}
      for key, item in state_dict.items():
          if (
              projection_head_identifier in key
              or prediction_head_identifier in key
          ) and projection_head_insert not in key:
              # insert layers if it's not part of the key yet
              key_parts = key.split(".")
              key_parts.insert(1, projection_head_insert)
              new_key = ".".join(key_parts)
          else:
              new_key = key
  
          new_state_dict[new_key] = item
  
      return new_state_dict
  
imports: import os
  import hydra
  import torch
  from hydra import utils
  from torch import nn
  from lightly.cli._cli_simclr import _SimCLR
  from lightly.embedding import SelfSupervisedEmbedding
  from lightly.models import ZOO
  from lightly.models import ResNetGenerator
  from lightly.models.batchnorm import get_norm_layer
  from lightly.utils.version_compare import version_compare
label_desc: Use image node_id 9 for calling a global function with example usage: _fix_projection_head_keys(state_dict) and returns: new_state_dict