code: def getBenchmarks(G, edgelist_gdf, args):
      """Returns a dictionary of benchmark name to Benchmark objs. This dictionary
      is used when processing the command-line args to this script so the script
      can run a specific benchmakr by name.
  
      The "edgelist_gdf" and "args" args are common to many benchmark runs, and
      provided to this function to make it easy to pass to individual Benchmark
      objs.  The "args" arg in particular is a dictionary built from processing
      the command line args to this script, and allow special parameters to be
      added to the command line for use by specific benchmarks.
  
      To add a new benchmark to run, simply add an instance of a Benchmark to the
      "benches" list below.
  
       * The Benchmark instance ctor takes 3 args:
         * "name" - the name of the benchmark which will show up in reports,
                    output, etc.
         * "func" - the function object which the benchmark will call.  This can
                    be any callable.
         * "args" - a tuple of args that are to be passed to the func callable.
  
      A Benchmark object will, by default, run the callable with the args
      provided as-is, and log the execution time and various GPU metrics.  The
      callable provided is written independent of the benchmarking code (this is
      good for separation of concerns, bad if you need to do a custom
      measurement).
  
      If a new benchmark needs a special command-line parameter, add a new flag
      to the command-line processing function and access it via the "args"
      dictionary when passing args to the Benchmark ctor.
  
      """
  
      benches = [
          Benchmark(
              name="cugraph.pagerank",
              func=cugraph.pagerank,
              args=(
                  G,
                  args.damping_factor,
                  None,
                  args.max_iter,
                  args.tolerance,
              ),
          ),
          Benchmark(
              name="cugraph.bfs",
              func=cugraph.bfs,
              args=(G, args.source, True),
          ),
          Benchmark(
              name="cugraph.sssp",
              func=cugraph.sssp,
              args=(G, args.source),
          ),
          Benchmark(
              name="cugraph.jaccard", func=cugraph.jaccard, args=(G,)
          ),
          Benchmark(
              name="cugraph.louvain", func=cugraph.louvain, args=(G,)
          ),
          Benchmark(
              name="cugraph.weakly_connected_components",
              func=cugraph.weakly_connected_components,
              args=(G,),
          ),
          Benchmark(
              name="cugraph.overlap", func=cugraph.overlap, args=(G,)
          ),
          Benchmark(
              name="cugraph.triangles",
              func=cugraph.triangles,
              args=(G,),
          ),
          Benchmark(
              name="cugraph.spectralBalancedCutClustering",
              func=cugraph.spectralBalancedCutClustering,
              args=(G, 2),
          ),
          Benchmark(
              name="cugraph.spectralModularityMaximizationClustering",
              func=cugraph.spectralModularityMaximizationClustering,
              args=(G, 2),
          ),
          Benchmark(
              name="cugraph.renumber",
              func=cugraph.renumber,
              args=(edgelist_gdf["src"], edgelist_gdf["dst"]),
          ),
          Benchmark(name="cugraph.graph.degree", func=G.degree),
          Benchmark(name="cugraph.graph.degrees", func=G.degrees),
      ]
      # Return a dictionary of Benchmark name to Benchmark obj mappings
      return dict([(b.name, b) for b in benches])
  
file_path: cugraph/python/utils/run_benchmarks.py
imports: import argparse
  import sys
  from collections import OrderedDict
  from scipy.io import mmread
  import cugraph
  import cudf
  from benchmark import Benchmark
label_desc: Use image node_id 1 for calling a global function with example usage: getBenchmarks(G, edgelist_gdf, args) and returns: dict