def _getSmartIndenter(indenterName, qpart, indenter):
    """Get indenter by name.
    Available indenters are none, normal, cstyle, haskell, lilypond, lisp, python, ruby, xml
    Indenter name is not case sensitive
    Raise KeyError if not found
    indentText is indentation, which shall be used. i.e. '\t' for tabs, '    ' for 4 space symbols
    """
    indenterName = indenterName.lower()

    if indenterName in ('haskell', 'lilypond'):  # not supported yet
        logger.warning('Smart indentation for %s not supported yet. But you could be a hero who implemented it' % indenterName)
        from qutepart.indenter.base import IndentAlgNormal as indenterClass
    elif 'none' == indenterName:
        from qutepart.indenter.base import IndentAlgBase as indenterClass
    elif 'normal' == indenterName:
        from qutepart.indenter.base import IndentAlgNormal as indenterClass
    elif 'cstyle' == indenterName:
        from qutepart.indenter.cstyle import IndentAlgCStyle as indenterClass
    elif 'python' == indenterName:
        from qutepart.indenter.python import IndentAlgPython as indenterClass
    elif 'ruby' == indenterName:
        from qutepart.indenter.ruby import IndentAlgRuby as indenterClass
    elif 'xml' == indenterName:
        from qutepart.indenter.xmlindent import IndentAlgXml as indenterClass
    elif 'haskell' == indenterName:
        from qutepart.indenter.haskell import IndenterHaskell as indenterClass
    elif 'lilypond' == indenterName:
        from qutepart.indenter.lilypond import IndenterLilypond as indenterClass
    elif 'lisp' == indenterName:
        from qutepart.indenter.lisp import IndentAlgLisp as indenterClass
    elif 'scheme' == indenterName:
        from qutepart.indenter.scheme import IndentAlgScheme as indenterClass
    else:
        raise KeyError("Indenter %s not found" % indenterName)

    return indenterClass(qpart, indenter)
def find_storm_images_3d(
        top_directory_name, radar_source, radar_field_names,
        radar_heights_m_agl, first_spc_date_string, last_spc_date_string):
    """Locates files with 3-D storm-centered radar images.

    D = number of SPC dates in time period (`first_spc_date_string`...
        `last_spc_date_string`)

    :param top_directory_name: See doc for `find_storm_images_2d`.
    :param radar_source: Same.
    :param radar_field_names: List (length F_r) of radar fields.  Each item must
        be accepted by `radar_utils.check_field_name`.
    :param radar_heights_m_agl: numpy array (length H_r) of radar heights
        (metres above ground level).
    :param first_spc_date_string: First SPC date (format "yyyymmdd").  This
        method will locate files from `first_spc_date_string`...
        `last_spc_date_string`.
    :param last_spc_date_string: Same.
    :return: radar_file_name_matrix: numpy array (D x F_r x H_r) of file paths.
    """

    radar_utils.check_data_source(radar_source)
    first_spc_date_unix_sec = time_conversion.spc_date_string_to_unix_sec(
        first_spc_date_string)
    last_spc_date_unix_sec = time_conversion.spc_date_string_to_unix_sec(
        last_spc_date_string)

    if radar_source == radar_utils.GRIDRAD_SOURCE_ID:
        file_dict = storm_images.find_many_files_gridrad(
            top_directory_name=top_directory_name,
            radar_field_names=radar_field_names,
            radar_heights_m_agl=radar_heights_m_agl,
            start_time_unix_sec=first_spc_date_unix_sec,
            end_time_unix_sec=last_spc_date_unix_sec,
            one_file_per_time_step=False, raise_error_if_all_missing=True)
    else:
        file_dict = storm_images.find_many_files_myrorss_or_mrms(
            top_directory_name=top_directory_name, radar_source=radar_source,
            radar_field_names=[radar_utils.REFL_NAME],
            reflectivity_heights_m_agl=radar_heights_m_agl,
            start_time_unix_sec=first_spc_date_unix_sec,
            end_time_unix_sec=last_spc_date_unix_sec,
            one_file_per_time_step=False,
            raise_error_if_all_missing=True, raise_error_if_any_missing=False)

    radar_file_name_matrix = file_dict[storm_images.IMAGE_FILE_NAMES_KEY]
    num_file_times = radar_file_name_matrix.shape[0]

    if radar_source != radar_utils.GRIDRAD_SOURCE_ID:
        radar_file_name_matrix = numpy.reshape(
            radar_file_name_matrix,
            (num_file_times, 1, len(radar_heights_m_agl))
        )

    time_missing_indices = numpy.unique(
        numpy.where(radar_file_name_matrix == '')[0]
    )
    return numpy.delete(
        radar_file_name_matrix, time_missing_indices, axis=0)