# Path: src/formpack/utils/array_to_xpath.py
# def array_to_xpath(outer_arr, fns={}):
#     flattened = array_to_xpath.array_to_flattened_array(outer_arr, fns)
#     return array_to_xpath.flattened_array_to_padded_string(flattened)
# 
# Path: src/formpack/utils/replace_aliases.py
# SELECT_TYPES = list(selects.keys())
# 
# Path: src/formpack/constants.py
# UNTRANSLATED = None
# 
# OR_OTHER_COLUMN = '_or_other'
# 
# TAG_COLUMNS_AND_SEPARATORS = {
#     # Separators are used when flattening tags into a single column. Keys are
#     # column names, values are separators.
#     'hxl': '',
# }


import re
from collections import defaultdict, OrderedDict
from copy import deepcopy
from functools import reduce
from .array_to_xpath import array_to_xpath
from .replace_aliases import SELECT_TYPES
from ..constants import (
    UNTRANSLATED,
    OR_OTHER_COLUMN,
    TAG_COLUMNS_AND_SEPARATORS,
)

    if isinstance(survey_content.get('settings'), dict):
        survey_content['settings'] = [survey_content['settings']]

    return None


def flatten_content(survey_content, in_place=False, **opts):
    if in_place:
        flatten_content_in_place(survey_content, **opts)
        return None
    else:
        survey_content_copy = deepcopy(survey_content)
        flatten_content_in_place(survey_content_copy, **opts)
        return survey_content_copy


def _stringify_type__depr(json_qtype):
    """
    NOTE: This particular representation of select_* types is being
          deprecated. [Oct 2016]

    {'select_one': 'xyz'} -> 'select_one xyz'
    {'select_multiple': 'xyz'} -> 'select_mutliple xyz'
    """
    if len(json_qtype.keys()) != 1:
        raise ValueError(
            'Type object must have exactly one key: %s'
            % ', '.join(SELECT_TYPES)
        )

# Path: src/formpack/utils/array_to_xpath.py
# def array_to_xpath(outer_arr, fns={}):
#     flattened = array_to_xpath.array_to_flattened_array(outer_arr, fns)
#     return array_to_xpath.flattened_array_to_padded_string(flattened)
# 
# Path: src/formpack/utils/replace_aliases.py
# SELECT_TYPES = list(selects.keys())
# 
# Path: src/formpack/constants.py
# UNTRANSLATED = None
# 
# OR_OTHER_COLUMN = '_or_other'
# 
# TAG_COLUMNS_AND_SEPARATORS = {
#     # Separators are used when flattening tags into a single column. Keys are
#     # column names, values are separators.
#     'hxl': '',
# }


# Path: src/formpack/utils/flatten_content.py
import re
from collections import defaultdict, OrderedDict
from copy import deepcopy
from functools import reduce
from .array_to_xpath import array_to_xpath
from .replace_aliases import SELECT_TYPES
from ..constants import (
    UNTRANSLATED,
    OR_OTHER_COLUMN,
    TAG_COLUMNS_AND_SEPARATORS,
)


    if isinstance(survey_content.get('settings'), dict):
        survey_content['settings'] = [survey_content['settings']]

    return None


def flatten_content(survey_content, in_place=False, **opts):
    if in_place:
        flatten_content_in_place(survey_content, **opts)
        return None
    else:
        survey_content_copy = deepcopy(survey_content)
        flatten_content_in_place(survey_content_copy, **opts)
        return survey_content_copy


def _stringify_type__depr(json_qtype):
    """
    NOTE: This particular representation of select_* types is being
          deprecated. [Oct 2016]

    {'select_one': 'xyz'} -> 'select_one xyz'
    {'select_multiple': 'xyz'} -> 'select_mutliple xyz'
    """
    if len(json_qtype.keys()) != 1:
        raise ValueError(
            'Type object must have exactly one key: %s'
            % ', '.join(SELECT_TYPES)
        )

    for try_key in SELECT_TYPES: