def _extract_params(self, actual_params, allowed_params):
        """
        Extract a subset of keys from a dictionary. The filters key
        will also be extracted, and each of its values will be returned
        as an individual param.

        :param actual_params: dict of keys to filter
        :param allowed_params: list of keys that 'actual_params' will be
                               reduced to
        :retval subset of 'params' dict
        """
        try:
            # expect 'filters' param to be a dict here
            result = dict(actual_params.get('filters'))
        except TypeError:
            result = {}

        for allowed_param in allowed_params:
            if actual_params in allowed_param:
                result[allowed_param] = actual_params[allowed_param]

        return result
dataset/ETHPy150Open rcbops/glance-buildpackage/glance/common/client.py/BaseClient._extract_params/swapped operands of `in`