<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_array(array):
 """ Deserialize a new InlineQuery from a given dictionary. :return: new InlineQuery instance. :rtype: InlineQuery """

        if array is None or not array:
            return None
        # end if
        assert_type_or_raise(array, dict, parameter_name="array")
        from pytgbot.api_types.receivable.media import Location
        from pytgbot.api_types.receivable.peer import User

        data = {}
        data['id'] = u(array.get('id'))
        data['from_peer'] = User.from_array(array.get('from'))
        data['query'] = u(array.get('query'))
        data['offset'] = u(array.get('offset'))
        data['location'] = Location.from_array(array.get('location')) if array.get('location') is not None else None
        data['_raw'] = array
        return InlineQuery(**data)