<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def restrict_chat_member(self, chat_id, user_id, until_date=None, can_send_messages=None, can_send_media_messages=None, can_send_other_messages=None, can_add_web_page_previews=None):
 """ Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user. Returns True on success. https://core.telegram.org/bots/api#restrictchatmember Parameters: :param chat_id: Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) :type chat_id: int | str|unicode :param user_id: Unique identifier of the target user :type user_id: int Optional keyword parameters: :param until_date: Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever :type until_date: int :param can_send_messages: Pass True, if the user can send text messages, contacts, locations and venues :type can_send_messages: bool :param can_send_media_messages: Pass True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages :type can_send_media_messages: bool :param can_send_other_messages: Pass True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages :type can_send_other_messages: bool :param can_add_web_page_previews: Pass True, if the user may add web page previews to their messages, implies can_send_media_messages :type can_add_web_page_previews: bool Returns: :return: Returns True on success :rtype: bool """

        assert_type_or_raise(chat_id, (int, unicode_type), parameter_name="chat_id")
        
        assert_type_or_raise(user_id, int, parameter_name="user_id")
        
        assert_type_or_raise(until_date, None, int, parameter_name="until_date")
        
        assert_type_or_raise(can_send_messages, None, bool, parameter_name="can_send_messages")
        
        assert_type_or_raise(can_send_media_messages, None, bool, parameter_name="can_send_media_messages")
        
        assert_type_or_raise(can_send_other_messages, None, bool, parameter_name="can_send_other_messages")
        
        assert_type_or_raise(can_add_web_page_previews, None, bool, parameter_name="can_add_web_page_previews")
        
        result = self.do("restrictChatMember", chat_id=chat_id, user_id=user_id, until_date=until_date, can_send_messages=can_send_messages, can_send_media_messages=can_send_media_messages, can_send_other_messages=can_send_other_messages, can_add_web_page_previews=can_add_web_page_previews)
        if self.return_python_objects:
            logger.debug("Trying to parse {data}".format(data=repr(result)))
            try:
                return from_array_list(bool, result, list_level=0, is_builtin=True)
            except TgApiParseException:
                logger.debug("Failed parsing as primitive bool", exc_info=True)
            # end try
            # no valid parsing so far
            raise TgApiParseException("Could not parse result.")  # See debug log for details!
        # end if return_python_objects
        return result