def _process_pair(first_fn, second_fn, error_protocol):
ebook = None<EOL>metadata = None<EOL>if _is_meta(first_fn) and not _is_meta(second_fn):    <EOL><INDENT>logger.debug(<EOL>"<STR_LIT>" % (first_fn, second_fn)<EOL>)<EOL>metadata, ebook = first_fn, second_fn<EOL><DEDENT>elif not _is_meta(first_fn) and _is_meta(second_fn):  <EOL><INDENT>logger.debug(<EOL>"<STR_LIT>" % (second_fn, first_fn)<EOL>)<EOL>metadata, ebook = second_fn, first_fn<EOL><DEDENT>elif _is_meta(first_fn) and _is_meta(second_fn):      <EOL><INDENT>logger.debug(<EOL>"<STR_LIT>" % (first_fn, second_fn)<EOL>)<EOL>return [<EOL>_safe_read_meta_file(first_fn, error_protocol),<EOL>_safe_read_meta_file(second_fn, error_protocol)<EOL>]<EOL><DEDENT>else:                                                 <EOL><INDENT>logger.debug(<EOL>"<STR_LIT>" % (first_fn, second_fn)<EOL>)<EOL>return [<EOL>EbookFile(first_fn),<EOL>EbookFile(second_fn)<EOL>]<EOL><DEDENT>pair = DataPair(<EOL>metadata_file=_safe_read_meta_file(metadata, error_protocol),<EOL>ebook_file=EbookFile(ebook)<EOL>)<EOL>if not pair.metadata_file:<EOL><INDENT>logger.error(<EOL>"<STR_LIT>" % (<EOL>metadata, ebook<EOL>)<EOL>)<EOL>return [pair.ebook_file]<EOL><DEDENT>return [pair]<EOL>
Look at given filenames, decide which is what and try to pair them.