code: def _load_from_obj(original_fn, obj, f, *args, **kwargs):
      # if there is no main task or this is a nested call
      if not PatchMegEngineModelIO._current_task:
          return original_fn(obj, f, *args, **kwargs)
  
      # noinspection PyBroadException
      try:
          if isinstance(f, six.string_types):
              filename = f
          elif hasattr(f, "as_posix"):
              filename = f.as_posix()
          elif hasattr(f, "name"):
              filename = f.name
          else:
              filename = None
      except Exception:
          filename = None
  
      # register input model
      empty = _Empty()
      # try to load model before registering, in case we fail
      model = original_fn(obj, f, *args, **kwargs)
      WeightsFileHandler.restore_weights_file(
          empty,
          filename,
          Framework.megengine,
          PatchMegEngineModelIO._current_task,
      )
  
      if empty.trains_in_model:
          # noinspection PyBroadException
          try:
              model.trains_in_model = empty.trains_in_model
          except Exception:
              pass
  
      return model
  
file_path: clearml/clearml/binding/frameworks/megengine_bind.py
imports: import sys
  import six
  from pathlib2 import Path
  from ..frameworks.base_bind import PatchBaseModelIO
  from ..frameworks import _patched_call, WeightsFileHandler, _Empty
  from ..import_bind import PostImportHookPatching
  from ...model import Framework
label_desc: Use image node_id 5 for calling the PatchMegEngineModelIO obj's underlying member method code with example usage: obj._load_from_obj(original_fn, obj, f) and returns: model, original_fn