Serializes this InlineQueryResultAudio to a dictionary.

        :return: dictionary representation of this object.
        :rtype: dict
13853
def to_array(self):
        
        array = super(InlineQueryResultAudio, self).to_array()
        # 'type' and 'id' given by superclass
        array['audio_url'] = u(self.audio_url)  # py2: type unicode, py3: type str
        array['title'] = u(self.title)  # py2: type unicode, py3: type str
        if self.caption is not None:
            array['caption'] = u(self.caption)  # py2: type unicode, py3: type str
        if self.parse_mode is not None:
            array['parse_mode'] = u(self.parse_mode)  # py2: type unicode, py3: type str
        if self.performer is not None:
            array['performer'] = u(self.performer)  # py2: type unicode, py3: type str
        if self.audio_duration is not None:
            array['audio_duration'] = int(self.audio_duration)  # type int
        if self.reply_markup is not None:
            array['reply_markup'] = self.reply_markup.to_array()  # type InlineKeyboardMarkup
        if self.input_message_content is not None:
            array['input_message_content'] = self.input_message_content.to_array()  # type InputMessageContent
        return array
1275192
def to_dict(self):
        
        d = {field: getattr(self, field) for field in self._top_fields if hasattr(self, field)}

        # set values of data fields
        d['data'] = {}
        for field in self._fields:
            if hasattr(self, field):
                # base64 encode the field for transmission if necessary
                if field in self._encode_fields:
                    val = getattr(self, field)
                    if val:
                        val = cast_s(base64.b64encode(cast_b(val)))
                    d['data'][field] = val
                else:
                    d['data'][field] = getattr(self, field)

        return d
850146
def as_dict(self):
        
        if self.has_omp:
            raise NotImplementedError('as_dict method of QueueAdapter not yet implemented when OpenMP is activated')
        return {'@module': self.__class__.__module__,
                '@class': self.__class__.__name__,
                'priority': self.priority,
                'hardware': self.hw.as_dict(),
                'queue': {'qtype': self.QTYPE,
                          'qname': self._qname,
                          'qnodes': self.qnodes,
                          'qparams': self._qparams},
                'limits': {'timelimit_hard': self._timelimit_hard,
                           'timelimit': self._timelimit,
                           'min_cores': self.min_cores,
                           'max_cores': self.max_cores,
                           'min_mem_per_proc': self.min_mem_per_proc,
                           'max_mem_per_proc': self.max_mem_per_proc,
                           'memory_policy': self.memory_policy
                           },
                'job': {},
                'mpi_procs': self._mpi_procs,
                'mem_per_proc': self._mem_per_proc,
                'master_mem_overhead': self._master_mem_overhead
                }
194615
def as_dict(self):
        
        d = MSONable.as_dict(self)
        d["data"] = self.data.tolist()
        return d
1342037
def to_array(self):
        
        array = super(InputMediaAudio, self).to_array()
        # 'type' given by superclass
        # 'media' given by superclass
        if self.thumb is not None:
            if isinstance(self.thumb, InputFile):
                array['thumb'] = None  # type InputFile
            elif isinstance(self.thumb, str):
                array['thumb'] = u(self.thumb)  # py2: type unicode, py3: type str
            else:
                raise TypeError('Unknown type, must be one of InputFile, str.')
            # end if
        # 'caption' given by superclass
        # 'parse_mode' given by superclass
        if self.duration is not None:
            array['duration'] = int(self.duration)  # type int
        if self.performer is not None:
            array['performer'] = u(self.performer)  # py2: type unicode, py3: type str
        if self.title is not None:
            array['title'] = u(self.title)  # py2: type unicode, py3: type str
        return array
1100202
def to_array(self):
        
        array = super(InlineQueryResultMpeg4Gif, self).to_array()
        array['type'] = u(self.type)  # py2: type unicode, py3: type str

        array['id'] = u(self.id)  # py2: type unicode, py3: type str

        array['mpeg4_url'] = u(self.mpeg4_url)  # py2: type unicode, py3: type str

        array['thumb_url'] = u(self.thumb_url)  # py2: type unicode, py3: type str

        if self.mpeg4_width is not None:
            array['mpeg4_width'] = int(self.mpeg4_width)  # type int
        if self.mpeg4_height is not None:
            array['mpeg4_height'] = int(self.mpeg4_height)  # type int
        if self.mpeg4_duration is not None:
            array['mpeg4_duration'] = int(self.mpeg4_duration)  # type int
        if self.title is not None:
            array['title'] = u(self.title)  # py2: type unicode, py3: type str

        if self.caption is not None:
            array['caption'] = u(self.caption)  # py2: type unicode, py3: type str

        if self.parse_mode is not None:
            array['parse_mode'] = u(self.parse_mode)  # py2: type unicode, py3: type str

        if self.reply_markup is not None:
            array['reply_markup'] = self.reply_markup.to_array()  # type InlineKeyboardMarkup

        if self.input_message_content is not None:
            array['input_message_content'] = self.input_message_content.to_array()  # type InputMessageContent

        return array
235119
def to_dict(self):
        
        data = {
            'url': self.url,
            'encodingRate': self.encoding_rate,
            'frameHeight': self.frame_height,
            'frameWidth': self.frame_width,
            'size': self.size,
            'remoteUrl': self.remote_url,
            'remoteStream': self.remote_stream_name,
            'videoDuration': self.video_duration,
            'videoCodec': self.video_codec}
        [data.pop(key) for key in data.keys() if data[key] is None]
        return data
48480
def to_dict(self):
        
        jdict = {
            'user': self.user,
            'summary': self.summary,
            'body': self.body,
            'markup': self.markup,
            'url': self.url,
            'timestamp': self.timestamp
            }
        return jdict
117164
def to_dict(self):
        
        data = {
            'id': self.id,
            'referenceId': self.reference_id,
            'type': self.type,
            'displayName': self.display_name,
            'remoteUrl': self.remote_url}
        for key in data.keys():
            if data[key] == None:
                data.pop(key)
        return data
745948
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'type') and self.type is not None:
            _dict['type'] = self.type
        if hasattr(self, 'codec') and self.codec is not None:
            _dict['codec'] = self.codec
        if hasattr(self, 'frequency') and self.frequency is not None:
            _dict['frequency'] = self.frequency
        if hasattr(self, 'compression') and self.compression is not None:
            _dict['compression'] = self.compression
        return _dict
57660
def as_dict(self):
        
        d = MSONable.as_dict(self)
        d["translation_vector"] = self.translation_vector.tolist()
        return d
1069070
def to_array(self):
        
        array = super(InlineQueryResultCachedPhoto, self).to_array()
        array['type'] = u(self.type)  # py2: type unicode, py3: type str

        array['id'] = u(self.id)  # py2: type unicode, py3: type str

        array['photo_file_id'] = u(self.photo_file_id)  # py2: type unicode, py3: type str

        if self.title is not None:
            array['title'] = u(self.title)  # py2: type unicode, py3: type str

        if self.description is not None:
            array['description'] = u(self.description)  # py2: type unicode, py3: type str

        if self.caption is not None:
            array['caption'] = u(self.caption)  # py2: type unicode, py3: type str

        if self.parse_mode is not None:
            array['parse_mode'] = u(self.parse_mode)  # py2: type unicode, py3: type str

        if self.reply_markup is not None:
            array['reply_markup'] = self.reply_markup.to_array()  # type InlineKeyboardMarkup

        if self.input_message_content is not None:
            array['input_message_content'] = self.input_message_content.to_array()  # type InputMessageContent

        return array
159320
def to_array(self):
        
        array = super(InlineQueryResultGif, self).to_array()
        # 'type' and 'id' given by superclass
        array['gif_url'] = u(self.gif_url)  # py2: type unicode, py3: type str
        array['thumb_url'] = u(self.thumb_url)  # py2: type unicode, py3: type str
        if self.gif_width is not None:
            array['gif_width'] = int(self.gif_width)  # type int
        if self.gif_height is not None:
            array['gif_height'] = int(self.gif_height)  # type int
        if self.gif_duration is not None:
            array['gif_duration'] = int(self.gif_duration)  # type int
        if self.title is not None:
            array['title'] = u(self.title)  # py2: type unicode, py3: type str
        if self.caption is not None:
            array['caption'] = u(self.caption)  # py2: type unicode, py3: type str
        if self.parse_mode is not None:
            array['parse_mode'] = u(self.parse_mode)  # py2: type unicode, py3: type str
        if self.reply_markup is not None:
            array['reply_markup'] = self.reply_markup.to_array()  # type InlineKeyboardMarkup
        if self.input_message_content is not None:
            array['input_message_content'] = self.input_message_content.to_array()  # type InputMessageContent
        return array
142071
def to_dict(self):
        
        obj_dict = super(PlainText, self).to_dict()
        child_dict = {
            'type': self.__class__.__name__,
            'text': self.text
        }
        obj_dict.update(child_dict)
        return obj_dict
657723
def to_dict(self):
        
        dyn_dict = {}
        for (key, val) in six.iteritems(self.__dict__):
            if key not in self._printable_exclude:
                dyn_dict[key] = val
        return dyn_dict
1369594
def to_dict(self):
        
        d = {}
        for word, idx in self.vocab.iteritems():
            d[word] = self.array[idx].tolist()
        return d
522033
def to_array(self):
        
        array = super(Audio, self).to_array()
        array['file_id'] = u(self.file_id)  # py2: type unicode, py3: type str

        array['duration'] = int(self.duration)  # type int
        if self.performer is not None:
            array['performer'] = u(self.performer)  # py2: type unicode, py3: type str

        if self.title is not None:
            array['title'] = u(self.title)  # py2: type unicode, py3: type str

        if self.mime_type is not None:
            array['mime_type'] = u(self.mime_type)  # py2: type unicode, py3: type str

        if self.file_size is not None:
            array['file_size'] = int(self.file_size)  # type int
        if self.thumb is not None:
            array['thumb'] = self.thumb.to_array()  # type PhotoSize

        return array