code: def test_nan_inf(self):
      dataset = fo.Dataset()
      dataset.add_samples(
          [
              fo.Sample(filepath="image1.png", float=1.0),
              fo.Sample(filepath="image2.png", float=-float("inf")),
              fo.Sample(filepath="image3.png", float=float("inf")),
              fo.Sample(filepath="image4.png", float=float("nan")),
              fo.Sample(filepath="image5.png", float=None),
              fo.Sample(filepath="image6.png"),
          ]
      )
  
      bounds = dataset.bounds("float")
      self.assertTrue(math.isnan(bounds[0]))
      self.assertTrue(math.isinf(bounds[1]))
  
      self.assertEqual(dataset.count("float"), 4)
      self.assertEqual(len(dataset.distinct("float")), 4)
      self.assertEqual(len(dataset.count_values("float")), 5)
      self.assertEqual(len(dataset.values("float")), 6)
      self.assertTrue(math.isnan(dataset.mean("float")))
      self.assertTrue(math.isnan(dataset.sum("float")))
      self.assertTrue(math.isnan(dataset.std("float")))
      self.assertTrue(math.isnan(dataset.quantiles("float", 0)))
      self.assertTrue(math.isnan(dataset.quantiles("float", 0.25)))
      self.assertTrue(math.isinf(dataset.quantiles("float", 0.50)))
      self.assertAlmostEqual(dataset.quantiles("float", 0.75), 1.0)
      self.assertTrue(math.isinf(dataset.quantiles("float", 1)))
  
      counts, edges, other = dataset.histogram_values("float")
      self.assertEqual(other, 5)  # captures None, nan, inf
  
      # Test `safe=True` option
  
      bounds = dataset.bounds("float", safe=True)
      self.assertAlmostEqual(bounds[0], 1.0)
      self.assertAlmostEqual(bounds[1], 1.0)
  
      self.assertEqual(dataset.count("float", safe=True), 1)
      self.assertEqual(len(dataset.distinct("float", safe=True)), 1)
      self.assertEqual(len(dataset.count_values("float", safe=True)), 2)
      self.assertAlmostEqual(dataset.mean("float", safe=True), 1.0)
      self.assertAlmostEqual(dataset.sum("float", safe=True), 1.0)
      self.assertAlmostEqual(dataset.std("float", safe=True), 0.0)
  
      self.assertAlmostEqual(
          dataset.quantiles("float", 0, safe=True), 1.0
      )
      self.assertAlmostEqual(
          dataset.quantiles("float", 1, safe=True), 1.0
      )
      self.assertAlmostEqual(
          dataset.quantiles("float", 0.5, safe=True), 1.0
      )
  
imports: from datetime import date, datetime, timedelta
  import math
  from bson import ObjectId
  import numpy
  import unittest
  import fiftyone
  import fiftyone.core.fields
  from fiftyone import ViewField
  from decorators import drop_datasets
label_desc: Use image node_id 13 for calling the DatasetTests obj's underlying member method code with example usage: obj.test_nan_inf() without return types