def check_category_type_by_name(conn, category_type_name):
    if (is_conn(conn) and is_str(category_type_name)):
        category_type_id = get_category_type_id_by_name(conn, category_type_name)
        if (category_type_id == (- 1)):
            print('Category Type ', category_type_name, ' does not exist.')
            add_category_type_by_name(conn, category_type_name)
            category_type_id = get_category_type_id_by_name(conn, category_type_name)
            print('Creating category type :', category_type_name, '- ID:', category_type_id)
        else:
            print('Category already exists :', category_type_name, '- ID:', category_type_id)
        return category_type_id
    else:
        raise AttributeError('Connection object or Category Name                 was not provided')
def check_category_type_by_name(conn, category_type_name):
    if (is_conn(conn) and is_str(category_type_name)):
        category_type_id = get_category_type_id_by_name(conn, category_type_name)
        if (category_type_id == (- 1)):
            print('Category Type ', category_type_name, ' does not exist.')
            add_category_type_by_name(conn, category_type_name)
            category_type_id = get_category_type_id_by_name(conn, category_type_name)
            print('Creating category type :', category_type_name, '- ID:', category_type_id)
        else:
            print('Category already exists :', category_type_name, '- ID:', category_type_id)
        return category_type_id
    else:
        raise AttributeError('Connection object or Category Name                 was not provided')