code: def publish_rides(self, topic: str, messages: List[Ride]):
      for ride in messages:
          try:
              record = self.producer.send(
                  topic=topic, key=ride.pu_location_id, value=ride
              )
              print(
                  "Record {} successfully produced at offset {}".format(
                      ride.pu_location_id, record.get().offset
                  )
              )
          except KafkaTimeoutError as e:
              print(e.__str__())
  
file_path: data-engineering-zoomcamp/06-streaming/python/json_example/producer.py
imports: import csv
  import json
  from typing import List, Dict
  from kafka import KafkaProducer
  from kafka.errors import KafkaTimeoutError
  from ride import Ride
  from settings import BOOTSTRAP_SERVERS, INPUT_DATA_PATH, KAFKA_TOPIC
label_desc: Use image node_id 3 for calling the JsonProducer obj's underlying member method code with example usage: obj.publish_rides(topic, messages) without return types