input: Write a function to generate a fuzzy search algorithm in Python that can match strings with near similarities by calculating the Levenshtein distance between a query string and a list of choices. The function should return a list of choices that have a Levenshtein distance less than or equal to a given threshold.
  
  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", "aplle", "orange"], 2) == ["appel", "aplle"]
  assert find_matches("python", ["pyhton", "pythen", "java"], 1) == ["pyhton", "pythen"]
  assert find_matches("fuzzy", ["fzzy", "fuzy", "fuzz"], 1) == ["fzzy", "fuzy"]
  assert find_matches("test", ["tst", "tset", "tent"], 2) == ["tst", "tset"]
  assert find_matches("hello", ["helo", "hllo", "jello"], 1) == ["helo", "hllo"]
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