code: def run_or_load_all_analyses():
      temp_filename = os.path.expanduser("~/tmp/partition_cached.pkl")
  
      if FLAGS.cache and os.path.isfile(temp_filename):
          print("Reading from cache " + temp_filename)
          with open(temp_filename, "rb") as f:
              all_analyses = pickle.load(f)
      else:
          fin_name = os.path.expanduser(FLAGS.counts_file)
          print("Reading raw votes from " + fin_name)
          sys.stdout.flush()
  
          votes = np.load(fin_name)
  
          if FLAGS.queries is not None:
              if votes.shape[0] < FLAGS.queries:
                  raise ValueError(
                      "Expect {} rows, got {} in {}".format(
                          FLAGS.queries, votes.shape[0], fin_name
                      )
                  )
              # Truncate the votes matrix to the number of queries made.
              votes = votes[: FLAGS.queries,]
  
          all_analyses = run_all_analyses(
              votes,
              FLAGS.threshold,
              FLAGS.sigma1,
              FLAGS.sigma2,
              FLAGS.delta,
          )
  
          print("Writing to cache " + temp_filename)
          with open(temp_filename, "wb") as f:
              pickle.dump(all_analyses, f)
  
      return all_analyses
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import pickle
  import sys
  from absl import app
  from absl import flags
  from collections import namedtuple
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import core
  import smooth_sensitivity
label_desc: Use image node_id 6 for calling a global function with example usage: run_or_load_all_analyses() and returns: all_analyses