input: Write a function to generate a fuzzy search algorithm that can match strings with near similarities. The function should take in a query string, a list of choices, and a threshold for the maximum Levenshtein distance allowed. It should return a list of choices that are considered matches based on the threshold.
  
  def find_matches(query, choices, threshold):
      query, choices = query.lower(), [choice.lower() for choice in choices]
      matches = []
      
      for choice in choices:
          distance = levenshtein_distance(query, choice)
          if distance <= threshold:
              matches.append(choice)
      
      return matches
  
  assert find_matches("apple", ["apples", "applet", "app", "apall"], 2) == ["apples", "applet"]
  assert find_matches("banana", ["bananaa", "banan", "bann"], 1) == ["bananaa", "banan"]
  assert find_matches("grape", ["grape", "grapefruit", "gra", "grappa"], 2) == ["grape", "gra", "grappa"]
  assert find_matches("orange", ["oranges", "orangee", "oran", "orangez"], 1) == ["oranges", "orangee", "oran"]
  assert find_matches("", ["apple", "banana", "cherry"], 0) == []
output: def find_matches(query, choices, threshold):
      query, choices = query.lower(), [choice.lower() for choice in choices]
      matches = []
      
      for choice in choices:
          distance = levenshtein_distance(query, choice)
          if distance <= threshold:
              matches.append(choice)
      
      return matches