code: def use_params(self, params, **cfg):
          
          contexts = [
              pipe.use_params(params)
              for name, pipe in self.pipeline
              if hasattr(pipe, "use_params")
          ]
          # TODO: Having trouble with contextlib
          # Workaround: these aren't actually context managers atm.
          for context in contexts:
              try:
                  next(context)
              except StopIteration:
                  pass
          yield
          for context in contexts:
              try:
                  next(context)
              except StopIteration:
                  pass
docs: Replace weights of models in the pipeline with those provided in the
          params dictionary. Can be used as a contextmanager, in which case,
          models go back to their original weights after the block.
  
          params (dict): A dictionary of parameters keyed by model ID.
          **cfg: Config parameters.
  
          EXAMPLE:
              >>> with nlp.use_params(optimizer.averages):
              >>>     nlp.to_disk('/tmp/checkpoint')