code: def validate_dataset_keys(dataset_keys: Iterable[DatasetKey]):
      regex = re.compile(r"^[a-zA-Z0-9\.\-_]+$")
      for dataset_key in dataset_keys:
          if not isinstance(dataset_key, DatasetKey):
              raise ValueError(
                  "Dataset key {} must be of type DatasetKey"
              )
          if not regex.match(dataset_key.key):
              raise ValueError(
                  "Dataset key {!r} does not match allowed pattern: {!r}".format(
                      dataset_key.key, regex.pattern
                  )
              )
  
imports: import os
  import pickle
  import re
  import sys
  from typing import Iterable, Mapping, List, Optional, Union, Tuple
  import apache_beam
  import tensorflow
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 4 for calling a global function with example usage: validate_dataset_keys(dataset_keys) without return types