def rate(self, rating, **kwargs):
if rating not in (<NUM_LIT:0>, <NUM_LIT:1>):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>response = self._requester.request(<EOL>'<STR_LIT:POST>',<EOL>'<STR_LIT>'.format(<EOL>self._discussion_parent_type,<EOL>self._discussion_parent_id,<EOL>self.discussion_id,<EOL>self.id<EOL>),<EOL>rating=rating,<EOL>_kwargs=combine_kwargs(**kwargs)<EOL>)<EOL>return response.status_code == <NUM_LIT><EOL>
Rate this discussion entry.

:calls: `POST
    /api/v1/courses/:course_id/discussion_topics/:topic_id/entries/:entry_id/rating \
    <https://canvas.instructure.com/doc/api/discussion_topics.html#method.discussion_topics_api.rate_entry>`_

    or `POST
    /api/v1/groups/:group_id/discussion_topics/:topic_id/entries/:entry_id/rating \
    <https://canvas.instructure.com/doc/api/discussion_topics.html#method.discussion_topics_api.rate_entry>`_

:param rating: A rating to set on this entry. Only 0 and 1 are accepted.
:type rating: int
:rtype: bool