def filter_by(lookup_dict, grain='os_family', merge=None, default='default'):
    ret = lookup_dict.get(
            __grains__.get(
                grain, default),
            lookup_dict.get(
                default, None)
            )

    if merge:
        if not isinstance(merge, collections.Mapping):
            raise SaltException('filter_by merge argument must be a dictionary.')

        else:

            if ret is None:
                ret = merge

            else:
                salt.utils.dictupdate.update(ret, merge)

    return ret
.. versionadded:: 0.17.0
dataset/ETHPy150Open saltstack/salt/salt/client/ssh/wrapper/grains.py/filter_by