code: def _validate_slicing_config(
      slicing_config: Optional[slicing_spec_pb2.SlicingConfig],
  ):
      """Validates slicing config.
  
      Args:
        slicing_config: an optional list of slicing specifications. Slicing
        specifications can be provided by feature keys, feature values or slicing
        SQL queries.
      Returns:
        None if slicing_config is None.
      Raises:
        ValueError: If both slicing functions and slicing sql queries are specified
        in the slicing config.
      """
      if slicing_config is None:
          return
  
      has_slice_fns, has_slice_sqls = False, False
  
      for slicing_spec in slicing_config.slicing_specs:
          if (not has_slice_fns) and (
              slicing_spec.feature_keys or slicing_spec.feature_values
          ):
              has_slice_fns = True
          if (not has_slice_sqls) and slicing_spec.slice_keys_sql:
              has_slice_sqls = True
  
          if has_slice_fns and has_slice_sqls:
              raise ValueError(
                  "Only one of slicing features or slicing sql queries can be "
                  "specified in the slicing config."
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import json
  import logging
  import types
  from typing import Dict, List, Optional, Text, Union
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import example_weight_map
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import slicing_util
  from tfx_bsl.arrow import sql_util
  from tfx_bsl.coders import example_coder
  from tfx_bsl.public.proto import slicing_spec_pb2
  from google.protobuf import json_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _validate_slicing_config(slicing_config) without return types