<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_array(self):
 """ Serializes this KeyboardButton to a dictionary. :return: dictionary representation of this object. :rtype: dict """

        array = super(KeyboardButton, self).to_array()
        array['text'] = u(self.text)  # py2: type unicode, py3: type str

        if self.request_contact is not None:
            array['request_contact'] = bool(self.request_contact)  # type bool
        if self.request_location is not None:
            array['request_location'] = bool(self.request_location)  # type bool
        return array