human
Write me a the Python code you requested given the following:
I am working on the file "Mixmatch/streetview_dataset/parse_data_to_tfrecord_lib_test.ipynb".
The first task is:
Read back the generated tfrecords and check if the data stored inside the file meets the expectation.
Can you write Python code for it?
assistant
#Here is the Python code you requested.

# Read the files back from the generated tfrecords
def parse_tf_records(file_dir):
    raw_image_dataset = tf.data.TFRecordDataset(file_dir)

    # Create a dictionary describing the features.
    image_feature_description = {
        'label': tf.io.FixedLenFeature([], tf.int64),
        'image': tf.io.FixedLenFeature([], tf.string),
    }

    def _parse_image_function(example_proto):
      # Parse the input tf.Example proto using the dictionary above.
      return tf.io.parse_single_example(example_proto, image_feature_description)

    parsed_image_dataset = raw_image_dataset.map(_parse_image_function)
    
    return parsed_image_dataset

parsed_image_dataset = parse_tf_records(TF_FILE_DIR)

for image_features in parsed_image_dataset:
    print(int(image_features['label']))
    image_raw = image_features['image'].numpy()
    display.display(display.Image(data=image_raw))