def siblingExtensionSearch(self, *exts):
        """
        Attempt to return a path with my name, given multiple possible
        extensions.

        Each extension in C{exts} will be tested and the first path which
        exists will be returned.  If no path exists, L{None} will be returned.
        If C{''} is in C{exts}, then if the file referred to by this path
        exists, C{self} will be returned.

        The extension '*' has a magic meaning, which means "any path that
        begins with C{self.path + '.'} is acceptable".
        """
        for ext in exts:
            if not ext and self.exists():
                return self

            p = self._getPathAsSameTypeAs(ext)
            star = _coerceToFilesystemEncoding(ext, "*")
            dot = _coerceToFilesystemEncoding(ext, ".")

            if ext == star:
                basedot = basename(p) + dot
                for fn in listdir(dirname(p)):
                    if fn.startswith(basedot):
                        return self.clonePath(joinpath(dirname(p), fn))
            p2 = p + ext
            if exists(p2):
                return self.clonePath(p2)

        Attempt to return a path with my name, given multiple possible
        extensions.

        Each extension in C{exts} will be tested and the first path which
        exists will be returned.  If no path exists, L{None} will be returned.
        If C{''} is in C{exts}, then if the file referred to by this path
        exists, C{self} will be returned.

        The extension '*' has a magic meaning, which means "any path that
        begins with C{self.path + '.'} is acceptable".
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/filepath.py