## Helper functions. 
### getFeedback

Returns the value of the feedback textarea or in `_feedback`

Must be invoked with right context

@return {string|null} The value of the feedback, if any
516605
function getFeedback() {
        var out;
        out = this.textareaElement ?
            this.textareaElement.value : this._feedback;
        return out ? out.trim() : out;
    }
336728
private function ParseFeedback($Feedback, $FeedbackList = ['RtnCode', 'RtnMsg'], $Separator = '|')
        {
            $Pieces = explode($Separator, $Feedback);
            $Feedback = [];
            // 回傳參數檢查
            if (count($Pieces) == count($FeedbackList)) {
                foreach ($FeedbackList as $Idx => $Name) {
                    $Feedback[$Name] = $Pieces[$Idx];
                }
            } else {
                $Feedback['ParseMsg'] = 'Unknown feedback : '.$Feedback;
            }

            return $Feedback;
        }
653501
function() {
      var result = new StringBuffer();
      var array = this._input.split('');
      // var prev = null;

      for (var i = 0; i < array.length; i++) {
        var cur = array[i];
        var next = array[i + 1];

        if (typeof next !== 'undefined') {
          var curToken = cur + next;

          if (this._mode.tokens.ia[curToken]) {
            var nextNext = array[i + 2];
            if (typeof nextNext === 'undefined' || /^[-\s]$/.test(nextNext)) {
              result.append(this._mode.tokens.ia[curToken]);
              i++;
              continue;
            }
          }
        }

        if (this._mode.cyr2lat[cur]) {
          result.append(this._mode.cyr2lat[cur]);
        } else {
          result.append(cur);
        }

        // prev = cur;
      }

      return result.toString();
    }
1341006
function feedbackEvtCallback( evt ) {
  log( "pong-feedback", "feedbackEvtCallback" )
  if ( evt && evt.text ) {
    log( "pong-feedback", "feedbackEvtCallback "+evt.text )
    if ( pongLastFeedbackTxt.indexOf( evt.text ) >= 0 ) {
      if ( evt.text.length > 0 ) {
        var feedbackTxt =  $.i18n( evt.text )
        var evtNo = pongLastFeedbackTxt.indexOf( feedbackTxt )
        pongLastFeedbackCnt[evtNo] = pongLastFeedbackCnt[evtNo] + 1
        pongLastFeedbackTim[evtNo] = new Date()
        moveToLastFeetback( evtNo )
      }
    } else {
      if ( evt.text.length > 0 ) {
        var feedbackTxt =  $.i18n( evt.text )
        
        pongLastFeedbackTxt.shift()
        pongLastFeedbackTxt.push( feedbackTxt )
        
        pongLastFeedbackCnt.shift()
        pongLastFeedbackCnt.push( 1 )

        pongLastFeedbackTim.shift()
        pongLastFeedbackTim.push( new Date() )
      }
    }
  } 
  updateFeedback()
}
907162
async function getHandoffFromUpdate (update) {
  if (!has(update, 'message.text')) {
    return
  }

  // having to do own request as watson-developer-cloud package is broken for
  // Tone analyzer
  const toneAnalyzerUrl = 'https://gateway.watsonplatform.net/tone-analyzer/api'

  const params = {
    // Get the text from the JSON file.
    text: update.message.text,
    tones: 'emotion',
    version: '2016-05-19'
  }

  const requestOptions = {
    url: `${toneAnalyzerUrl}/v3/tone`,
    method: 'GET',
    qs: params,
    auth: {
      username: TONE_ANALYSIS_USERNAME,
      password: TONE_ANALYSIS_PASSWORD
    },
    json: true
  }

  const tone = await request(requestOptions)

  if (has(tone, 'document_tone.tone_categories[0].tones')) {
    const sentiments = tone.document_tone.tone_categories[0].tones

    // return sentiment before
    const badSentimentThreshold = 0.7

    for (const sentiment of sentiments) {
      // not too sure about the ones other than anger for now tbh
      if (['Anger', 'Disgust', 'Fear', 'Sadness'].indexOf(sentiment.tone_name) > -1 &&
      sentiment.score > badSentimentThreshold) {
        return 'lowSentiment'
      }
    }
  }
}
1051684
def getWaitingFeedbacks(self):
        """"""
        # TODO: return sorted dictionary (negative/positive/neutral)
        feedbacks = []
        offset = 0
        amount = self.__ask__('doGetWaitingFeedbacksCount')
        while amount > 0:
            rc = self.__ask__('doGetWaitingFeedbacks',
                              offset=offset, packageSize=200)
            feedbacks.extend(rc['feWaitList'])
            amount -= 200
            offset += 1
        return feedbacks
960522
protected function getFeedbackSummaries() {
        if (!$this->_feedbackSummaries) {
            $this->_feedbackSummaries = new FeedbackSummaryList($this->version, $this->solution['accountSid']);
        }

        return $this->_feedbackSummaries;
    }
592605
def doFeedback(self, item_id, use_comment_template, buyer_id, comment, comment_type, op):
        """"""
        return self.__ask__('doFeedback',
                            feItemId=item_id,
                            feUseCommentTemplate=use_comment_template,
                            feToUserId=buyer_id,
                            feComment=comment,
                            feCommentType=comment_type,
                            feOp=op)['feedbackId']
1087839
private function getRecomText($content_area)
    {
        $text = $content_area->find('.borderClass', 0)->find('.spaceit_pad', 0)->plaintext;
        $useless_area = $content_area->find('.js-toggle-recommendation-button', 0) ? $content_area->find('.js-toggle-recommendation-button', 0)->plaintext : null;
        $text = str_replace($useless_area, '', $text);
        $text = str_replace('&lt;', '<', $text);
        $text = preg_replace('/\s{2,}/', "\n", $text);

        return $text;
    }
1090808
public function apnsFeedback() {

        $feedback_tokens = array();

        if (!$this->existCertificate()) {
            return $feedback_tokens;
        }

        //connect to the APNS feedback servers
        $ctx = $this->composeStreamSocket();

        // Open a connection to the APNS server
        try {
            $apns = stream_socket_client($this->feedbackUrl, $errcode, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);

            //Read the data on the connection:
            while (!feof($apns)) {
                $data = fread($apns, 38);
                if (strlen($data)) {
                    $feedback_tokens['apnsFeedback'][] = unpack("N1timestamp/n1length/H*devtoken", $data);
                }
            }
            fclose($apns);

        } catch (\Exception $e) {
            //if stream socket can't be established, try again
            if ($this->canRetry()) {
                return $this->apnsFeedback();
            }

            $response = [
                'success' => false,
                'error' => 'APNS feedback connection problem: ' . $e->getMessage() . PHP_EOL
            ];

            $this->setFeedback(json_decode(json_encode($response)));

        } finally {
            $this->resetAttempts();
            return $feedback_tokens;
        }
    }
643695
def get_feedback_from_submission(self, submission, only_feedback=False, show_everything=False, translation=gettext.NullTranslations()):
        
        if only_feedback:
            submission = {"text": submission.get("text", None), "problems": dict(submission.get("problems", {}))}
        if "text" in submission:
            submission["text"] = ParsableText(submission["text"], submission["response_type"], show_everything, translation).parse()
        if "problems" in submission:
            for problem in submission["problems"]:
                if isinstance(submission["problems"][problem], str):  # fallback for old-style submissions
                    submission["problems"][problem] = (submission.get('result', 'crash'), ParsableText(submission["problems"][problem],
                                                                                                       submission["response_type"],
                                                                                                       show_everything, translation).parse())
                else:  # new-style submission
                    submission["problems"][problem] = (submission["problems"][problem][0], ParsableText(submission["problems"][problem][1],
                                                                                                        submission["response_type"],
                                                                                                        show_everything, translation).parse())
        return submission
260509
function() {
      var obj = jsBox.Container.superclass.getConfig.call(this);
      obj.codeText = this.textarea.value;
      return obj;
   }
22264
protected function SaveElement()
    {
        $this->textarea->SetLabel($this->Value('Label'));
        $this->textarea->SetName($this->Value('Name'));
        $this->textarea->SetValue($this->Value('Value'));
        $this->textarea->SetPattern($this->Value('Pattern'));
        $this->textarea->SetMinLength((int)$this->Value('MinLength'));
        $this->textarea->SetMaxLength((int)$this->Value('MaxLength'));
        $this->textarea->SetRequired((bool)$this->Value('Required'));
        $this->textarea->SetDisableFrontendValidation((bool)$this->Value('DisableFrontendValidation'));
        return $this->textarea;
    }
1144173
def get_feedback(self, question_id):
        """"""
        response = self.get_response(question_id)
        item = self._get_item(response.get_item_id())
        if response.is_answered():
            try:
                return item.get_feedback_for_response(response)
            except errors.IllegalState:
                pass
        else:
            return item.get_feedback()
499186
function () {

        var $form = null, _id = null, $target = null;

        if ( this.getAttribute ) {
            _id = this.getAttribute('id');
            $target = this;
        } else if ( typeof(this.target) && this.target.getAttribute ) {
            _id = this.target.getAttribute('id');
            $target = this.target
        }

        if ( typeof(instance.$forms[_id]) == 'undefined') {
            throw new Error('[ FormValidator::submit() ] not `$form` binded. Use `FormValidator::getFormById(id)` or `FormValidator::validateFormById(id)` first ')
        }

        triggerEvent(gina, $target, 'submit');

        return this;
    }
1249508
public function getFeedback()
    {
        $client           = $this->getOpenedFeedbackClient();
        $responses        = [];
        $serviceResponses = $client->feedback();

        /** @var \ZendService\Apple\Apns\Response\Feedback $response */
        foreach ($serviceResponses as $response) {
            $responses[$response->getToken()] = new \DateTime(date('c', $response->getTime()));
        }

        return $responses;
    }
799478
func (h *Handle) GetQueryFeedback() []*statistics.QueryFeedback {
	defer func() {
		h.feedback = h.feedback[:0]
	}()
	return h.feedback
}