input: Write a function to implement a fuzzy search algorithm in Python that can match strings with near similarities based on a given threshold. The function should take a query string, a list of choices, and a threshold value as inputs, and return a list of matched strings. The Levenshtein distance should be used to calculate the similarity between the query and each choice.
  def find_matches(query, choices, threshold):
      # Convert query and choices to lower case
      query, choices = query.lower(), [choice.lower() for choice in choices]
      # Initialize empty list to store matches
      matches = []
      
      # Loop through each choice
      for choice in choices:
          # Calculate Levenshtein distance between query and choice
          distance = levenshtein_distance(query, choice)
          # If distance is less than threshold, append choice to matches
          if distance <= threshold:
              matches.append(choice)
      
      return matches
  
  assert find_matches("apple", ["apples", "applesauce", "appetizer", "applet"], 2) == ["apples", "applesauce", "applet"]
  assert find_matches("banana", ["ananas", "bananana", "banana split"], 3) == ["ananas", "banana split"]
  assert find_matches("orange", ["oranges", "orage", "tangerine"], 1) == ["oranges", "orage"]
  assert find_matches("cherry", ["cherries", "cheery", "charry"], 2) == ["cherries", "cheery"]
  assert find_matches("grape", [], 1) == []
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
  