code: def _pack_fn(self):
      
      if not self.packed_length:
        return None
      def my_fn(records):
        """Function from list of TFRecords to list of TFRecords."""
        examples = []
        for record in records:
          x = tf.train.Example()
          x.ParseFromString(record)
          example_dict = {}
          if self.has_inputs:
            example_dict["inputs"] = [
                int(i) for i in x.features.feature["inputs"].int64_list.value]
          example_dict["targets"] = [
              int(i) for i in x.features.feature["targets"].int64_list.value]
          examples.append(example_dict)
        examples = list(self._maybe_pack_examples(examples))
        return [
            generator_utils.to_example(x).SerializeToString() for x in examples]
      return my_fn
docs: For packed datasets, returns a function to pack examples.
  
      Returns:
        None or a function from list of TFRecords to list of TFRecords