def _build_index(maf_strm, ref_spec):
idx_strm = StringIO.StringIO()<EOL>bound_iter = functools.partial(genome_alignment_iterator,<EOL>reference_species=ref_spec)<EOL>hash_func = JustInTimeGenomeAlignmentBlock.build_hash<EOL>idx = IndexedFile(maf_strm, bound_iter, hash_func)<EOL>idx.write_index(idx_strm)<EOL>idx_strm.seek(<NUM_LIT:0>)  <EOL>return idx_strm<EOL>
Build an index for a MAF genome alig file and return StringIO of it.