code: def read_and_shuffle_data(
      train_neg_filepattern,
      train_pos_filepattern,
      test_neg_filepattern,
      test_pos_filepattern,
      working_dir,
  ):
      """Read and shuffle the data and write out as a TFRecord of Example protos.
  
      Read in the data from the positive and negative examples on disk, shuffle it
      and write it out in TFRecord format.
      transform it using a preprocessing pipeline that removes punctuation,
      tokenizes and maps tokens to int64 values indices.
  
      Args:
        train_neg_filepattern: Filepattern for training data negative examples
        train_pos_filepattern: Filepattern for training data positive examples
        test_neg_filepattern: Filepattern for test data negative examples
        test_pos_filepattern: Filepattern for test data positive examples
        working_dir: Directory to write shuffled data to
      """
      with beam.Pipeline() as pipeline:
          coder = tft.coders.ExampleProtoCoder(SCHEMA)
  
          # pylint: disable=no-value-for-parameter
          _ = (
              pipeline
              | "ReadAndShuffleTrain"
              >> ReadAndShuffleData(
                  (train_neg_filepattern, train_pos_filepattern)
              )
              | "EncodeTrainData" >> beam.Map(coder.encode)
              | "WriteTrainData"
              >> beam.io.WriteToTFRecord(
                  os.path.join(
                      working_dir, SHUFFLED_TRAIN_DATA_FILEBASE
                  )
              )
          )
  
          _ = (
              pipeline
              | "ReadAndShuffleTest"
              >> ReadAndShuffleData(
                  (test_neg_filepattern, test_pos_filepattern)
              )
              | "EncodeTestData" >> beam.Map(coder.encode)
              | "WriteTestData"
              >> beam.io.WriteToTFRecord(
                  os.path.join(working_dir, SHUFFLED_TEST_DATA_FILEBASE)
              )
          )
  
file_path: transform/examples/sentiment_example.py
imports: import argparse
  import os
  import pprint
  import tempfile
  import apache_beam
  import tensorflow
  from tensorflow import estimator
  import tensorflow_transform
  import tensorflow_transform.beam
  from tfx_bsl.public import tfxio
label_desc: Use image node_id 3 for calling a global function with example usage: read_and_shuffle_data(train_neg_filepattern, train_pos_filepattern, test_neg_filepattern, test_pos_filepattern, working_dir) without return types