code: def _resolve_model_path(folder_path, model_filename="ivis_model"):
      """Utility function for returning path of an ivis model on disk, whether it's stored as
      a .h5 file or as a folder (TF SavedModel format)"""
      model_path = None
      for file_extention in ["", ".h5"]:
          path = os.path.join(
              folder_path, model_filename + file_extention
          )
          if os.path.exists(path):
              model_path = path
      return model_path
  
imports: import json
  import os
  import shutil
  import tempfile
  import weakref
  from copy import copy
  import dill
  import numpy
  import tensorflow
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.exceptions import NotFittedError
  from tensorflow import keras
  from tensorflow.keras.callbacks import EarlyStopping
  from tensorflow.keras.models import load_model, Model
  from .data.generators import generator_from_neighbour_matrix, KerasSequence
  from .data.neighbour_retrieval import AnnoyKnnMatrix
  from .nn.network import build_supervised_layer, triplet_network, base_network
  from .nn.callbacks import ModelCheckpoint
  from .nn.losses import triplet_loss, semi_supervised_loss
  from .utils.deprecation import check_deprecated_ntrees, deprecate_positional_args
label_desc: Use image node_id 1 for calling a global function with example usage: _resolve_model_path(folder_path, model_filename) and returns: model_path