code: def try_append(self, timestamp_ms, key, value, headers):
      metadata = self.records.append(timestamp_ms, key, value, headers)
      if metadata is None:
          return None
  
      self.max_record_size = max(self.max_record_size, metadata.size)
      self.last_append = time.time()
      future = FutureRecordMetadata(
          self.produce_future,
          metadata.offset,
          metadata.timestamp,
          metadata.crc,
          len(key) if key is not None else -1,
          len(value) if value is not None else -1,
          sum(
              len(h_key.encode("utf-8")) + len(h_val)
              for h_key, h_val in headers
          )
          if headers
          else -1,
      )
      return future
  
imports: from __future__ import absolute_import
  import collections
  import copy
  import logging
  import threading
  import time
  import kafka.errors
  from kafka.producer.buffer import SimpleBufferPool
  from kafka.producer.future import FutureRecordMetadata, FutureProduceResult
  from kafka.record.memory_records import MemoryRecordsBuilder
  from kafka.structs import TopicPartition
label_desc: Use image node_id 3 for calling the ProducerBatch obj's underlying member method code with example usage: obj.try_append(timestamp_ms, key, value, headers) and returns: future, None