def lookup_genome_alignment_index(index_fh, indexed_fh, out_fh=sys.stdout,<EOL>key=None, verbose=False):
<EOL>bound_iter = functools.partial(genome_alignment_iterator,<EOL>reference_species="<STR_LIT>", index_friendly=True)<EOL>hash_func = JustInTimeGenomeAlignmentBlock.build_hash<EOL>idx = IndexedFile(record_iterator=bound_iter, record_hash_function=hash_func)<EOL>idx.read_index(index_fh, indexed_fh)<EOL>if key is None:<EOL><INDENT>while key is None or key.strip() != "<STR_LIT>":<EOL><INDENT>sys.stderr.write("<STR_LIT>" +<EOL>"<STR_LIT>")<EOL>key = raw_input()<EOL>key = '<STR_LIT:\t>'.join(key.split()).strip()<EOL>if key != "<STR_LIT>":<EOL><INDENT>out_fh.write(str(idx[key]) + "<STR_LIT:\n>")<EOL><DEDENT>sys.stderr.write("<STR_LIT:\n>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>key = '<STR_LIT:\t>'.join(key.split())<EOL>out_fh.write(str(idx[key]) + "<STR_LIT:\n>")<EOL><DEDENT>
Load a GA index and its indexed file and extract one or more blocks.

    :param index_fh:   the index file to load. Can be a filename or a
                       stream-like object.
    :param indexed_fh: the file that the index was built for,
    :param key:        A single key, iterable of keys, or None. This key will be
                       used for lookup. If None, user is prompted to enter keys
                       interactively.