def what_provides(self, requirement, mode='composer'):
        """Returns a list of packages that provide the given requirement.

        Arguments
        ---------
        requirement: Requirement
            the requirement to match
        mode: str
            One of the following string:

                - 'composer': behaves like Composer does, i.e. only returns
                  packages that match this requirement directly, unless no
                  match is found in which case packages that provide the
                  requirement indirectly are returned.
                - 'direct_only': only returns packages that match this
                  requirement directly (i.e. provides are ignored).
                - 'include_indirect': only returns packages that match this
                  requirement directly or indirectly (i.e. includes packages
                  that provides this package)
        """
        # FIXME: this is conceptually copied from whatProvides in Composer, but
        # I don't understand why the policy of preferring non-provided over
        # provided packages is handled here.
        if not mode in ['composer', 'direct_only', 'include_indirect']:
            raise ValueError(mode % "Invalid mode %r")

        strict_matches = []
        provided_match = []
        name_match = False

        for package in self._packages_by_name[requirement.name]:
            match = self.matches(package, requirement)
            if match == MATCH_NONE:
                pass
            elif match == MATCH_NAME:
                name_match = True
            elif match == MATCH:
                name_match = True
                strict_matches.append(package)
            elif match == MATCH_PROVIDE:
                provided_match.append(package)
            elif match == MATCH_REPLACE:
                strict_matches.append(package)
            else:
                raise ValueError("Invalid match type: {}".format(match))

        if mode == 'composer':
            if name_match:
                return strict_matches
            else:
                return strict_matches + provided_match
        elif mode == 'direct_only':
            return strict_matches
        elif mode == 'include_indirect':
            return strict_matches + provided_match
dataset/ETHPy150Open enthought/depsolver/depsolver/pool.py/Pool.what_provides/swapped operands of `%`