code: def deserialize_model(package, strict=False):
      """deserialize_model."""
      klass = package["class"]
      if strict:
          model = klass(*package["args"], **package["kwargs"])
      else:
          sig = inspect.signature(klass)
          kw = package["kwargs"]
          for key in list(kw):
              if key not in sig.parameters:
                  logger.warning(
                      "Dropping inexistant parameter %s", key
                  )
                  del kw[key]
          model = klass(*package["args"], **kw)
      model.load_state_dict(package["state"])
      return model
  
file_path: fairseq/examples/speech_synthesis/preprocessing/denoiser/utils.py
imports: import functools
  import logging
  from contextlib import contextmanager
  import inspect
  import time
label_desc: Use image node_id 2 for calling a global function with example usage: deserialize_model(package, strict) and returns: model