code: def compare_partitionings(
      list_of_partitioners, data, num_partitions=2, visualize=True
  ):
      """Wrapper around PartitioningReporter hiding logging settings.
  
      Parameters
      ---------
      list_of_partitioners: list
           List of uninitialized partitioners.
      data: ndarray
           Numpy array with the graph to be split into partitions.
      num_partitions: int
           Number of partitions required.
      visualize : bool
           Flag whether to visualize results or not.
  
      Returns
      -------
      result: dict
           Dictionary with metrics evaluating partitionings.
  
      Example
      -------
      >>>partitioners = [NaiveGraphPartitioner,
                         SortedEdgesGraphPartitioner,
                         DoubleSortedEdgesGraphPartitioner]
      >>>report = compare_partitionings(partitioners)
      """
      if isinstance(num_partitions, int):
          n_partitions = [num_partitions] * len(list_of_partitioners)
      else:
          n_partitions = num_partitions
      partitionings = {}
      for partitioner, n in zip(list_of_partitioners, n_partitions):
          logger.debug("Running: {}".format(partitioner.__name__))
          logs = {}
          if n != 0:
              data.reload()
          partitioner_fitted = partitioner(data, k=n, log=logs)
          partitionings[partitioner.__name__] = (
              partitioner_fitted,
              logs,
          )
      reporter = PartitioningReporter(partitionings=partitionings)
      result = reporter.report(visualize=visualize, barh=True)
      return result
  
file_path: AmpliGraph/ampligraph/datasets/partitioning_reporter.py
imports: import copy
  import logging
  import matplotlib.pyplot
  import numpy
  from matplotlib.pyplot import cm
  from .datasets import load_fb15k_237
  from .graph_partitioner import RandomVerticesGraphPartitioner
label_desc: Use image node_id 1 for calling a global function with example usage: compare_partitionings(list_of_partitioners, data, num_partitions, visualize) and returns: result