# Path: config/config.py
# CONFIG = Config(dictionary)
# 
# Path: bigbang/analysis/utils.py
# def get_index_of_msgs_with_subject(
#     df: pd.DataFrame,
#     return_boolmask: bool = False,
# ) -> np.array:
# def get_index_of_msgs_with_datetime(
#     df: pd.DataFrame,
#     return_boolmask: bool = False,
# ) -> np.array:
# def clean_addresses(df: pd.DataFrame) -> pd.DataFrame:
# def clean_subject(df: pd.DataFrame) -> pd.DataFrame:
# def clean_datetime(df: pd.DataFrame) -> pd.DataFrame:
# def extract_email(from_field):
# def extract_domain(from_field):
# def domain_entropy(domain, froms):
# 
# Path: bigbang/data_types.py



import datetime
import glob
import os
import re
import logging
import mailbox
import numpy as np
import pandas as pd
from typing import Dict, List, Optional, Tuple, Union
from mailbox import mboxMessage
from pathlib import Path
from config.config import CONFIG
from bigbang.analysis import utils
from bigbang.data_types import Message, MailList, MailListDomain


filepath_auth = CONFIG.config_path + "authentication.yaml"
directory_project = str(Path(os.path.abspath(__file__)).parent.parent)
logging.basicConfig(
    filename=directory_project + "/listserv.log",
    filemode="w",
    level=logging.INFO,
    format="%(asctime)s %(message)s",
)
logger = logging.getLogger(__name__)



# Path: config/config.py
# CONFIG = Config(dictionary)
# 
# Path: bigbang/analysis/utils.py
# def get_index_of_msgs_with_subject(
#     df: pd.DataFrame,
#     return_boolmask: bool = False,
# ) -> np.array:
# def get_index_of_msgs_with_datetime(
#     df: pd.DataFrame,
#     return_boolmask: bool = False,
# ) -> np.array:
# def clean_addresses(df: pd.DataFrame) -> pd.DataFrame:
# def clean_subject(df: pd.DataFrame) -> pd.DataFrame:
# def clean_datetime(df: pd.DataFrame) -> pd.DataFrame:
# def extract_email(from_field):
# def extract_domain(from_field):
# def domain_entropy(domain, froms):
# 
# Path: bigbang/data_types.py



# Path: bigbang/bigbang_io.py
import datetime
import glob
import os
import re
import logging
import mailbox
import numpy as np
import pandas as pd
from typing import Dict, List, Optional, Tuple, Union
from mailbox import mboxMessage
from pathlib import Path
from config.config import CONFIG
from bigbang.analysis import utils
from bigbang.data_types import Message, MailList, MailListDomain



filepath_auth = CONFIG.config_path + "authentication.yaml"
directory_project = str(Path(os.path.abspath(__file__)).parent.parent)
logging.basicConfig(
    filename=directory_project + "/listserv.log",
    filemode="w",
    level=logging.INFO,
    format="%(asctime)s %(message)s",
)
logger = logging.getLogger(__name__)



def email_to_dict(msg: Message) -> Dict[str, str]: