input: Write a function to generate a fuzzy search algorithm in Python that can match strings with near similarities.
  
  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", ["appel", "apples", "banana"], 2) == ["appel", "apples"]
  assert find_matches("dog", ["dag", "doge", "cat"], 1) == ["dag"]
  assert find_matches("hello", ["hullo", "helo", "world"], 1) == ["hullo", "helo"]
  assert find_matches("python", ["pythn", "java", "c++"], 2) == ["pythn"]
  assert find_matches("test", [], 3) == []
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