def set_credentials(self, credentials, security=None):
        """ Sets the credentials the actor operates under
            This will trigger an authentication of the credentials
            Optionally an authenticated Security instance can be supplied,
            to reduce the needed authentication processing.
        """
        _log.debug("actor.py: set_credentials: %s" % credentials)
        if credentials is None:
            return
        self.credentials = credentials
        if security:
            self.sec = security
        else:
            self.sec = Security()
            self.sec.set_principal(self.credentials)
            self.sec.authenticate_principal()
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/actor/actor.py/Actor.set_credentials/original