def pivotCategoricalColumns(conn,table_name,cols,label='',col_distinct_vals_dict=None):
    #Since we allow the user to specify the table name as "schema_name.table_name) and since the
    #information schema requires the table name to be separated out from schema name, so the following
    #ste is required only for the query to look-up column types. It will be used thereafter.
    tbl_schema = 'public' if '.' not in table_name else table_name.split('.')[0]
    tbl_nm = table_name.split('.')[1] if '.' in table_name else table_name
    
    output_table = '{default_schema}.{default_prefix}{table_name}'.format(default_schema=default_schema, 
                                                                          default_prefix=default_prefix, 
                                                                          table_name=tbl_nm
                                                                          )
    col_types_dict = __getColTypesDict__(conn,tbl_schema, tbl_nm)  
                                 
    #It is possible that the input columns could also have a 'bias' variable (intercept in linear regression)
    #The intercept is a number represented as a string. If such a value exists, remove it from the input columns
    #and consider it separately (we don't have to create a column for this variable in the transformed table).
    numeric_cols = []
    for col in cols:
        if (not col_types_dict.has_key(col) and isNumeric(col)):
            numeric_cols.append(col)
    #Remove the intercept variables from cols
    cols = [c for c in cols if c not in numeric_cols]

    #If all the columns in the input are numeric, return the original table along with its columns.
    has_categorical=False
    for col in cols:
        if(col_types_dict[col] in ['char','character varying', 'text']):
            has_categorical = True
    
    #Return original table and original list of columns        
    if(not has_categorical):
        return table_name, numeric_cols+cols, label, col_distinct_vals_dict
    
    if (not col_distinct_vals_dict):
        col_distinct_vals_dict = __getColDistinctValsDict__(conn, cols, col_types_dict, table_name)

    col_names_and_types_lst = __getColNamesAndTypesList__(cols,col_types_dict, col_distinct_vals_dict)

    __createPivotTable__(conn, output_table, col_types_dict, col_names_and_types_lst, label)
    #Now insert values into the new table                                                             
    __binarizeInParallel__(conn, table_name,output_table,cols,col_types_dict, col_distinct_vals_dict, label)                     
    #First include all numeric columns that correspond to any intercept/constant/bias variables
    #Then combine them with the independent variables (transformed or un-transformed)
    output_indep_cols = numeric_cols + [c[0] for c in col_names_and_types_lst]
    output_dep_col = label                                   
    return output_table, output_indep_cols, output_dep_col, col_distinct_vals_dict
When building a subproject release, documentation should be built with
dataset/ETHPy150Open pivotalsoftware/pymadlib/pymadlib/utils.py/pivotCategoricalColumns--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/python/test/test_release.py/DistributionBuilderTest.test_subProjectDocBuilding