code: def supply_params_if_needed(instance, params):
      if "params" in inspect.signature(instance).parameters:
          return functools.partial(instance, params=params)
      return instance
  
imports: import collections
  import functools
  import inspect
  from absl import logging
  from model_search import block_builder
  from model_search import ensembler
  from model_search.architecture import architecture_utils
  from model_search.architecture import tower
  from model_search.ensembler import EnsembleLogits
  from model_search.generators import base_tower_generator
  from model_search.generators import trial_utils
  from model_search.meta import distillation
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling a global function with example usage: supply_params_if_needed(instance, params) and returns: instance, functools