def __get_indexer(in_fns, selected_type=None):
indexer = None<EOL>if selected_type is not None:<EOL><INDENT>indexer = get_indexer_by_filetype(selected_type)<EOL><DEDENT>else:<EOL><INDENT>if len(in_fns) == <NUM_LIT:0>:<EOL><INDENT>raise IndexError("<STR_LIT>" +<EOL>"<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>extension = set([os.path.splitext(f)[<NUM_LIT:1>] for f in in_fns])<EOL>assert(len(extension) >= <NUM_LIT:1>)<EOL>if len(extension) > <NUM_LIT:1>:<EOL><INDENT>raise IndexError("<STR_LIT>" +<EOL>"<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>indexer = get_indexer_by_file_extension(list(extension)[<NUM_LIT:0>])<EOL><DEDENT><DEDENT><DEDENT>assert(indexer is not None)<EOL>return indexer<EOL>
Determine which indexer to use based on input files and type option.