Add comment on ref for downtime

        :param ref: the host/service we want to link a comment to
        :type ref: alignak.objects.schedulingitem.SchedulingItem

        :return: None
422403
def add_automatic_comment(self, ref):
        
        if self.fixed is True:
            text = (DOWNTIME_FIXED_MESSAGE % (ref.my_type,
                                              time.strftime("%Y-%m-%d %H:%M:%S",
                                                            time.localtime(self.start_time)),
                                              time.strftime("%Y-%m-%d %H:%M:%S",
                                                            time.localtime(self.end_time)),
                                              ref.my_type))
        else:
            hours, remainder = divmod(self.duration, 3600)
            minutes, _ = divmod(remainder, 60)
            text = (DOWNTIME_FLEXIBLE_MESSAGE % (ref.my_type,
                                                 time.strftime("%Y-%m-%d %H:%M:%S",
                                                               time.localtime(self.start_time)),
                                                 time.strftime("%Y-%m-%d %H:%M:%S",
                                                               time.localtime(self.end_time)),
                                                 hours, minutes, ref.my_type))

        data = {
            'comment': text,
            'comment_type': 1 if ref.my_type == 'host' else 2,
            'entry_type': 2,
            'source': 0,
            'expires': False,
            'ref': ref.uuid
        }
        comment = Comment(data)
        self.comment_id = comment.uuid
        ref.comments[comment.uuid] = comment
        return comment
319664
def add_comment(self, line: str) -> None:
        ''' '''
        # the rule is like
        #
        # # comment line  --> add to last comment
        # blank line --> clears last comment
        # [ ] --> use last comment
        # parameter: --> use last comment
        # All others: clear last comment
        self._last_comment += (' ' if self._last_comment else '') + \
            line.lstrip('#').strip()
1297744
def addComment(self, comment):
        
        url = "%s/addComment" % self.root
        params = {
            "f" : "json",
            "comment" : comment
        }
        return self._post(url, params, proxy_port=self._proxy_port,
                             securityHandler=self._securityHandler,
                             proxy_url=self._proxy_url)
483977
def update_confirmation_comment(self, confirmation_comment_id, confirmation_comment_dict):
        
        return self._create_put_request(
            resource=CONFIRMATION_COMMENTS,
            billomat_id=confirmation_comment_id,
            send_data=confirmation_comment_dict
        )
6860
def write_reference(self, ref_index):
        
        self._writeStruct(
            ">BL", 1, (self.TC_REFERENCE, ref_index + self.BASE_REFERENCE_IDX)
        )
1072792
def comment(comment, opts = {})
      @context.lines << Lines::Comment.new(
        line_options(opts.merge(:comment => comment))
      )
    end
619581
public Resource addReference(Reference reference) {
		Resource resource = this.rdfWriter.getUri(Vocabulary.getReferenceUri(reference));

		this.referenceQueue.add(reference);
		this.referenceSubjectQueue.add(resource);

		return resource;
	}
755279
def get_comment(self, item):
        
        key = item.upper()
        if key not in self._record_map:
            raise KeyError("unknown record: %s" % key)

        if 'comment' not in self._record_map[key]:
            return None
        else:
            return self._record_map[key]['comment']
1198711
def _add_comments(self, comments, original_string=""):
        
        return comments and "{0}  # {1}".format(self._strip_comments(original_string)[0],
                                                "; ".join(comments)) or original_string
716732
def add_comment(self, topic_id, content, reply_id=None):
        
        return self.api.req(API_GROUP_ADD_COMMENT % topic_id, 'post', data={
            'ck': self.api.ck(),
            'ref_cid': reply_id,
            'rv_comment': content,
            'start': 0,
            'submit_btn': '加上去',
        })
925053
public int addRef(Object ref)
    {
        if (_refs == null)
            _refs = new ArrayList();

        _refs.add(ref);

        return _refs.size() - 1;
    }
447131
def update_credit_note_comment(self, credit_note_comment_id, credit_note_comment_dict):
        
        return self._create_put_request(
            resource=CREDIT_NOTE_COMMENTS,
            billomat_id=credit_note_comment_id,
            send_data=credit_note_comment_dict
        )
1010572
def put(self, context):
        
        LOG.debug('%r.put(%r)', self, context)
        self._lock.acquire()
        try:
            if self._refs_by_context.get(context, 0) == 0:
                LOG.warning('%r.put(%r): refcount was 0. shutdown_all called?',
                            self, context)
                return
            self._refs_by_context[context] -= 1
        finally:
            self._lock.release()
917054
def set_comment(self, comment = None):
        
        
        if comment is None or type(comment) is not str:
            raise KPError("Need a new image number")
        else:
            self.comment = comment
            self.last_mod = datetime.now().replace(microsecond=0)
            return True
268659
def add_comment(self, text):
        
        # pylint: disable=W0212
        response = self.reddit_session._add_comment(self.fullname, text)
        # pylint: enable=W0212
        self.reddit_session.evict(self._api_link)  # pylint: disable=W0212
        return response
439474
def add_reference(self, reftype: str, label: str, target):
        

        # The self.data[reftype] dict springs into being during the
        # register_references event handler at startup, which looks in the
        # kb registry for all registered reference names.
        self.data[reftype][label] = target
120073
def issue_add_comment(self, issue_key, comment, visibility=None):
        
        url = 'rest/api/2/issue/{issueIdOrKey}/comment'.format(issueIdOrKey=issue_key)
        data = {'body': comment}
        if visibility:
            data['visibility'] = visibility
        return self.post(url, data=data)