docs: def _check_valid_standard_units(self, ds, variable_name):
          '''
          Checks that the variable's units are appropriate for the standard name
          according to the CF standard name table and coordinate sections in CF
          1.6
  
          :param netCDF4.Dataset ds: An open netCDF dataset
          :param str variable_name: Name of the variable to be checked
          '''
          variable = ds.variables[variable_name]
          units = getattr(variable, 'units', None)
          standard_name = getattr(variable, 'standard_name', None)
  
          valid_standard_units = TestCtx(BaseCheck.HIGH, self.section_titles["3.1"])
  
          # If the variable is supposed to be dimensionless, it automatically passes
          std_name_units_dimensionless = cfutil.is_dimensionless_standard_name(self._std_names._root,
                                                                 standard_name)
  
          standard_name, standard_name_modifier = self._split_standard_name(standard_name)
  
          standard_entry = self._std_names.get(standard_name, None)
          if standard_entry is not None:
              canonical_units = standard_entry.canonical_units
          else:
              # Any unit comparisons with None returns False
              canonical_units = None
  
          # Other standard_name modifiers have the same units as the
          # unmodified standard name or are not checked for units.
  
          if standard_name_modifier == 'number_of_observations':
              canonical_units = '1'
  
          # This section represents the different cases where simple udunits
          # comparison isn't comprehensive enough to determine if the units are
          # appropriate under CF
  
          # UDUnits accepts "s" as a unit of time but it should be <unit> since <epoch>
          if standard_name == 'time':
              valid_standard_units.assert_true(util.units_convertible(units, 'seconds since 1970-01-01'),
                                               'time must be in a valid units format <unit> since <epoch> '
                                               'not {}'.format(units))
  
          # UDunits can't tell the difference between east and north facing coordinates
          elif standard_name == 'latitude':
              # degrees is allowed if using a transformed grid
              allowed_units = cfutil.VALID_LAT_UNITS | {'degrees'}
              valid_standard_units.assert_true(units.lower() in allowed_units,
                                               'variables defining latitude ("{}") must use degrees_north '
                                               'or degrees if defining a transformed grid. Currently '
                                               '{}'.format(variable_name, units))
          # UDunits can't tell the difference between east and north facing coordinates
          elif standard_name == 'longitude':
              # degrees is allowed if using a transformed grid
              allowed_units = cfutil.VALID_LON_UNITS | {'degrees'}
              valid_standard_units.assert_true(units.lower() in allowed_units,
                                               'variables defining longitude ("{}") must use degrees_east '
                                               'or degrees if defining a transformed grid. Currently '
                                               '{}'.format(variable_name, units))
          # Standard Name table agrees the unit should be dimensionless
          elif std_name_units_dimensionless:
              valid_standard_units.assert_true(True, '')
  
          elif canonical_units is not None:
              valid_standard_units.assert_true(util.units_convertible(canonical_units, units),
                                               'units for variable {} must be convertible to {} '
                                               'currently they are {}'.format(variable_name, canonical_units, units))
  
          return valid_standard_units.to_result()