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_sounding_files(
        top_sounding_dir_name, radar_file_name_matrix, target_names,
        lag_time_for_convective_contamination_sec):
    """Locates files with storm-centered soundings.

    D = number of SPC dates in time period

    :param top_sounding_dir_name: Name of top-level directory.  Files therein
        will be found by `soundings.find_sounding_file`.
    :param radar_file_name_matrix: numpy array created by either
        `find_storm_images_2d` or `find_storm_images_3d`.  Length of the first
        axis is D.
    :param target_names: See doc for `_check_target_vars`.
    :param lag_time_for_convective_contamination_sec: See doc for
        `soundings.read_soundings`.
    :return: sounding_file_names: length-D list of file paths.
    """

    error_checking.assert_is_numpy_array(radar_file_name_matrix)
    num_file_dimensions = len(radar_file_name_matrix.shape)
    error_checking.assert_is_geq(num_file_dimensions, 2)
    error_checking.assert_is_leq(num_file_dimensions, 3)

    mean_lead_time_seconds = _check_target_vars(target_names)[0]

    num_file_times = radar_file_name_matrix.shape[0]
    sounding_file_names = [''] * num_file_times

    for i in range(num_file_times):
        if num_file_dimensions == 2:
            this_file_name = radar_file_name_matrix[i, 0]
        else:
            this_file_name = radar_file_name_matrix[i, 0, 0]

        this_time_unix_sec, this_spc_date_string = (
            storm_images.image_file_name_to_time(this_file_name)
        )

        sounding_file_names[i] = soundings.find_sounding_file(
            top_directory_name=top_sounding_dir_name,
            spc_date_string=this_spc_date_string,
            lead_time_seconds=mean_lead_time_seconds,
            lag_time_for_convective_contamination_sec=
            lag_time_for_convective_contamination_sec,
            init_time_unix_sec=this_time_unix_sec, raise_error_if_missing=True)

    return sounding_file_names