code: def savecands(d, cands, domock=False):
      
  
      with open(getcandsfile(d, domock=domock), 'w') as pkl:
          pickle.dump(d, pkl)
          pickle.dump(cands, pkl)
docs: Save all candidates in pkl file for later aggregation and filtering.
      domock is option to save simulated cands file