<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hmmsearch(self, input_pipe, hmms, output_files):
 r"""Run HMMsearch with all the HMMs, generating output files Parameters input_pipe: String A string which is a partial command line. When this command is run is outputs to STDOUT fasta formatted protein sequences, which hmmsearch runs on. hmms: list of paths A list of (string) paths to HMM files which are used to search with. output_files: list of paths A list of (string) paths to output CSV files to be generated by the HMM searching Returns ------- N/A May raise an exception if hmmsearching went amiss"""


        # Check input and output paths are the same length
        if len(hmms) != len(output_files):
            raise Exception("Programming error: number of supplied HMMs differs from the number of supplied output files")

        # Create queue data structure
        queue = []
        for i, hmm in enumerate(hmms):
            queue.append( [hmm, output_files[i]] )

        # While there are more things left in the queue
        while len(queue) > 0:
            pairs_to_run = self._munch_off_batch(queue)

            # Run hmmsearches with each of the pairs
            cmd = self._hmm_command(input_pipe, pairs_to_run)
            logging.debug("Running command: %s" % cmd)

            try:
                extern.run(cmd)
            except extern.ExternCalledProcessError, e:
                if e.stderr == '\nError: Sequence file - is empty or misformatted\n\n':
                    raise NoInputSequencesException(cmd)
                else:
                    raise e