input: Write a function to implement a fuzzy search algorithm in Python that can match strings with near similarities. The function should take three parameters: a query string, a list of choices to search from, and a threshold for the similarity measure. If the Levenshtein distance between the query string and any choice is less than or equal to the threshold, that choice should be considered a match. The function should return a list of all matching choices.
  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", "aple", "app", "pple"], 2) == ["apples", "aple", "pple"]
  assert find_matches("banana", ["banan", "anan", "bana", "bananaa"], 1) == ["banan", "bananaa"]
  assert find_matches("cherry", ["chery", "cherries", "cheery", "cherr"], 2) == ["chery", "cherries", "cheery"]
  assert find_matches("date", ["dte", "dat", "datte", "datt"], 1) == ["dat", "datt"]
  assert find_matches("elderberry", [], 2) == []
output: def find_matches(query, choices, threshold):
      query = query.lower()
      choices = [choice.lower() for choice in choices]
      matches = []
      
      for choice in choices:
          distance = levenshtein_distance(query, choice)
          if distance <= threshold:
              matches.append(choice)
      
      return matches