code: def test_mean_average_precision(
      self, logits, labels, expected_result
  ):
      logits = jnp.asarray(logits)
      labels = jnp.asarray(labels)
      mask = ~jnp.isnan(labels)
  
      mean_average_precision = (
          train.MeanAveragePrecision.from_model_output(
              logits=logits, labels=labels, mask=mask
          ).compute()
      )
  
      if jnp.isnan(expected_result):
          self.assertTrue(jnp.isnan(mean_average_precision))
      else:
          self.assertAlmostEqual(
              expected_result, mean_average_precision
          )
  
imports: import functools
  import pathlib
  import tempfile
  from typing import Dict, Optional
  import warnings
  from absl.testing import absltest
  from absl.testing import parameterized
  import flax
  from flax.training import train_state
  import jax
  from jax import numpy
  import jraph
  import tensorflow
  import tensorflow_datasets
  import numpy
  from configs import default
  from configs import test
  import input_pipeline
  import train
label_desc: Use image node_id 3 for calling the OgbgMolpcbaTrainTest obj's underlying member method code with example usage: obj.test_mean_average_precision(logits, labels, expected_result) without return types