human
I wrote the below code

    def _execute_under_condition(func):
        @functools.wraps(func)
        def _wrapper(instance, *args, **kwargs):
            has_all_attributes = all([hasattr(instance, key) for key in attr_dict])
            if has_all_attributes:
                has_the_right_values = all([(getattr(instance, key) == value) for (key, value) in attr_dict.items()])
                if has_the_right_values:
                    func(instance, *args, **kwargs)
        return _wrapper
    return _execute_under_condition

What's a good function header?
assistant
#Here's a good function header.

def on_package_attributes(**attr_dict):