code: def generateMinicolumnSDRs(n, w, threshold):
    
    if not os.path.exists("sdrs"):
      os.makedirs("sdrs")
  
    filename = "sdrs/{}_{}_{}.json".format(n, w, threshold)
  
    if len(glob.glob(filename)) > 0:
      with open(filename, "r") as fIn:
        sdrs = json.load(fIn)
    else:
      begin = time.time()
      sdrs = enumerateDistantSDRsBruteForce(n, w, threshold)
      end = time.time()
      with open(filename, "w") as fOut:
        json.dump([sdr.tolist() for sdr in sdrs], fOut)
        print("Saved", filename)
      print("Elapsed time: {:.2f} seconds".format(end - begin))
  
    return sdrs
docs: Wraps enumerateDistantSDRsBruteForce, caching its result on the filesystem.