code: def computeMatchProbability(args):
    
    kv = args["k"]
    n = args["n"]
    kw = args["kw"]
    theta = args["theta"]
  
    if kv == -1:
      kv = int(round(n/2.0))
  
    numMatches = 0
    totalComparisons = 0
    for t in range(args["nTrials"]):
      pct, num, total = returnMatches(kw, kv, n, theta, args["inputScaling"])
      numMatches += num
      totalComparisons += total
  
    pctMatches = float(numMatches) / totalComparisons
    print("kw, kv, n, s:", kw, kv, n, args["inputScaling"],
          ", matches:", numMatches,
          ", comparisons:", totalComparisons,
          ", pct matches:", pctMatches)
  
    args.update({"pctMatches": pctMatches})
  
    return args
docs: Runs a number of trials of returnMatches() and returns an overall probability
    of matches given the parameters.
  
    :param args is a dictionary containing the following keys:
  
    kw: k for the weight vectors
  
    kv: k for the input vectors. If -1, kv is set to n/2
  
    n:  dimensionality of input vector
  
    theta: threshold for matching after dot product
  
    nTrials: number of trials to run
  
    inputScaling: scale factor for the input vectors. 1.0 means the scaling
      is the same as the stored weight vectors.
  
    :return: args updated with the percent that matched