code: def _create_all_recommendations(cores, ip_views=False, config=None):
      
      global _reco, _store
  
      _reco = GraphRecommender(_store)
      _reco.load_profile('Profiles')
      if ip_views:
          _reco.load_profile('Profiles_IP')
  
      manager = Manager()
      record_list = manager.list(_reco.all_records.keys())
      # record_list = manager.list(list(_reco.all_records.keys())[:10])
      num_records = len(_reco.all_records.keys())
      logger.info("Recommendations to build: {}".format(num_records))
  
      start = time.time()
      reco_version = config.get('recommendation_version', 0)
      done_records = num_records
      if cores <= 1:
          _create_recommendations(0, record_list, reco_version)
      else:
          try:
              pool = Pool(cores)
              multiple_results = [pool.apply_async(_create_recommendations,
                                  (i, record_list, reco_version))
                                  for i in range(cores)]
              # Wait for all processes to exit
              [res.get() for res in multiple_results]
          except KeyboardInterrupt:
              print("Caught KeyboardInterrupt, terminating workers")
              # TODO: Update done_records.
              pool.terminate()
              pool.join()
  
      duration = time.time() - start
      logger.info("Time {} for {} recommendations".format(duration,
                                                          done_records))
docs: Calculate all recommendations in multiple processes.