code: def _t5_gin_config():
      # The following pages worth of gin configuration are required because a lot
      # of T5 functions have `gin.REQUIRED` in code, i.e. you cannot use these
      # functions at all without having configured gin.
  
      noise_density = 0.15
      max_input_length = 50
  
      # What preprocessors to apply - we select a random chunk of the document if
      # it exceeds a certain lengths (`select_random_chunk`), then split up long
      # examples (`split_tokens`) and finally the denoising objective (`denoise`).
      #
      # In addition to this T5 concates multiple documents together to reduce
      # padding (`reduce_concat_tokens`) after `select_random_chunk`, but we skip
      # that since we don't do sequence packing.
      gin.bind_parameter(
          "unsupervised.preprocessors",
          [
              t5_processors.select_random_chunk,
              t5_processors.split_tokens,
              t5_processors.denoise,
          ],
      )
  
      # select_random_chunk
      gin.bind_parameter("select_random_chunk.feature_key", "targets")
      gin.bind_parameter(
          "select_random_chunk.max_length", max_input_length
      )
  
      # reduce_concat_tokens
      gin.bind_parameter(
          "random_spans_helper.extra_tokens_per_span_inputs", 1
      )
      gin.bind_parameter(
          "random_spans_helper.extra_tokens_per_span_targets", 1
      )
      gin.bind_parameter(
          "random_spans_helper.inputs_length", max_input_length
      )
      gin.bind_parameter(
          "random_spans_helper.mean_noise_span_length", 3.0
      )
      gin.bind_parameter(
          "random_spans_helper.noise_density", noise_density
      )
  
      # split_tokens
      gin.bind_parameter(
          "split_tokens.max_tokens_per_segment",
          t5_processors.random_spans_tokens_length(),
      )
  
      # denoise
      gin.bind_parameter(
          "denoise.inputs_fn",
          t5_processors.noise_span_to_unique_sentinel,
      )
      gin.bind_parameter("denoise.noise_density", noise_density)
      gin.bind_parameter(
          "denoise.noise_mask_fn", t5_processors.random_spans_noise_mask
      )
      gin.bind_parameter(
          "denoise.targets_fn",
          t5_processors.nonnoise_span_to_unique_sentinel,
      )
  
imports: import collections
  import os
  from unittest import mock
  import gin
  import numpy
  from t5.data import assert_dataset
  from t5.data import preprocessors
  import tensorflow
  import tensorflow_datasets
  from trax.data import inputs
  from trax.data import tf_inputs
label_desc: Use image node_id 5 for calling a global function with example usage: _t5_gin_config() without return types