def _check_and_convert_to_indices(options, default_values):
    if ((default_values is None) and (None not in options)):
        return None
    if (not isinstance(default_values, list)):
        if (is_type(default_values, 'numpy.ndarray') or is_type(default_values, 'pandas.core.series.Series')):
            default_values = list(default_values)
        elif (not default_values):
            default_values = [default_values]
        else:
            default_values = list(default_values)
    for value in default_values:
        if (value not in options):
            raise StreamlitAPIException('Every Multiselect default value must exist in options')
    return [options.index(value) for value in default_values]
def _check_and_convert_to_indices(options, default_values):
    if ((default_values is None) and (None not in options)):
        return None
    if (not isinstance(default_values, list)):
        if (is_type(default_values, 'numpy.ndarray') or is_type(default_values, 'pandas.core.series.Series')):
            default_values = list(default_values)
        elif (not default_values):
            default_values = [default_values]
        else:
            default_values = list(default_values)
    for value in default_values:
        if (value not in options):
            raise StreamlitAPIException('Every Multiselect default value must exist in options')
    return [options.index(value) for value in default_values]