code: def glue_train_data_collator(
      rng: PRNGKey, dataset: Dataset, batch_size: int
  ):
      """Returns shuffled batches of size `batch_size` from truncated `train dataset`, sharded over all local devices."""
      steps_per_epoch = len(dataset) // batch_size
      perms = jax.random.permutation(rng, len(dataset))
      perms = perms[
          : steps_per_epoch * batch_size
      ]  # Skip incomplete batch.
      perms = perms.reshape((steps_per_epoch, batch_size))
  
      for perm in perms:
          batch = dataset[perm]
          batch = {k: np.array(v) for k, v in batch.items()}
          batch = shard(batch)
  
          yield batch
  
imports: import json
  import logging
  import math
  import os
  import random
  import sys
  import time
  import warnings
  from dataclasses import dataclass, field
  from pathlib import Path
  from typing import Any, Callable, Dict, Optional, Tuple
  import datasets
  import evaluate
  import jax
  import jax.numpy
  import numpy
  import optax
  from datasets import load_dataset
  from flax import struct, traverse_util
  from flax.jax_utils import pad_shard_unpad, replicate, unreplicate
  from flax.training import train_state
  from flax.training.common_utils import get_metrics, onehot, shard
  from huggingface_hub import Repository, create_repo
  from tqdm import tqdm
  import transformers
  from transformers import AutoConfig, AutoTokenizer, FlaxAutoModelForSequenceClassification, HfArgumentParser, PretrainedConfig, TrainingArguments, is_tensorboard_available
  from transformers.utils import check_min_version, send_example_telemetry
label_desc: Use image node_id 3 for calling a global function with example usage: glue_train_data_collator(rng, dataset, batch_size) without return types