code: def get_topic_partition_with_error(cluster_config, error, fetch_unavailable_brokers=False):
      
  
      metadata = get_topic_partition_metadata(cluster_config.broker_list)
      affected_partitions = set()
      if fetch_unavailable_brokers:
          unavailable_brokers = set()
      with ZK(cluster_config) as zk:
          for partitions in metadata.values():
              for partition_metadata in partitions.values():
                  if int(partition_metadata.error) == error:
                      if fetch_unavailable_brokers:
                          unavailable_brokers |= get_unavailable_brokers(zk, partition_metadata)
                      affected_partitions.add((partition_metadata.topic, partition_metadata.partition))
  
      if fetch_unavailable_brokers:
          return affected_partitions, unavailable_brokers
      else:
          return affected_partitions
docs: Fetches the metadata from the cluster and returns the set of
      (topic, partition) tuples containing all the topic-partitions
      currently affected by the specified error. It also fetches unavailable-broker list
      if required.