docstr: Test "coremltools.libmodelpackage.ModelPackage.findItemByNameAuthor" function
docstr_tok: ["Test","``","coremltools.libmodelpackage.ModelPackage.findItemByNameAuthor","''","function"]
code: def test_weights_dir_discovery_method(self):
      """
      Test "coremltools.libmodelpackage.ModelPackage.findItemByNameAuthor" function
      """
      mlpackage = ModelPackage(self.mlpackage_path)
      model_package_item_info = mlpackage.findItemByNameAuthor(
          _WEIGHTS_DIR_NAME, _MLPACKAGE_AUTHOR_NAME
      )
      weights_dir_path = model_package_item_info.path()
      assert (
          weights_dir_path
          == self.mlpackage_path
          + "/Data/"
          + _MLPACKAGE_AUTHOR_NAME
          + "/weights"
      )
      # verify that findItemByNameAuthor returns None, when item not found
      model_package_item_info = mlpackage.findItemByNameAuthor(
          _WEIGHTS_DIR_NAME, "inexistent_author_name"
      )
      assert model_package_item_info is None
  
imports: import os
  import shutil
  import tempfile
  import numpy
  import pytest
  import coremltools
  from coremltools import ComputeUnit, utils
  from coremltools._deps import _HAS_TORCH
  from coremltools.converters.mil import Builder
  from coremltools.libmodelpackage import ModelPackage
  from coremltools.models import MLModel
  from coremltools.models.utils import _MLPACKAGE_AUTHOR_NAME, _WEIGHTS_DIR_NAME
  from coremltools.proto import Model_pb2
label_desc: Use image node_id 12 for calling the TestSpecAndMLModelAPIs obj's underlying member method code with example usage: obj.test_weights_dir_discovery_method() without return types