code: def _try_get_weights_dir_path(mlpackage_path):
      """
      Try to find the weights in mlpackage and return the path to the weights directory if found.
      Return None if not found.
      :param mlpackage_path: str, path to the mlpackage directory
      :return: path to the weights directory inside the mlpackage directory
      """
      weights_dir = None
      try:
          if _ModelPackage.isValid(mlpackage_path):
              item_info = _ModelPackage(
                  mlpackage_path
              ).findItemByNameAuthor(
                  _WEIGHTS_DIR_NAME, _MLPACKAGE_AUTHOR_NAME
              )
              if item_info is not None:
                  weights_dir = item_info.path()
      except:
          pass
      return weights_dir
  
imports: import atexit
  import os
  import shutil
  import tempfile
  import warnings
  from copy import deepcopy
  import numpy
  import numpy
  from coremltools import ComputeUnit
  from coremltools._deps import _HAS_TF_1, _HAS_TF_2, _HAS_TORCH
  from coremltools.converters.mil.mil.program import Program
  from ..proto import FeatureTypes_pb2
  from ..proto import MIL_pb2
  from ..proto import Model_pb2
  from .utils import _MLMODEL_EXTENSION, _MLPACKAGE_AUTHOR_NAME, _MLPACKAGE_EXTENSION, _MODEL_FILE_NAME, _WEIGHTS_DIR_NAME, _create_mlpackage, _has_custom_layer, _is_macos, _macos_version
  from .utils import load_spec
  from .utils import save_spec
label_desc: Use image node_id 2 for calling a global function with example usage: _try_get_weights_dir_path(mlpackage_path) and returns: weights_dir