Apply any defines and role_defines from the current config.
        The config might be at the task level or the global (top) level.
        The order is such that a role_defines value will override
        a normal defines value.

def _context_defines(self, context, conf):
        """
        Apply any defines and role_defines from the current config.
        The config might be at the task level or the global (top) level.
        The order is such that a role_defines value will override
        a normal defines value.
    """
        if conf and 'defines' in conf and isinstance(conf['defines'], dict):
            context.update(conf['defines'])
        if hasattr(self, '_legion'):
            roles = self._legion.get_roles()
        else:
            roles = self.get_roles()
        if conf and roles and 'role_defines' in conf and isinstance(conf['role_defines'], dict):
            for role in conf['role_defines']:
                if role in roles:
                    context.update(conf['role_defines'][role])