code: def freeze_collection(keys):
      """
      Args:
          keys(list): list of collection keys to freeze.
  
      Returns:
          a context where the collections are in the end restored to its initial state.
      """
      backup = backup_collection(keys)
      yield
      restore_collection(backup)
  
file_path: tensorpack/tensorpack/tfutils/collection.py
imports: from contextlib import contextmanager
  from copy import copy
  import six
  from ..compat import tfv1
  from ..utils import logger
  from ..utils.argtools import memoized
label_desc: Use image node_id 3 for calling a global function with example usage: freeze_collection(keys) without return types