def get_policy(**kwargs):
    kwargs.setdefault('is_deprecated', False)
    # go through the policies and make sure they match the
    # requirements of kwargs
    for policy in POLICIES:
        # TODO: for EC, pop policy type here and check it first
        matches = True
        for key, value in kwargs.items():
            try:
                if getattr(policy, key) != value:
                    matches = False
            except __HOLE__:
                matches = False
        if matches:
            return policy
    raise SkipTest('No policy matching %s' % kwargs)
dataset/ETHPy150Open openstack/swift/test/probe/common.py/get_policy