docs: def _context_defaults(self, context, conf):
          """
          Apply any defaults and role_defaults from the current config.
          The config might be at the task level or the global (top) level.
          The order is such that a role_defaults value will be applied before
          a normal defaults value so if present, the role_defaults is preferred.
      """
          if hasattr(self, '_legion'):
              roles = self._legion.get_roles()
          else:
              roles = self.get_roles()
          if conf and roles and 'role_defaults' in conf and isinstance(conf['role_defaults'], dict):
              for role in conf['role_defaults']:
                  if role in roles:
                      for tag, val in conf['role_defaults'][role].items():
                          if tag not in context:
                              context[tag] = val
          if conf and 'defaults' in conf and isinstance(conf['defaults'], dict):
              for tag, val in conf['defaults'].items():
                  if tag not in context:
                      context[tag] = val