<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generateMinicolumnSDRs(n, w, threshold):
 """ Wraps enumerateDistantSDRsBruteForce, caching its result on the filesystem. """

  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