def __init__(self, headers, process=None, resource_id_required=True):
        '''
        A helper object for retrieving governance related values: op, actor_id, actor_roles, resource_id from the message header
        @param headers:
        @param resource_id_required: True if the message header must have a resource-id field and value.
        @return op, actor_id, actor_roles, resource_id:
        '''

        if not headers or not isinstance(headers, dict) or not len(headers):
            raise BadRequest('The headers parameter is not a valid message header dictionary')

        if headers.has_key('op'):
            self._op = headers['op']
        else:
            self._op = "Unknown-Operation"

        if process is not None and hasattr(process, 'name'):
            self._process_name = process.name
        else:
            if headers.has_key('process'):
                if getattr(headers['process'],'name'):
                    self._process_name = headers['process'].name
                else:
                    self._process_name = "Unknown-Process"
            else:
                self._process_name = "Unknown-Process"


        #The self.name references below should be provided by the running ION process ( service, agent, etc ) which will be using this class.
        if headers.has_key('ion-actor-id'):
            self._actor_id = headers['ion-actor-id']
        else:
            raise Inconsistent('%s(%s) has been denied since the ion-actor-id can not be found in the message headers'% (self._process_name, self._op))

        if headers.has_key('ion-actor-roles'):
            self._actor_roles = headers['ion-actor-roles']
        else:
            raise Inconsistent((self._process_name, self._op)% '%s(%s) has been denied since the ion-actor-roles can not be found in the message headers')

        if headers.has_key('resource-id'):
            self._resource_id = headers['resource-id']
        else:
            if resource_id_required:
                raise Inconsistent('%s(%s) has been denied since the resource-id can not be found in the message headers'% (self._process_name, self._op))
            self._resource_id = ''
dataset/ETHPy150Open ooici/pyon/pyon/core/governance/__init__.py/GovernanceHeaderValues.__init__/swapped operands of `%`