<jupyter_start><jupyter_text>clean_email(): Cleaning and validation for email address  Introduction - clean_email() function supports cleaning of messy email values- validate_email() function supports validation on email semantic type of single input value or an input column. When it returns True, the input value is a valid email address.Parameters for clean_email():- split: whether to split input into multiple columns, default False- inplace: whether to clean initial column in place, default False- pre_clean: whether to pre clean input text, default False- fix_domain: whether to fix common typos in domain, default False- report: whether to generate report, default True- errors: error handling types, default "coerce"    - 'raise': raise an exception when there is broken value    - 'coerce': set invalid value to NaN    - 'ignore': just return the initial inputParameters for validate_email():- x: input value, can be Union of single value  Example dirty dataset<jupyter_code>import pandas as pd
import numpy as np
df = pd.DataFrame({"messy_email": 
                   ["<EMAIL>","<EMAIL>","y <EMAIL>","<EMAIL>","H <EMAIL>","hello", np.nan, "NULL"]
                  })
df<jupyter_output><empty_output><jupyter_text>1. Default clean_email() Under default setting, clean_email() will do the strict semantic type check and return report automatically. Broken values will be replaced by NaN.<jupyter_code>from dataprep.clean import clean_email
clean_email(df, "messy_email")<jupyter_output>NumExpr defaulting to 8 threads.<jupyter_text>2. Split Parameter By setting split parameter to True, returned table will contain separate columns for domain and username of valid emails.<jupyter_code>clean_email(df, "messy_email", split = True)<jupyter_output>Email Cleaning Report:
	3 values with bad format (37.5%)
Result contains 3 (37.5%) values in the correct format and 5 null values (62.5%)<jupyter_text>3. Pre_clean Parameter when pre_clean parameter is set to True, the function will fix broken text in advance before do semantic type check.<jupyter_code>clean_email(df, "messy_email", pre_clean = True)<jupyter_output>Email Cleaning Report:
	1 values with bad format (12.5%)
Result contains 5 (62.5%) values in the correct format and 3 null values (37.5%)<jupyter_text>4. Fix_domain Parameter When fix_domain parameter is set to True, the function will do basic check to avoid common typos for popular domains.<jupyter_code>clean_email(df, "messy_email", fix_domain = True)<jupyter_output>Email Cleaning Report:
	1 values with bad format (12.5%)
Result contains 5 (62.5%) values in the correct format and 3 null values (37.5%)<jupyter_text>5. Error Parameter<jupyter_code>clean_email(df, "messy_email", errors = "raise")
clean_email(df, "messy_email", errors = "ignore")<jupyter_output>Email Cleaning Report:
	1 values with bad format (12.5%)
Result contains 5 (62.5%) values in the correct format and 3 null values (37.5%)<jupyter_text>6. Examples for validate_email()<jupyter_code>from dataprep.clean import validate_email
print(validate_email('Abc.example.com'))
print(validate_email('<EMAIL>'))
print(validate_email('<EMAIL>'))
print(validate_email('this is"<EMAIL>'))
validate_email(df["messy_email"])<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup