code: def filter_leader_files(cluster_config, broker_files):
      
      print("Filtering leaders")
      leader_of = get_partition_leaders(cluster_config)
      result = []
      for broker, host, files in broker_files:
          filtered = []
          for file_path in files:
              tp = get_tp_from_file(file_path)
              if tp not in leader_of or leader_of[tp] == broker:
                  filtered.append(file_path)
          result.append((broker, host, filtered))
          print(
              "Broker: {broker}, leader of {l_count} over {f_count} files".format(
                  broker=broker,
                  l_count=len(filtered),
                  f_count=len(files),
              )
          )
      return result
docs: Given a list of broker files, filters out all the files that
      are in the replicas.
  
      :param cluster_config: the cluster
      :type cluster_config: kafka_utils.utils.config.ClusterConfig
      :param broker_files: the broker files
      :type broker_files: list of (b_id, host, [file_path, file_path ...]) tuples
      :returns: the filtered list
      :rtype: list of (broker_id, host, [file_path, file_path ...]) tuples