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 return a list of matched strings from the choices list that have a Levenshtein distance from the query string within the specified threshold. If no matches are found, the function should return an empty list.
  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", ["apple", "aple", "appel", "banana"], 2) == ["apple", "aple"]
  assert find_matches("Apple", ["orange", "grape", "cherry"], 2) == []
  assert find_matches("", ["apple", "banana", "cherry"], 0) == []
  assert find_matches("pineapple", ["apple", "pineapple", "banana"], 4) == ["pineapple"]
  assert find_matches("grape", [], 2) == []
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
  