@staticmethod
def filtered_iteritems(d, filter_keys):
    """A generator that filters a dict's items to keys in `filter_keys`.

        Args:
            d (:obj:`dict`): dictionary to filter.
            filter_keys (:obj:`list` of :obj:`str`): list of keys to retain.

        Yields:
            :obj:`tuple`: (key, value) tuples from `d` whose keys are in `filter_keys`.
        """
    for key, val in d.items():
        if key not in filter_keys:
            continue
        yield key, val
