human
Here's a good function header given the following:
I wrote the below code

    def decorator(func):
        def wrapper(*args, **kwargs):
            mock_action = mock.MagicMock()
            from ckan.logic import get_action as original_get_action
            def side_effect(called_action_name):
                if (called_action_name == action_name):
                    return mock_action
                else:
                    return original_get_action(called_action_name)
            try:
                with mock.patch('ckan.logic.get_action') as mock_get_action:
                    with mock.patch('ckan.plugins.toolkit.get_action') as mock_get_action_toolkit:
                        mock_get_action.side_effect = side_effect
                        mock_get_action_toolkit.side_effect = side_effect
                        new_args = (args + tuple([mock_action]))
                        return_value = func(*new_args, **kwargs)
            finally:
                mock_action.stop()
            return return_value
        return nose.tools.make_decorator(func)(wrapper)
    return decorator

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

def mock_action(action_name):