<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_context_attribute_exists(context, name, default_value=None):
 """ Ensure a behave resource exists as attribute in the behave context. If this is not the case, the attribute is created by using the default_value. """

    if not hasattr(context, name):
        setattr(context, name, default_value)