code: def encode_image(image):
      """Encode an image as a tf.train.Example for a TFRecord."""
      encoded_image = tf.train.Feature(
          bytes_list=tf.train.BytesList(value=[image.tostring()])
      )
      feature_dict = {"image": encoded_image}
      features = tf.train.Features(feature=feature_dict)
      return tf.train.Example(features=features)
  
file_path: tf-encrypted/tf_encrypted/keras/datasets/convert.py
imports: import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: encode_image(image) and returns: tf