input: Write a function to perform fuzzy search by matching strings with near similarities using the Levenshtein distance algorithm. The function should return a list of strings from the choices that are within the specified distance threshold from the query.
  
  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", ["apply", "apples", "appetite", "bapple"], 2) == ["apply", "apples"]
  assert find_matches("hello", ["hella", "help", "heck", "hello"], 1) == ["hella", "hello"]
  assert find_matches("python", ["thick", "python", "typhon", "thunder"], 3) == ["python", "typhon"]
  assert find_matches("fuzzy", ["fusy", "fuzze", "fizz", "fuzz"], 2) == ["fusy", "fuzze", "fuzz"]
  assert find_matches("", [], 0) == []
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