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 read_specific_examples(
        netcdf_file_name, read_all_target_vars, full_storm_id_strings,
        storm_times_unix_sec, target_name=None, include_soundings=True,
        radar_field_names_to_keep=None, radar_heights_to_keep_m_agl=None,
        sounding_field_names_to_keep=None, sounding_heights_to_keep_m_agl=None,
        num_rows_to_keep=None, num_columns_to_keep=None):
    """Reads specific examples (with specific ID-time pairs) from NetCDF file.

    :param netcdf_file_name: Path to input file.
    :param read_all_target_vars: See doc for `read_example_file`.
    :param full_storm_id_strings: length-E list of storm IDs.
    :param storm_times_unix_sec: length-E numpy array of valid times.
    :param target_name: See doc for `read_example_file`.
    :param metadata_only: Same.
    :param include_soundings: Same.
    :param radar_field_names_to_keep: Same.
    :param radar_heights_to_keep_m_agl: Same.
    :param sounding_field_names_to_keep: Same.
    :param sounding_heights_to_keep_m_agl: Same.
    :param num_rows_to_keep: Same.
    :param num_columns_to_keep: Same.
    :return: example_dict: See doc for `write_example_file`.
    """

    if (
            target_name ==
            'tornado_lead-time=0000-3600sec_distance=00000-10000m'
    ):
        target_name = (
            'tornado_lead-time=0000-3600sec_distance=00000-30000m_min-fujita=0'
        )

    error_checking.assert_is_boolean(read_all_target_vars)
    error_checking.assert_is_boolean(include_soundings)

    example_dict, dataset_object = _read_metadata_from_example_file(
        netcdf_file_name=netcdf_file_name, include_soundings=include_soundings)

    example_indices_to_keep = tracking_utils.find_storm_objects(
        all_id_strings=example_dict[FULL_IDS_KEY],
        all_times_unix_sec=example_dict[STORM_TIMES_KEY],
        id_strings_to_keep=full_storm_id_strings,
        times_to_keep_unix_sec=storm_times_unix_sec, allow_missing=False
    )

    example_dict[FULL_IDS_KEY] = [
        example_dict[FULL_IDS_KEY][k] for k in example_indices_to_keep
    ]
    example_dict[STORM_TIMES_KEY] = example_dict[STORM_TIMES_KEY][
        example_indices_to_keep]

    if read_all_target_vars:
        example_dict[TARGET_MATRIX_KEY] = numpy.array(
            dataset_object.variables[TARGET_MATRIX_KEY][
                example_indices_to_keep, :],
            dtype=int
        )
    else:
        target_index = example_dict[TARGET_NAMES_KEY].index(target_name)
        example_dict[TARGET_NAME_KEY] = target_name
        example_dict.pop(TARGET_NAMES_KEY)

        example_dict[TARGET_VALUES_KEY] = numpy.array(
            dataset_object.variables[TARGET_MATRIX_KEY][
                example_indices_to_keep, target_index],
            dtype=int
        )

    example_dict = _subset_radar_data(
        example_dict=example_dict, netcdf_dataset_object=dataset_object,
        example_indices_to_keep=example_indices_to_keep,
        field_names_to_keep=radar_field_names_to_keep,
        heights_to_keep_m_agl=radar_heights_to_keep_m_agl,
        num_rows_to_keep=num_rows_to_keep,
        num_columns_to_keep=num_columns_to_keep)

    if not include_soundings:
        dataset_object.close()
        return example_dict

    example_dict = _subset_sounding_data(
        example_dict=example_dict, netcdf_dataset_object=dataset_object,
        example_indices_to_keep=example_indices_to_keep,
        field_names_to_keep=sounding_field_names_to_keep,
        heights_to_keep_m_agl=sounding_heights_to_keep_m_agl)

    dataset_object.close()
    return example_dict