code: def test_metrics_is_ok_when_cpu_count_returns_none(self):
      # Some psutil functions, such as cpu_freq(), can return None depending on
      # the environment; make sure we don't crash when that occurs.
      with mock.patch.object(
          resources.psutil, "cpu_count", return_value=None
      ):
          with resources.ResourceMonitor() as monitor:
              self.assertEqual(monitor.metrics().physical_core_count, 0)
  
file_path: deepvariant/deepvariant/resources_test.py
imports: import resource
  from unittest import mock
  from absl.testing import absltest
  import contextlib2
  from deepvariant import resources
label_desc: Use image node_id 8 for calling the ResourcesTest obj's underlying member method code with example usage: obj.test_metrics_is_ok_when_cpu_count_returns_none() without return types