Act as Python expert and expert in programming and bug fix. start with 'Sure, i will assist' and being the code.
Write me an python code in full.
Description of code: Remove the whole sentences which begins with 'To:' and 'cc:', before joining the lines. A whole sentence can be defined by have a new line and no by any special character or symbols.

Code:
import os 
import re 
  
def remove_sentences(input_string): 
    forbidden_texts = ['This email may contain privileged/classified information', 
                       'If you are not the intended recipient, please notify the sender', 
                       'You are not allowed to disclose, distribute', 
                       'We are not liable for any loss or damage', 
                       'Any form of disclosure or reproduction is strictly', 
                       'You may not rely on this e -mail as legal or', 
                       'If you received this e-mail by mistake', 
                       'Synapxe is the national HealthTech agency', 
                       'Thank you for your interest in our site. For more', 
                       'IHiS improves the Singapore', 
                       'You may not rely on this ', 
                       'The Trusted Technology Partner', 
                       'IHiS is a multi-award-winning healthcare IT', 
                      'iHiS is a multiple award-winning', 
                       'Visit us at www.ihis.com.sg ', 
                       'Visit www.ihis.com.sg ', 
                       'For confidential support call', 
                       'see www.samaritans.org', 
                       'Regards,', 
                       'Sincerely,', 
                       'Unclassified, Non-', 
                       'Classified, Sen', 
                       'Classified, Non-Sen', 
                       'If you received this by mistake', 
                       'This message came from outside your', 
                       'To sign up, go', 
                       'Click here for more', 
                       'Automation Leader and Technical Project', 
                       'Any form of disclosure or reproduction', 
                       'Pharmacy is a multi-award-winning healthcare', 
                       'we can also be contacted at 1800', 
                       'This e-mail (including any attachment) may contain'] 
    sentences = re.split('\.\s+', input_string)  # Split input_string into sentences 
    filtered_sentences = [sentence for sentence in sentences 
                           if not any(forbidden_text in sentence for forbidden_text in forbidden_texts)] 
    return '. '.join(filtered_sentences)  # Join filtered sentences back into a string 

def remove_cc(input_string):
    pattern = r'(?i)Cc:.*?Subject:'
    cleaned_text = re.sub(pattern, '', input_string)
    return cleaned_text.strip()
  
def remove_text_within_brackets(input_string): 
    pattern = r'\[.*?\]|<\s*[^>]*\s*>|\(\s*[^)]*\s*\)' 
    clean_text = re.sub(pattern, '', input_string) 
    return clean_text 
  
  
def join_lines_in_files(directory_path): 
    try: 
        # Get all text files in the directory 
        files = [file for file in os.listdir(directory_path) if file.endswith('.txt')] 
  
        for file in files: 
            file_path = os.path.join(directory_path, file) 
            with open(file_path, 'r', encoding='utf-8') as f: 
                # Read the content of the file 
                content = f.read() 
  
            # Remove sentences containing specific texts 
            content = remove_sentences(content) 

            # Remove cc areas
            content = remove_cc(content) 

            # Remove text within brackets 
            content = remove_text_within_brackets(content) 
  
            # Use regular expression to join lines within each paragraph with a single space 
            content = re.sub(r'(?<=\S)\n+', ' ', content) 
             
            # Use regular expression to remove spacing before the first word in the new line 
            content = re.sub(r'\n\s+', '\n', content) 
             
            # Use regular expression to ensure a single space between words when joining lines 
            content = re.sub(r'\s+', ' ', content) 
  
            # Overwrite the file with the updated content 
            with open(file_path, 'w', encoding='utf-8') as f: 
                f.write(content) 
  
        print("Line joining, spacing removal, and text within brackets removal completed successfully.") 
    except Exception as e: 
        print("An error occurred:", str(e)) 
  
  
# Define the path to the directory containing the text files 
directory_path = r'C:\Users\gnulch2\Desktop\EmailsSum2' 
  
# Call the function to join lines and remove spacing in files in the specified directory 
join_lines_in_files(directory_path)