code: def _check_times(times):
      """Checks that times are in the correct format.
  
      Args:
        times: a Pandas `DatetimeIndex` that indexes time series data.
  
      Raises:
        ValueError: if times is not a Pandas `DatetimeIndex` or does not have a
        frequency.
      """
      # pylint: disable=g-import-not-at-top
      import pandas as pd
  
      # pylint: enable=g-import-not-at-top
      if not isinstance(times, pd.core.indexes.datetimes.DatetimeIndex):
          raise ValueError("Times is not a Pandas DatetimeIndex.")
      if not times.freq:
          raise ValueError("Times does not have a frequency.")
  
label_desc: Use image node_id 3 for calling a global function with example usage: _check_times(times) without return types