POST /mnoe/jpi/v1/marketplace/:id/app_reviews
499634
def create
      # TODO: use the has_many associations -> @app.reviews.build
      @app_review = review_klass.new(review_params)
      if @app_review.save
        after_save
        render :show
      else
        render json: @app_review.errors, status: :bad_request
      end
    end
1099632
def get_rating(postid, userid):
        '''
        
        '''
        try:
            recs = TabRating.select().where(
                (TabRating.post_id == postid) & (TabRating.user_id == userid)
            )
        except:
            return False
        if recs.count() > 0:
            return recs.get().rating
        else:
            return False
2609
protected function submitAddReview()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('review');
        $this->addReview();
    }
750582
function reviewsById(state = {}, action) {
  switch (action.type) {
    case RECEIVE_PRODUCT_REVIEWS:
    case RECEIVE_REVIEWS: {
      const nextReviews = action.reviews || [];
      return nextReviews.reduce((currentReviews, review) => ({
        ...currentReviews,
        [review.id]: review,
      }), state);
    }
    case RECEIVE_SUBMIT_REVIEW:
    case RECEIVE_USER_REVIEW:
      return {
        ...state,
        [action.review.id]: action.review,
      };
    default:
      return state;
  }
}
18382
public static Review retrieve(String review, Map<String, Object> params, RequestOptions options)
      throws StripeException {
    String url =
        String.format(
            "%s%s",
            Stripe.getApiBase(), String.format("/v1/reviews/%s", ApiResource.urlEncodeId(review)));
    return request(ApiResource.RequestMethod.GET, url, params, Review.class, options);
  }
153371
def create
      @app_review = MnoEnterprise::AppAnswer.new(app_answer_params)

      if @app_review.save
        render :show
      else
        render json: @app_review.errors, status: :bad_request
      end
    end
279486
def user_has_reviewed(obj, user):
    """"""
    ctype = ContentType.objects.get_for_model(obj)
    try:
        models.Review.objects.get(user=user, content_type=ctype,
                                  object_id=obj.id)
    except models.Review.DoesNotExist:
        return False
    return True
587142
def start_review(self):
        """"""
        if self.set_status:
            self.github_repo.create_status(
                state="pending",
                description="Static analysis in progress.",
                context="inline-plz",
                sha=self.last_sha,
            )
1178764
def add(user_name, repo_name, reviewer_username, params={})
      update_and_validate_user_repo_params(user_name, repo_name)
      normalize! params

      put_request("/2.0/repositories/#{user_name}/#{repo_name}/default-reviewers/#{reviewer_username}", params)
    end
1338181
def __get_wiki_review(email_cnt, idx):
    '''
    
    '''
    recent_posts = MWiki.query_recent_edited(tools.timestamp() - TIME_LIMIT, kind='2')
    for recent_post in recent_posts:
        hist_rec = MWikiHist.get_last(recent_post.uid)
        if hist_rec:
            foo_str = '''
                    <tr><td>{0}</td><td>{1}</td><td class="diff_chg">Edit</td><td>{2}</td>
                    <td><a href="{3}">{3}</a></td></tr>
                    '''.format(idx, recent_post.user_name, recent_post.title,
                               os.path.join(SITE_CFG['site_url'], 'page', recent_post.uid))
            email_cnt = email_cnt + foo_str
        else:
            foo_str = '''
                    <tr><td>{0}</td><td>{1}</td><td class="diff_add">New </td><td>{2}</td>
                    <td><a href="{3}">{3}</a></td></tr>
                    '''.format(idx, recent_post.user_name, recent_post.title,
                               os.path.join(SITE_CFG['site_url'], 'page', recent_post.uid))
            email_cnt = email_cnt + foo_str
        idx = idx + 1
    email_cnt = email_cnt + '</table>'
    return email_cnt, idx
589864
def get_pr_review_status(pr: PullRequestDetails) -> Any:
    
    url = ("https://api.github.com/repos/{}/{}/pulls/{}/reviews"
           "?access_token={}".format(pr.repo.organization,
                                     pr.repo.name,
                                     pr.pull_id,
                                     pr.repo.access_token))
    response = requests.get(url)

    if response.status_code != 200:
        raise RuntimeError(
            'Get review failed. Code: {}. Content: {}.'.format(
                response.status_code, response.content))

    return json.JSONDecoder().decode(response.content.decode())
1373637
def get_review_id(self, id_):
    
    return _get_request(_REVIEW_ID.format(c_api=_C_API_BEGINNING,
                                                              api=_API_VERSION,
                                                              id_=id_,
                                                              at=self.access_token))
300480
def parse_reviews(self, reviews_page):
    
    user_info = self.parse_sidebar(reviews_page)
    second_col = reviews_page.find(u'div', {u'id': u'content'}).find(u'table').find(u'tr').find_all(u'td', recursive=False)[1]

    try:
      user_info[u'reviews'] = {}
      reviews = second_col.find_all(u'div', {u'class': u'borderDark'}, recursive=False)
      if reviews:
        for row in reviews:
          review_info = {}
          try:
            (meta_elt, review_elt) = row.find_all(u'div', recursive=False)[0:2]
          except ValueError:
            raise
          meta_rows = meta_elt.find_all(u'div', recursive=False)
          review_info[u'date'] = utilities.parse_profile_date(meta_rows[0].find(u'div').text)
          media_link = meta_rows[0].find(u'a')
          link_parts = media_link.get(u'href').split(u'/')
          # of the form /(anime|manga)/9760/Hoshi_wo_Ou_Kodomo
          media = getattr(self.session, link_parts[1])(int(link_parts[2])).set({u'title': media_link.text})

          helpfuls = meta_rows[1].find(u'span', recursive=False)
          helpful_match = re.match(r'(?P<people_helped>[0-9]+) of (?P<people_total>[0-9]+)', helpfuls.text).groupdict()
          review_info[u'people_helped'] = int(helpful_match[u'people_helped'])
          review_info[u'people_total'] = int(helpful_match[u'people_total'])

          consumption_match = re.match(r'(?P<media_consumed>[0-9]+) of (?P<media_total>[0-9?]+)', meta_rows[2].text).groupdict()
          review_info[u'media_consumed'] = int(consumption_match[u'media_consumed'])
          if consumption_match[u'media_total'] == u'?':
            review_info[u'media_total'] = None
          else:
            review_info[u'media_total'] = int(consumption_match[u'media_total'])

          review_info[u'rating'] = int(meta_rows[3].find(u'div').text.replace(u'Overall Rating: ', ''))

          for x in review_elt.find_all([u'div', 'a']):
            x.extract()
          review_info[u'text'] = review_elt.text.strip()
          user_info[u'reviews'][media] = review_info
    except:
      if not self.session.suppress_parse_exceptions:
        raise

    return user_info
497536
def get_reviews(self, listing_id, offset=0, limit=20):
        
        params = {
            '_order': 'language_country',
            'listing_id': str(listing_id),
            '_offset': str(offset),
            'role': 'all',
            '_limit': str(limit),
            '_format': 'for_mobile_client',
        }

        print(self._session.headers)

        r = self._session.get(API_URL + "/reviews", params=params)
        r.raise_for_status()

        return r.json()
1285316
def get_mini_reviews(recid, ln=CFG_SITE_LANG):
    
    if CFG_WEBCOMMENT_ALLOW_SHORT_REVIEWS:
        action = 'SUBMIT'
    else:
        action = 'DISPLAY'

    reviews = query_retrieve_comments_or_remarks(recid, ranking=1)

    return webcomment_templates.tmpl_mini_review(
        recid,
        ln,
        action=action,
        avg_score=calculate_avg_score(reviews),
        nb_comments_total=len(reviews))
1102517
def __get_post_review(email_cnt, idx):
    '''
    
    '''
    for key in router_post:
        recent_posts = MPost.query_recent_edited(tools.timestamp() - TIME_LIMIT, kind=key)
        for recent_post in recent_posts:
            hist_rec = MPostHist.get_last(recent_post.uid)
            if hist_rec:
                foo_str = '''
                    <tr><td>{0}</td><td>{1}</td><td class="diff_chg">Edit</td><td>{2}</td>
                    <td><a href="{3}">{3}</a></td></tr>
                    '''.format(idx, recent_post.user_name, recent_post.title,
                               os.path.join(SITE_CFG['site_url'], router_post[key],
                                            recent_post.uid))
                email_cnt = email_cnt + foo_str
            else:
                foo_str = '''
                    <tr><td>{0}</td><td>{1}</td><td class="diff_add">New </td><td>{2}</td>
                    <td><a href="{3}">{3}</a></td></tr>
                    '''.format(idx, recent_post.user_name, recent_post.title,
                               os.path.join(SITE_CFG['site_url'], router_post[key],
                                            recent_post.uid))
                email_cnt = email_cnt + foo_str
            idx = idx + 1

    return email_cnt, idx
584158
def recent_reviews(params = {})
      skip_cropped = params.delete(:skip_cropped) || false
      data = request("/review/recent_reviews", params)
      return unless data["reviews"] && data["reviews"].key?("review")
      reviews = data["reviews"]["review"].map { |r| Hashie::Mash.new(r) }
      reviews = reviews.select { |r| !r.body.include?(r.url) } if skip_cropped
      reviews
    end