code: def _create_summary_callback_deprecated(
      weights_summary: str,
  ) -> ModelSummary:
      """Constructs summary callback from the deprecated ``weights_summary`` argument.
  
      The ``weights_summary`` trainer argument was deprecated with the release
      of pytorch lightning 1.7 in 08/2022. Support for this will be removed
      in the future.
      """
      print_as_warning(
          "The configuration parameter 'trainer.weights_summary' is deprecated."
          " Please use 'trainer.weights_summary: True' and set"
          " 'checkpoint_callback.max_depth' to value 1 for the option 'top'"
          " or -1 for the option 'full'."
      )
      if weights_summary == "top":
          max_depth = 1
      elif weights_summary == "full":
          max_depth = -1
      else:
          raise ValueError(
              "Invalid value for the deprecated trainer.weights_summary"
              " configuration parameter."
          )
      return _create_summary_callback(max_depth=max_depth)
  
file_path: lightly/lightly/embedding/callbacks.py
imports: import os
  from typing import Optional
  from omegaconf import DictConfig
  from pytorch_lightning.callbacks import ModelCheckpoint, ModelSummary
  from lightly.utils.hipify import print_as_warning
label_desc: Use image node_id 4 for calling a global function with example usage: _create_summary_callback_deprecated(weights_summary) and returns: _create_summary_callback