code: def get_dataset_fn(
      input_file_pattern,
      max_seq_length,
      batch_size,
      is_training,
      repeats=None,
      label_type=tf.int64,
      include_sample_weights=False,
      num_samples=None,
  ):
      """Gets a closure to create a dataset."""
  
      def _dataset_fn(ctx=None):
          """Returns tf.data.Dataset for distributed BERT pretraining."""
          dataset = create_classifier_dataset(
              tf.io.gfile.glob(input_file_pattern),
              max_seq_length,
              batch_size,
              is_training=is_training,
              repeats=repeats,
              input_pipeline_context=ctx,
              label_type=label_type,
              include_sample_weights=include_sample_weights,
              num_samples=num_samples,
          )
          return dataset
  
      return _dataset_fn
  
file_path: scenic/scenic/projects/baselines/bert/datasets/bert_glue_dataset.py
imports: import functools
  import json
  from typing import Optional
  from absl import logging
  from flax import jax_utils
  import jax
  import jax.numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  import tensorflow
  from official.nlp.data.bert import input_pipeline
label_desc: Use image node_id 2 for calling a global function with example usage: get_dataset_fn(input_file_pattern, max_seq_length, batch_size, is_training, repeats, label_type, include_sample_weights, num_samples) and returns: _dataset_fn, dataset