Gets the agent who created this comment.

        return: (osid.authentication.Agent) - the ``Agent``
        raise:  OperationFailed - unable to complete request
        *compliance: mandatory -- This method must be implemented.*
349019
def get_commenting_agent(self):
        
        if not self.has_commentor():
            raise errors.IllegalState('this Comment has no commenting_agent')
        try:
            from ..authentication import managers
        except ImportError:
            raise errors.OperationFailed('failed to import authentication.managers')
        try:
            mgr = managers.AuthenticationManager()
        except:
            raise errors.OperationFailed('failed to instantiate AuthenticationManager')
        if not mgr.supports_agent_lookup():
            raise errors.OperationFailed('Authentication does not support Agent lookup')
        try:
            osid_object = mgr.get_agent_lookup_session().get_agent(self.get_commenting_agent_id())
        except:
            raise errors.OperationFailed()
        else:
            return osid_object
528714
def comment_issue(self, issue_id, body):
        
        request_url = "{}issue/{}/comment".format(self.create_basic_url(),
                                                  issue_id)

        payload = {'comment': body}

        return_value = self._call_api(request_url,
                                      method='POST', data=payload)

        LOG.debug(return_value)
599537
def get_comment(self, id):
        """"""
        url = self._base_url + "/3/comment/{0}".format(id)
        json = self._send_request(url)
        return Comment(json, self)
361425
def call_agent_side(self, method, *args, **kwargs):
        '''
        
        '''
        assert not self._finalize_called, ("Attempt to call agent side code "
                                           "after finalize() method has been "
                                           "called. Method: %r" % (method, ))

        ensure_state = kwargs.pop('ensure_state', None)


        d = defer.Deferred(canceller=self._cancel_agent_side_call)
        self._agent_jobs.append(d)
        if ensure_state:
            # call method only if state check is checks in
            d.addCallback(
                lambda _: (self._ensure_state(ensure_state) and
                           method(*args, **kwargs)))
        else:
            d.addCallback(defer.drop_param, method, *args, **kwargs)
        d.addErrback(self._error_handler, method)
        d.addBoth(defer.bridge_param, self._remove_agent_job, d)
        time.call_next(d.callback, None)
        return d
840313
def agent_version(self):
        
        version = self.safe_data['agent-status']['version']
        if version:
            return client.Number.from_json(version)
        else:
            return None
900363
def itemComment(self, commentId):
        
        url = "%s/comments/%s" % (self.root, commentId)
        params = {
            "f": "json"
        }
        return self._get(url,
                            params,
                            securityHandler=self._securityHandler,
                            proxy_port=self._proxy_port,
                             proxy_url=self._proxy_url)
1290251
def Name(self):
        
        name = ""
        if self.Version:
            name = self.Version.UserAgent
        return name
913806
def getRejecter(self):
        
        wtool = getToolByName(self, 'portal_workflow')
        mtool = getToolByName(self, 'portal_membership')
        # noinspection PyBroadException
        try:
            review_history = wtool.getInfoFor(self, 'review_history')
        except:  # noqa FIXME: remove blind except!
            return None
        for items in review_history:
            action = items.get('action')
            if action != 'reject':
                continue
            actor = items.get('actor')
            return mtool.getMemberById(actor)
        return None
1027050
def get_create_agent(agent_kwargs):
  

  def create_agent(sess, environment, summary_writer=None):
    """Creates a DQN agent.

    Simplified version of `dopamine.discrete_domains.train.create_agent`

    Args:
      sess: a session
      environment: an environment
      summary_writer: a summary writer.

    Returns:
      a DQN agent.
    """
    return BatchDQNAgent(
        env_batch_size=environment.batch_size,
        sess=sess,
        num_actions=environment.action_space.n,
        summary_writer=summary_writer,
        tf_device="/gpu:*",
        **agent_kwargs)

  return create_agent
166347
def replyToComment(self, repo_user, repo_name, pull_number,
                       body, in_reply_to):
        
        return self.api.makeRequest(
            ["repos", repo_user, repo_name,
             "pulls", str(pull_number), "comments"],
            method="POST",
            data=dict(body=body,
                      in_reply_to=in_reply_to))
417391
def verify(self):
        
        if self._verify is None:
            from twilio.rest.verify import Verify
            self._verify = Verify(self)
        return self._verify
161984
def get_instance_state_agent_command(opts)
      result = RightScale::InstanceState.value
      CommandIO.instance.reply(opts[:conn], JSON.dump({ :result => result }) )
    rescue Exception => e
      CommandIO.instance.reply(opts[:conn], JSON.dump({ :error => e.message }) )
    end
626662
def check_user_can_send_comments(user_info, recid):
    
    # First can we find an authorization for this case, action + collection
    record_primary_collection = guess_primary_collection_of_a_record(recid)
    return acc_authorize_action(
        user_info,
        'sendcomment',
        authorized_if_no_roles=True,
        collection=record_primary_collection)
107286
def failedToGetPerspective(self, why, broker):
        
        log.msg("ReconnectingPBClientFactory.failedToGetPerspective")
        # put something useful in the logs
        if why.check(pb.PBConnectionLost):
            log.msg("we lost the brand-new connection")
            # fall through
        elif why.check(error.UnauthorizedLogin):
            log.msg("unauthorized login; check worker name and password")
            # fall through
        else:
            log.err(why, 'While trying to connect:')
            reactor.stop()
            return

        # lose the current connection, which will trigger a retry
        broker.transport.loseConnection()
777615
def get_votes_comment(self, *args, **kwargs):
        
        return bind_api(
            api=self,
            path='/comments/{commentId}/votes',
            payload_type='vote',
            payload_list=True,
            allowed_param=['commentId']
        )(*args, **kwargs)
1163491
def comments(self, issue):
        
        commit = self.as_id(issue)
        return self.get_list(url='%s/%s/comments' % (self, commit))
916260
def request_log_level(agent_name, command, options)
      res = false
      config_options = AgentConfig.agent_options(agent_name)
      unless config_options.empty? || (listen_port = config_options[:listen_port]).nil?
        fail("Could not retrieve #{agent_name} agent listen port") unless listen_port
        client = CommandClient.new(listen_port, config_options[:cookie])
        begin
          client.send_command(command, options[:verbose], timeout = 5) do |level|
            puts "Agent #{agent_name} log level: #{level.to_s.upcase}"
          end
          res = true
        rescue Exception => e
          puts "Command #{command.inspect} to #{agent_name} agent failed (#{e})"
        end
      end
      res
    end