input: Write a function to generate a fuzzy search algorithm in Python that matches strings with near similarities based on a given threshold for Levenshtein distance. The function should take a query string, a list of choices, and an integer threshold as input, and return a list of matching strings.
  
  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", "appo", "appl"], 2) == ["apples", "aple", "appl"]
  assert find_matches("banana", ["bananaa", "banna", "bnbn", "baaan"], 3) == ["bananaa", "banna", "baaan"]
  assert find_matches("kitten", ["sitting", "kitten", "kiten", "kittenn"], 1) == ["kitten", "kiten"]
  assert find_matches("hello", ["hello", "helo", "hell", "hello!"], 0) == ["hello"]
  assert find_matches("python", [], 1) == []
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