# Path: py_stringsimjoin/utils/validation.py
# def validate_attr(attr, table_cols, attr_label, table_label):
#     """Check if the attribute exists in the table."""
#     if attr not in table_cols:
#         raise AssertionError(attr_label + ' \'' + attr + '\' not found in ' + \
#                              table_label) 
#     return True
# 
# def validate_input_table(table, table_label):
#     """Check if the input table is a dataframe."""
#     if not isinstance(table, pd.DataFrame):
#         raise TypeError(table_label + ' is not a dataframe')
#     return True


import pandas as pd
from py_stringsimjoin.utils.validation import validate_attr, \
                                              validate_input_table
    Args:
        input_table (DataFrame): input table to profile.
        profile_attrs (list): list of attribute names from the input table to be
            profiled (defaults to None). If not provided, all attributes in the 
            input table will be profiled.

    Returns:
        A dataframe consisting of profile output. Specifically, the dataframe 
        contains three columns, 

        1) 'Unique values' column, which shows the number of unique values in 
           each attribute,
        2) 'Missing values' column, which shows the number of missing values in 
           each attribute, and 
        3) 'Comments' column, which contains comments about each attribute. 

        The output dataframe is indexed by attribute name, so that the 
        statistics for each attribute can be easily accessed using the attribute name.
    """

    # check if the input table is a dataframe
    validate_input_table(input_table, 'input table')

    profile_output = []

    if profile_attrs is None:
        profile_attrs = list(input_table.columns.values)
    else:
        # check if the profile attributes exist
        for attr in profile_attrs:

# Path: py_stringsimjoin/utils/validation.py
# def validate_attr(attr, table_cols, attr_label, table_label):
#     """Check if the attribute exists in the table."""
#     if attr not in table_cols:
#         raise AssertionError(attr_label + ' \'' + attr + '\' not found in ' + \
#                              table_label) 
#     return True
# 
# def validate_input_table(table, table_label):
#     """Check if the input table is a dataframe."""
#     if not isinstance(table, pd.DataFrame):
#         raise TypeError(table_label + ' is not a dataframe')
#     return True


# Path: py_stringsimjoin/profiler/profiler.py
import pandas as pd
from py_stringsimjoin.utils.validation import validate_attr, \
                                              validate_input_table

    Args:
        input_table (DataFrame): input table to profile.
        profile_attrs (list): list of attribute names from the input table to be
            profiled (defaults to None). If not provided, all attributes in the 
            input table will be profiled.

    Returns:
        A dataframe consisting of profile output. Specifically, the dataframe 
        contains three columns, 

        1) 'Unique values' column, which shows the number of unique values in 
           each attribute,
        2) 'Missing values' column, which shows the number of missing values in 
           each attribute, and 
        3) 'Comments' column, which contains comments about each attribute. 

        The output dataframe is indexed by attribute name, so that the 
        statistics for each attribute can be easily accessed using the attribute name.
    """

    # check if the input table is a dataframe
    validate_input_table(input_table, 'input table')

    profile_output = []

    if profile_attrs is None:
        profile_attrs = list(input_table.columns.values)
    else:
        # check if the profile attributes exist
        for attr in profile_attrs:

            validate_attr(attr, input_table.columns,