class_docstr: Adapter providing all the base attributes required by a metrics event and defining an interface used by the
  metrics manager when batching and writing events.
class_docstr_tok: ["Adapter","providing","all","the","base","attributes","required","by","a","metrics","event","and","defining","an","interface","used","by","the","metrics","manager","when","batching","and","writing","events","."]
code: def _convert_np_nan_inf(cls, val):
      if np.isnan(val):
          cls._report_nan_warning_iteration += 1
          if (
              cls._report_nan_warning_iteration
              >= cls.report_nan_warning_period
          ):
              LoggerRoot.get_base_logger().info(
                  "NaN value encountered. Reporting it as '{}'. Use clearml.Logger.set_reporting_nan_value to assign another value".format(
                      cls.default_nan_value
                  )
              )
              cls._report_nan_warning_iteration = 0
          return cls.default_nan_value
      if np.isinf(val):
          cls._report_inf_warning_iteration += 1
          if (
              cls._report_inf_warning_iteration
              >= cls.report_inf_warning_period
          ):
              LoggerRoot.get_base_logger().info(
                  "inf value encountered. Reporting it as '{}'. Use clearml.Logger.set_reporting_inf_value to assign another value".format(
                      cls.default_inf_value
                  )
              )
              cls._report_inf_warning_iteration = 0
          return cls.default_inf_value
      return val
  
imports: import abc
  import hashlib
  import time
  from functools import reduce
  from logging import getLevelName
  import attr
  import numpy
  import pathlib2
  import six
  from PIL import Image
  from six.moves.urllib.parse import urlparse, urlunparse
  from ...backend_api.services import events
  from ...config import deferred_config
  from ...debugging.log import LoggerRoot
  from ...storage.util import quote_url
  from ...utilities.attrs import attrs
  from ...utilities.process.mp import SingletonLock
label_desc: Use image node_id 10 for calling the MetricsEventAdapter obj's underlying member method code with example usage: obj._convert_np_nan_inf(cls, val) and returns: val, cls, cls