code: def check_model_method(model, method, algo):
      """check method existence for input model to algo
  
      Args:
          model(parl.Model): model for checking
          method(str): method name
          algo(str): algorithm name
  
      Raises:
          AssertionError: if method is not implemented in model
      """
      if method == "forward":
          # check if forward is overridden by the subclass
          assert callable(
              getattr(model, "forward", None)
          ), "forward should be a function in model class"
          assert (
              model.forward.__func__
              is not super(model.__class__, model).forward.__func__
          ), "{}'s model needs to implement forward method. \n".format(
              algo
          )
      else:
          # check if the specified method is implemented
          assert hasattr(model, method) and callable(
              getattr(model, method, None)
          ), "{}'s model needs to implement {} method. \n".format(
              algo, method
          )
  
file_path: PARL/parl/utils/utils.py
imports: import os
  import subprocess
  import sys
  import multiprocessing
  import numpy
  from parl.utils import logger
label_desc: Use image node_id 11 for calling a global function with example usage: check_model_method(model, method, algo) without return types