input: Write a python function to read a text file, clean its text by lowering its case, removing punctuation, tokenizing words, and removing stopwords, then write the cleaned text to another file.
  assert clean_text('input.txt', 'output.txt') == 'expected_output'
  assert clean_text('example.txt', 'result.txt') == 'expected_result'
  assert clean_text('test.txt', 'cleaned.txt') == 'expected_cleaned'
output: def clean_text(input_file, output_file):
      import string
      from nltk.corpus import stopwords
      from nltk.tokenize import word_tokenize
      import nltk
      nltk.download('punkt')
      nltk.download('stopwords')
      
      # Read the input file
      with open(input_file, 'r') as file:
          text = file.read()
      
      # Convert text to lowercase
      text = text.lower()
      
      # Remove punctuation
      text = text.translate(str.maketrans('', '', string.punctuation))
      
      # Tokenize words
      words = word_tokenize(text)
      
      # Remove stopwords
      stop_words = set(stopwords.words('english'))
      cleaned_words = [word for word in words if word not in stop_words]
      
      # Convert list of words back to a single string
      cleaned_text = ' '.join(cleaned_words)
      
      # Write the cleaned text to the output file
      with open(output_file, 'w') as file:
          file.write(cleaned_text)