input: Write a function to generate a fuzzy search algorithm in Python that can match strings with near similarities. The function should take a query string, a list of choices, and a threshold value as inputs. It should return a list of choices that are within the specified similarity threshold to the query string using the Levenshtein distance.
  
  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", "appla", "appel", "apble"], 2) == ["apple", "appla", "appel"]
  assert find_matches("banana", ["banena", "bannaa", "banan", "bananan"], 1) == ["banena", "bannaa", "banan"]
  assert find_matches("grape", ["grape", "graep", "grapp", "grapez"], 1) == ["grape", "graep", "grapp"]
  assert find_matches("", ["", "a", "b", "c"], 0) == [""]
  assert find_matches("cherry", [], 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
  