code: def update_algorithm(producer):
      """Wrap update of algorithm outside of `Producer.update`"""
      return producer._update_algorithm(
          producer.experiment.fetch_trials_by_status("completed")
      )
  
file_path: orion/tests/unittests/core/worker/test_producer.py
imports: import contextlib
  import copy
  import threading
  import time
  import pytest
  from orion.core.io.experiment_builder import build
  from orion.core.worker.producer import Producer
  from orion.testing import OrionState, generate_trials
label_desc: Use image node_id 2 for calling a global function with example usage: update_algorithm(producer) and returns: producer