<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _extract_work(self, filename):
 """Returns the name of the work in `filename`. Some works are divided into multiple parts that need to be joined together. :param filename: filename of TEI :type filename: `str` :rtype: `tuple` of `str` """

        basename = os.path.splitext(os.path.basename(filename))[0]
        match = self.work_pattern.search(basename)
        if match is None:
            self._logger.warning('Found an anomalous filename "{}"'.format(
                filename))
            return None, None
        work = '{}{}'.format(match.group('prefix'), match.group('work'))
        return work, match.group('part')