code: def getStats(jobStore):
      
      def aggregateStats(fileHandle,aggregateObject):
          try:
              stats = json.load(fileHandle, object_hook=Expando)
              for key in list(stats.keys()):
                  if key in aggregateObject:
                      aggregateObject[key].append(stats[key])
                  else:
                      aggregateObject[key]=[stats[key]]
          except ValueError:
              logger.critical("File %s contains corrupted json. Skipping file." % fileHandle)
              pass  # The file is corrupted.
  
      aggregateObject = Expando()
      callBack = partial(aggregateStats, aggregateObject=aggregateObject)
      jobStore.readStatsAndLogging(callBack, readAll=True)
      return aggregateObject
docs: Collect and return the stats and config data.