'Find the base file matching this fingerprint.
Yields the name of a base file which exists.
Note that it is possible for more than one yield to result from this
check.
If no base file is found, then nothing is yielded.'

def _find_base_file(self, base_dir, fingerprint):

    base_file = os.path.join(base_dir, fingerprint)
    if os.path.exists(base_file):
        (yield base_file)
    base_file = os.path.join(base_dir, (fingerprint + '_sm'))
    if os.path.exists(base_file):
        (yield base_file)
    resize_re = re.compile(('.*/%s_[0-9]+$' % fingerprint))
    for img in self.unexplained_images:
        m = resize_re.match(img)
        if m:
            (yield img)
