Deserialize a new InlineKeyboardButton from a given dictionary.

        :return: new InlineKeyboardButton instance.
        :rtype: InlineKeyboardButton
421405
def from_array(array):
        
        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.updates import CallbackGame
        

        data = {}
        data['text'] = u(array.get('text'))
        data['url'] = u(array.get('url')) if array.get('url') is not None else None
        data['callback_data'] = u(array.get('callback_data')) if array.get('callback_data') is not None else None
        data['switch_inline_query'] = u(array.get('switch_inline_query')) if array.get('switch_inline_query') is not None else None
        data['switch_inline_query_current_chat'] = u(array.get('switch_inline_query_current_chat')) if array.get('switch_inline_query_current_chat') is not None else None
        data['callback_game'] = CallbackGame.from_array(array.get('callback_game')) if array.get('callback_game') is not None else None
        data['pay'] = bool(array.get('pay')) if array.get('pay') is not None else None
        
        instance = InlineKeyboardButton(**data)
        instance._raw = array
        return instance
193536
def to_python(self) -> typing.Dict:
        
        self.clean()
        result = {}
        for name, value in self.values.items():
            if name in self.props:
                value = self.props[name].export(self)
            if isinstance(value, TelegramObject):
                value = value.to_python()
            if isinstance(value, LazyProxy):
                value = str(value)
            result[self.props_aliases.get(name, name)] = value
        return result
191522
def from_dict(cls, ctx):
        ''
        ctx = Context(ctx)
        s = cls()
        ContextFlags = ctx['ContextFlags']
        s.ContextFlags = ContextFlags
        for key in cls._others:
            if key != 'VectorRegister':
                setattr(s, key, ctx[key])
            else:
                w = ctx[key]
                v = (M128A * len(w))()
                i = 0
                for x in w:
                    y = M128A()
                    y.High = x >> 64
                    y.Low = x - (x >> 64)
                    v[i] = y
                    i += 1
                setattr(s, key, v)
        if (ContextFlags & CONTEXT_CONTROL) == CONTEXT_CONTROL:
            for key in cls._control:
                setattr(s, key, ctx[key])
        if (ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER:
            for key in cls._integer:
                setattr(s, key, ctx[key])
        if (ContextFlags & CONTEXT_SEGMENTS) == CONTEXT_SEGMENTS:
            for key in cls._segments:
                setattr(s, key, ctx[key])
        if (ContextFlags & CONTEXT_DEBUG_REGISTERS) == CONTEXT_DEBUG_REGISTERS:
            for key in cls._debug:
                setattr(s, key, ctx[key])
        if (ContextFlags & CONTEXT_MMX_REGISTERS) == CONTEXT_MMX_REGISTERS:
            xmm = s.FltSave.xmm
            for key in cls._mmx:
                y = M128A()
                y.High = x >> 64
                y.Low = x - (x >> 64)
                setattr(xmm, key, y)
        return s
61544
def bind(self, **kwargs):
        '''
        
        '''
        d = dict(self.__dict__)
        for k in d.keys():
            if k[0] == '_':
                del d[k]
            elif k.startswith('obj_'):
                d[k] = d[k].bind(**kwargs)
        d.update(kwargs)
        return self.__class__(**d)
1138209
def _deserialize_dict(data, boxed_type):
    
    return {k: _deserialize(v, boxed_type)
            for k, v in six.iteritems(data)}
1155925
def _from_dict(cls, mapping):
        
        if mapping.get("all"):
            return cls(all_=True)

        r_mappings = mapping.get("ranges", ())
        ranges = [KeyRange(**r_mapping) for r_mapping in r_mappings]

        return cls(keys=mapping.get("keys", ()), ranges=ranges)
429299
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'input' in _dict:
            args['input'] = MessageInput._from_dict(_dict.get('input'))
        if 'intents' in _dict:
            args['intents'] = [
                RuntimeIntent._from_dict(x) for x in (_dict.get('intents'))
            ]
        if 'entities' in _dict:
            args['entities'] = [
                RuntimeEntity._from_dict(x) for x in (_dict.get('entities'))
            ]
        if 'alternate_intents' in _dict:
            args['alternate_intents'] = _dict.get('alternate_intents')
        if 'context' in _dict:
            args['context'] = Context._from_dict(_dict.get('context'))
        if 'output' in _dict:
            args['output'] = OutputData._from_dict(_dict.get('output'))
        if 'actions' in _dict:
            args['actions'] = [
                DialogNodeAction._from_dict(x) for x in (_dict.get('actions'))
            ]
        return cls(**args)
43610
def from_dictionary(cls, dictionary):
        """"""
        if not isinstance(dictionary, dict):
            raise TypeError('dictionary has to be a dict type, got: {}'.format(type(dictionary)))

        return cls(dictionary)
446585
public InlineKeyboardMarkup toKeyboard() {
        InlineKeyboardMarkup.InlineKeyboardMarkupBuilder builder =
                InlineKeyboardMarkup.builder();

        if (rows.isEmpty()) {
            return null;
        }

        rows.stream().map(InlineMenuRow::toButtons).forEach(builder::addRow);
        return builder.build();
    }
661809
def to_dict(self):
        
        plain_dict = dict()
        for k, v in self.items():
            if self.__fields__[k].is_list:
                if isinstance(self.__fields__[k], ViewModelField):
                    plain_dict[k] = tuple(vt.to_dict() for vt in v)
                    continue

                plain_dict[k] = tuple(copy.deepcopy(vt) for vt in v)
                continue

            if isinstance(self.__fields__[k], ViewModelField):
                plain_dict[k] = v.to_dict()
                continue

            plain_dict[k] = copy.deepcopy(v)

        return plain_dict
10481
public List<InlineKeyboardButton> toButtons() {
        return buttons.stream()
                .map(InlineMenuButton::toKeyboardButton)
                .collect(Collectors.toList());
    }
69754
def deserialize(self, xml_input, *args, **kwargs):
        
        return xmltodict.parse(xml_input, *args, **kwargs)
913351
def to_array(self):
        
        array = super(InlineKeyboardButton, self).to_array()
        array['text'] = u(self.text)  # py2: type unicode, py3: type str

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

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

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

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

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

        if self.pay is not None:
            array['pay'] = bool(self.pay)  # type bool
        return array
1118114
def serializable_dict(d):
    
    newd = {}
    for k in d.keys():
        if isinstance(d[k], type({})):
            newd[k] = serializable_dict(d[k])
            continue
        try:
            json.dumps({'k': d[k]})
            newd[k] = d[k]
        except:
            pass  # unserializable
    return newd
507688
def deserialize(self, obj=None, ignore_non_existing=False):
    
    if not isinstance(obj, dict):
      if ignore_non_existing:
        return

      raise TypeError("Wrong data '{}' passed for '{}' deserialization".format(obj, self.__class__.__name__))

    definitions = {k: v for k, v in self.__class__.__dict__.items() if k[:1] != "_"}
    def_property_keys = set(definitions.keys())
    property_keys = set(obj.keys())

    existing_keys = def_property_keys & property_keys
    non_defined_keys = property_keys - def_property_keys
    non_existing_keys = def_property_keys - property_keys

    if not ignore_non_existing and non_defined_keys:
      raise TypeError(self.__class__.__name__ + " doesn't contain properties: {}".format(", ".join(non_defined_keys)))

    for k in existing_keys:
      v = obj[k]
      attr_type = definitions[k]

      try:
        if isinstance(attr_type, list) and self._isclass(attr_type[0], BaseView):
          if isinstance(v, list):
            obj_list = [attr_type[0](serialized_obj=v_item, ignore_non_existing=ignore_non_existing) for v_item in v]
          else:
            obj_list = [attr_type[0](serialized_obj=v, ignore_non_existing=ignore_non_existing)]

          self.__setattr__(k, obj_list)
        elif self._isclass(attr_type, BaseView):
          self.__setattr__(k, attr_type(v))
        else:
          self.__setattr__(k, v)
      except IndexError:
        self.__setattr__(k, v)  # check test_empty_view_deserialization test suite for test-case

    for k in non_existing_keys:
      attr_type = definitions[k]

      if attr_type is None:
        self.__setattr__(k, None)
      elif isinstance(attr_type, (list, set, tuple, dict)) and len(attr_type) == 0:
        self.__setattr__(k, attr_type.__class__())
      elif isinstance(attr_type, (list, set, tuple)) and self._isclass(attr_type[0], BaseView):
        self.__setattr__(k, attr_type.__class__())
      else:
        self.__setattr__(k, attr_type.__class__(attr_type))

    return self
178822
def FromDictionary(cls, dictionary):
    
    if 'user_id' in dictionary:
      raise errors.GitkitClientError('use localId instead')
    if 'localId' not in dictionary:
      raise errors.GitkitClientError('must specify localId')
    if 'email' not in dictionary:
      raise errors.GitkitClientError('must specify email')

    return cls(decode=False, **dictionary)
889342
def to_json(self):
        
        json_dict = {'keyboard': self.keyboard}
        if self.one_time_keyboard:
            json_dict['one_time_keyboard'] = True

        if self.resize_keyboard:
            json_dict['resize_keyboard'] = True

        if self.selective:
            json_dict['selective'] = True

        return json.dumps(json_dict)