def METHOD_NAME(original_fn, model_file, *args, **kwargs):
    if not PatchLIGHTgbmModelIO._current_task:
        return original_fn(model_file, *args, **kwargs)
    if isinstance(model_file, six.string_types):
        filename = model_file
    elif hasattr(model_file, 'name'):
        filename = model_file.name
    elif len(args) == 1 and isinstance(args[0], six.string_types):
        filename = args[0]
    else:
        filename = None
    # register input model
    empty = _Empty()
    # Hack: disabled
    if False and running_remotely():
        filename = WeightsFileHandler.restore_weights_file(empty, filename, Framework.xgboost,
                                                           PatchLIGHTgbmModelIO._current_task)
        model = original_fn(model_file=filename or model_file, *args, **kwargs)
    else:
        # try to load model before registering, in case we fail
        model = original_fn(model_file=model_file, *args, **kwargs)
        WeightsFileHandler.restore_weights_file(empty, filename, Framework.lightgbm,
                                                PatchLIGHTgbmModelIO._current_task)
    if empty.trains_in_model:
        # noinspection PyBroadException
        try:
            model.trains_in_model = empty.trains_in_model
        except Exception:
            pass
    return model