Get reviews for a given listing
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()
47442
def list_discounts(location_id, opts = {})
      data, _status_code, _headers = list_discounts_with_http_info(location_id, opts)
      return data
    end
975013
def get_review(self, id):
        
        assert isinstance(id, (int, long)), id
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/reviews/" + str(id),
        )
        return github.PullRequestReview.PullRequestReview(self._requester, headers, data, completed=True)
521355
def getBuyerInfo(self, auction_id, buyer_id):
        """"""
        # TODO: add price from getBids
        rc = self.__ask__('doGetPostBuyData', itemsArray=self.ArrayOfLong([auction_id]), buyerFilterArray=self.ArrayOfLong([buyer_id]))
        rc = rc[0]['usersPostBuyData']['item'][0]['userData']
        return {'allegro_aid': auction_id,
                'allegro_uid': rc['userId'],
                'allegro_login': magicDecode(rc['userLogin']),
                'name': magicDecode(rc['userFirstName']),
                'surname': magicDecode(rc['userLastName']),
                'company': magicDecode(rc['userCompany']),
                'postcode': magicDecode(rc['userPostcode']),
                'city': magicDecode(rc['userCity']),
                'address': magicDecode(rc['userAddress']),
                'email': magicDecode(rc['userEmail']),
                'phone': rc['userPhone']}
985371
def get_applicable_values(self):
        """"""
        return [v for v in self._values if v.is_active and not v.is_all_results]
165767
public List<Review> getMoviesReviews(int movieId, String reviewType, int pageLimit, int page, String country) throws RottenTomatoesException {
        properties.clear();
        properties.put(ApiBuilder.PROPERTY_ID, String.valueOf(movieId));
        properties.put(ApiBuilder.PROPERTY_URL, URL_MOVIES_REVIEWS);
        properties.put(ApiBuilder.PROPERTY_REVIEW_TYPE, reviewType);
        properties.put(ApiBuilder.PROPERTY_PAGE_LIMIT, ApiBuilder.validatePageLimit(pageLimit));
        properties.put(ApiBuilder.PROPERTY_PAGE, ApiBuilder.validatePage(page));
        properties.put(ApiBuilder.PROPERTY_COUNTRY, ApiBuilder.validateCountry(country));

        WrapperLists wrapper = response.getResponse(WrapperLists.class, properties);
        if (wrapper != null && wrapper.getReviews() != null) {
            return wrapper.getReviews();
        } else {
            return Collections.emptyList();
        }
    }
847618
def get_reviews(self):
        
        return github.PaginatedList.PaginatedList(
            github.PullRequestReview.PullRequestReview,
            self._requester,
            self.url + "/reviews",
            None,
        )
572715
public List<Review> getMoviesReviews(int movieId, String reviewType, String country) throws RottenTomatoesException {
        return getMoviesReviews(movieId, reviewType, DEFAULT_PAGE_LIMIT, DEFAULT_PAGE, country);
    }
1358686
def rating(self):
        
        if self._rating == '' and self.details != None and 'rating' in self.details:
            self._rating = self.details['rating']
        return self._rating
30894
function reviewsByHash(state = {}, action) {
  switch (action.type) {
    case REQUEST_REVIEWS:
      return {
        ...state,
        [action.hash]: {
          ...state[action.hash],
          isFetching: true,
          expires: 0,
        },
      };
    case RECEIVE_REVIEWS: {
      const reviews = state[action.hash].reviews || {};
      const nextReviews = action.reviews || [];

      /**
       * If there are no previous reviews and no incoming reviews
       * its set to empty array, otherwise it will be an array of the previous and the
       * new reviews. Duplicates are removed.
       */
      const stateReviews = (reviews || nextReviews.length) ? uniq([
        ...reviews,
        ...nextReviews.map(review => review.id),
      ]) : [];

      return {
        ...state,
        [action.hash]: {
          ...state[action.hash],
          reviews: stateReviews,
          totalReviewCount: action.totalReviewCount || null,
          isFetching: false,
          expires: Date.now() + REVIEWS_LIFETIME,
        },
      };
    }
    case ERROR_REVIEWS:
      return {
        ...state,
        [action.hash]: {
          ...state[action.hash],
          isFetching: false,
          expires: 0,
        },
      };
    default:
      return state;
  }
}
470047
public function ListingItems()
    {
        // need to get the items being listed
        $source = $this->getListingSource();

        $listType = $this->ListType ? $this->ListType : 'Page';

        $filter = array();

        $objFields = $this->getSelectableFields($listType);

        if ($source) {
            $ids = $this->getIdsFrom($source, 1);
            $ids[] = $source->ID;

            if (isset($objFields['ParentID']) && count($ids)) {
                $filter['ParentID'] = $ids;
            }
        }

        if ($this->StrictType) {
            $filter['ClassName'] = $listType;
        }

        $sortDir = $this->SortDir == 'Ascending' ? 'ASC' : 'DESC';
        $sort = $this->SortBy && isset($objFields[$this->SortBy]) ? $this->SortBy : 'Title';
        $req = Controller::has_curr() ? Controller::curr()->getRequest() : null;

        if (strlen($this->CustomSort) && $req) {
            $sortField = $req->getVar($this->CustomSort);
            if ($sortField) {
                $sort = isset($objFields[$sortField]) ? $sortField : $sort;
                $sortDir = $req->getVar($this->CustomSort . '_dir');
                $sortDir = $sortDir === 'asc' ? 'ASC' : 'DESC';
            }
        }

        // Bind these variables into the current page object because the
        // template may want to read them out after.
        //
        // - nyeholt 2017-12-19
        $this->CurrentSort = $sort;
        $this->CurrentDir = $sortDir;
        $this->CurrentSource = $source;
        $this->CurrentLink = $req ? $req->getURL() : $this->Link();

        // $sort = $this->CustomSort ? $this->CustomSort : $sort;
        $sort .= ' ' . $sortDir;

        $limit = '';

        $pageUrlVar = 'page' . $this->ID;

        $items = DataList::create($listType)->filter($filter)->sort($sort);

        if ($this->PerPage) {
            $page = isset($_REQUEST[$pageUrlVar]) ? (int) $_REQUEST[$pageUrlVar] : 0;
            $items  = $items->limit($this->PerPage, $page);
        }
        if ($this->ComponentFilterName) {
            $controller = (Controller::has_curr()) ? Controller::curr() : null;
            $tags = array();
            if ($controller && $controller instanceof ListingPageController) {
                $tagName = $controller->getRequest()->latestParam('Action');
                if ($tagName) {
                    $tags = $this->ComponentListingItems();
                    $tags = $tags->filter(array($this->ComponentFilterColumn => $tagName));
                    $tags = $tags->toArray();
                    if (!$tags) {
                        // Workaround cms/#1045
                        // - Stop infinite redirect
                        // @see: https://github.com/silverstripe/silverstripe-cms/issues/1045
                        unset($controller->extension_instances['OldPageRedirector']);

                        return $controller->httpError(404);
                    }
                }
            }

            if ($tags) {
                if (count($tags) > 1) {
                    return $controller->httpError(500, 'ComponentFilterColumn provided is not unique. ' . count($tags) . ' matches found in query.');
                }
                $tag = reset($tags);
                $tagComponent = DataObject::getSchema()->manyManyComponent($this->ListType, $this->ComponentFilterName);
                $parentClass = ClassInfo::shortName($tagComponent['parentClass']);
                $items = $items->innerJoin(
                    $tagComponent['join'],
                    "\"{$tagComponent['parentField']}\" = \"$parentClass\".\"ID\" AND \"{$tagComponent['childField']}\" = " . (int)$tag->ID
                );
            } else {
                $tags = new ArrayList();
            }
        }

        $this->extend('updateListingItems', $items);

        $newList = ArrayList::create();
        if ($items) {
            $newList = PaginatedList::create($items);
            // ensure the 0 limit is applied if configured as such
            $newList->setPageLength($this->PerPage);
            $newList->setPaginationGetVar($pageUrlVar);
            if ($items instanceof DataList) {
                $newList->setPaginationFromQuery($items->dataQuery()->query());
            }
        }

        return $newList;
    }
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
663220
public function getReviews()
    {
        $oReview = oxNew(\OxidEsales\Eshop\Application\Model\Review::class);
        $oRevs = $oReview->loadList('oxrecommlist', $this->getId());
        //if no review found, return null
        if ($oRevs->count() < 1) {
            return null;
        }

        return $oRevs;
    }
1334861
def get_ratings(self):
        """"""
        return Vote.objects.filter(content_type=self.get_content_type(), object_id=self.instance.pk, key=self.field.key)
842826
public function getReviews()
    {
        if ($this->_aReviews === null) {
            $this->_aReviews = false;
            if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadReviews')) {
                $this->_aReviews = $this->getProduct()->getReviews();
            }
        }

        return $this->_aReviews;
    }
1195933
def rating(self, value):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])
        request_data = {'rating': value}
        return self.tc_requests.update(
            self.api_type, self.api_sub_type, self.unique_id, request_data, owner=self.owner
        )
721443
def get_reviews(self, user_id):
    
    url = _REVIEWS_USER.format(c_api=_C_API_BEGINNING,
                                                api=_API_VERSION,
                                                user_id=user_id,
                                                at=self.access_token)
    return _get_request(url)