code: def ensure_context_attribute_exists(context, name, default_value=None):
      
      if not hasattr(context, name):
          setattr(context, name, default_value)
docs: 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.