def _join_translated()

in setup.py [0:0]


def _join_translated(translated_parts, os_sep_class):
    """Join translated glob pattern parts.

    This is different from a simple join, as care need to be taken
    to allow ** to match ZERO or more directories.
    """
    res = ""
    for part in translated_parts[:-1]:
        if part == ".*":
            # drop separator, since it is optional
            # (** matches ZERO or more dirs)
            res += part
        else:
            res += part + os_sep_class

    if translated_parts[-1] == ".*":
        # Final part is **
        res += ".+"
        # Follow stdlib/git convention of matching all sub files/directories:
        res += "({os_sep_class}?.*)?".format(os_sep_class=os_sep_class)
    else:
        res += translated_parts[-1]
    return res