def glob_with_suffix(pattern, extensions_map, sort=True):
    r"""
    Filters the results from the glob pattern passed in to only those files
    that have an importer given in `extensions_map`.

    Parameters
    ----------
    pattern : string
        A UNIX style glob pattern to match against.
    extensions_map : dictionary (String, :class:`menpo.io.base.Importer`)
        A map from extensions to importers. The importers are expected to be
        non-instantiated classes. The extensions are expected to
        contain the leading period eg. `.obj`.
    sort : `bool`, optional
        If True, the returned paths will be sorted. If False, no guarantees are
        made about the ordering of the results.

    Yields
    ------
    filepaths : list of string
        The list of filepaths that have valid extensions.
    """
    for path in _pathlib_glob_for_pattern(pattern, sort=sort):
        # we want to extract '.pkl.gz' as an extension - for this we need to
        # use suffixes and join.
        # .suffix only takes
        # However, the filename might have a '.' in it, e.g. '1.1.png'.
        # In this case, try again with just the suffix.
        if (''.join(path.suffixes[-2:]) in extensions_map or
                extensions_map in path.suffix):
            yield path
dataset/ETHPy150Open menpo/menpo/menpo/io/input/base.py/glob_with_suffix/swapped operands of `in`