repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
delph-in/pydelphin | delphin/mrs/xmrs.py | Mrs.to_dict | def to_dict(self, short_pred=True, properties=True):
"""
Encode the Mrs as a dictionary suitable for JSON serialization.
"""
def _lnk(obj): return {'from': obj.cfrom, 'to': obj.cto}
def _ep(ep, short_pred=True):
p = ep.pred.short_form() if short_pred else ep.pred.stri... | python | def to_dict(self, short_pred=True, properties=True):
"""
Encode the Mrs as a dictionary suitable for JSON serialization.
"""
def _lnk(obj): return {'from': obj.cfrom, 'to': obj.cto}
def _ep(ep, short_pred=True):
p = ep.pred.short_form() if short_pred else ep.pred.stri... | [
"def",
"to_dict",
"(",
"self",
",",
"short_pred",
"=",
"True",
",",
"properties",
"=",
"True",
")",
":",
"def",
"_lnk",
"(",
"obj",
")",
":",
"return",
"{",
"'from'",
":",
"obj",
".",
"cfrom",
",",
"'to'",
":",
"obj",
".",
"cto",
"}",
"def",
"_ep... | Encode the Mrs as a dictionary suitable for JSON serialization. | [
"Encode",
"the",
"Mrs",
"as",
"a",
"dictionary",
"suitable",
"for",
"JSON",
"serialization",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/xmrs.py#L783-L813 |
delph-in/pydelphin | delphin/mrs/xmrs.py | Mrs.from_dict | def from_dict(cls, d):
"""
Decode a dictionary, as from :meth:`to_dict`, into an Mrs object.
"""
def _lnk(o):
return None if o is None else Lnk.charspan(o['from'], o['to'])
def _ep(ep):
return ElementaryPredication(
nodeid=None,
... | python | def from_dict(cls, d):
"""
Decode a dictionary, as from :meth:`to_dict`, into an Mrs object.
"""
def _lnk(o):
return None if o is None else Lnk.charspan(o['from'], o['to'])
def _ep(ep):
return ElementaryPredication(
nodeid=None,
... | [
"def",
"from_dict",
"(",
"cls",
",",
"d",
")",
":",
"def",
"_lnk",
"(",
"o",
")",
":",
"return",
"None",
"if",
"o",
"is",
"None",
"else",
"Lnk",
".",
"charspan",
"(",
"o",
"[",
"'from'",
"]",
",",
"o",
"[",
"'to'",
"]",
")",
"def",
"_ep",
"("... | Decode a dictionary, as from :meth:`to_dict`, into an Mrs object. | [
"Decode",
"a",
"dictionary",
"as",
"from",
":",
"meth",
":",
"to_dict",
"into",
"an",
"Mrs",
"object",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/xmrs.py#L816-L850 |
delph-in/pydelphin | delphin/mrs/xmrs.py | Dmrs.to_dict | def to_dict(self, short_pred=True, properties=True):
"""
Encode the Dmrs as a dictionary suitable for JSON serialization.
"""
qs = set(self.nodeids(quantifier=True))
def _lnk(obj): return {'from': obj.cfrom, 'to': obj.cto}
def _node(node, short_pred=True):
p =... | python | def to_dict(self, short_pred=True, properties=True):
"""
Encode the Dmrs as a dictionary suitable for JSON serialization.
"""
qs = set(self.nodeids(quantifier=True))
def _lnk(obj): return {'from': obj.cfrom, 'to': obj.cto}
def _node(node, short_pred=True):
p =... | [
"def",
"to_dict",
"(",
"self",
",",
"short_pred",
"=",
"True",
",",
"properties",
"=",
"True",
")",
":",
"qs",
"=",
"set",
"(",
"self",
".",
"nodeids",
"(",
"quantifier",
"=",
"True",
")",
")",
"def",
"_lnk",
"(",
"obj",
")",
":",
"return",
"{",
... | Encode the Dmrs as a dictionary suitable for JSON serialization. | [
"Encode",
"the",
"Dmrs",
"as",
"a",
"dictionary",
"suitable",
"for",
"JSON",
"serialization",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/xmrs.py#L1011-L1049 |
delph-in/pydelphin | delphin/mrs/xmrs.py | Dmrs.from_dict | def from_dict(cls, d):
"""
Decode a dictionary, as from :meth:`to_dict`, into a Dmrs object.
"""
def _node(obj):
return Node(
obj.get('nodeid'),
Pred.surface_or_abstract(obj.get('predicate')),
sortinfo=obj.get('sortinfo'),
... | python | def from_dict(cls, d):
"""
Decode a dictionary, as from :meth:`to_dict`, into a Dmrs object.
"""
def _node(obj):
return Node(
obj.get('nodeid'),
Pred.surface_or_abstract(obj.get('predicate')),
sortinfo=obj.get('sortinfo'),
... | [
"def",
"from_dict",
"(",
"cls",
",",
"d",
")",
":",
"def",
"_node",
"(",
"obj",
")",
":",
"return",
"Node",
"(",
"obj",
".",
"get",
"(",
"'nodeid'",
")",
",",
"Pred",
".",
"surface_or_abstract",
"(",
"obj",
".",
"get",
"(",
"'predicate'",
")",
")",... | Decode a dictionary, as from :meth:`to_dict`, into a Dmrs object. | [
"Decode",
"a",
"dictionary",
"as",
"from",
":",
"meth",
":",
"to_dict",
"into",
"a",
"Dmrs",
"object",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/xmrs.py#L1052-L1077 |
delph-in/pydelphin | delphin/mrs/xmrs.py | Dmrs.to_triples | def to_triples(self, short_pred=True, properties=True):
"""
Encode the Dmrs as triples suitable for PENMAN serialization.
"""
ts = []
qs = set(self.nodeids(quantifier=True))
for n in nodes(self):
pred = n.pred.short_form() if short_pred else n.pred.string
... | python | def to_triples(self, short_pred=True, properties=True):
"""
Encode the Dmrs as triples suitable for PENMAN serialization.
"""
ts = []
qs = set(self.nodeids(quantifier=True))
for n in nodes(self):
pred = n.pred.short_form() if short_pred else n.pred.string
... | [
"def",
"to_triples",
"(",
"self",
",",
"short_pred",
"=",
"True",
",",
"properties",
"=",
"True",
")",
":",
"ts",
"=",
"[",
"]",
"qs",
"=",
"set",
"(",
"self",
".",
"nodeids",
"(",
"quantifier",
"=",
"True",
")",
")",
"for",
"n",
"in",
"nodes",
"... | Encode the Dmrs as triples suitable for PENMAN serialization. | [
"Encode",
"the",
"Dmrs",
"as",
"triples",
"suitable",
"for",
"PENMAN",
"serialization",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/xmrs.py#L1079-L1102 |
delph-in/pydelphin | delphin/mrs/xmrs.py | Dmrs.from_triples | def from_triples(cls, triples, remap_nodeids=True):
"""
Decode triples, as from :meth:`to_triples`, into a Dmrs object.
"""
top_nid = str(LTOP_NODEID)
top = lnk = surface = identifier = None
nids, nd, edges = [], {}, []
for src, rel, tgt in triples:
sr... | python | def from_triples(cls, triples, remap_nodeids=True):
"""
Decode triples, as from :meth:`to_triples`, into a Dmrs object.
"""
top_nid = str(LTOP_NODEID)
top = lnk = surface = identifier = None
nids, nd, edges = [], {}, []
for src, rel, tgt in triples:
sr... | [
"def",
"from_triples",
"(",
"cls",
",",
"triples",
",",
"remap_nodeids",
"=",
"True",
")",
":",
"top_nid",
"=",
"str",
"(",
"LTOP_NODEID",
")",
"top",
"=",
"lnk",
"=",
"surface",
"=",
"identifier",
"=",
"None",
"nids",
",",
"nd",
",",
"edges",
"=",
"... | Decode triples, as from :meth:`to_triples`, into a Dmrs object. | [
"Decode",
"triples",
"as",
"from",
":",
"meth",
":",
"to_triples",
"into",
"a",
"Dmrs",
"object",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/xmrs.py#L1105-L1158 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | Invoice.to_array | def to_array(self):
"""
Serializes this Invoice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Invoice, self).to_array()
array['title'] = u(self.title) # py2: type unicode, py3: type str
array['descript... | python | def to_array(self):
"""
Serializes this Invoice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Invoice, self).to_array()
array['title'] = u(self.title) # py2: type unicode, py3: type str
array['descript... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Invoice",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'title'",
"]",
"=",
"u",
"(",
"self",
".",
"title",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
"'... | Serializes this Invoice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Invoice",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L88-L101 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | ShippingAddress.to_array | def to_array(self):
"""
Serializes this ShippingAddress to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ShippingAddress, self).to_array()
array['country_code'] = u(self.country_code) # py2: type unicode, py3: ty... | python | def to_array(self):
"""
Serializes this ShippingAddress to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ShippingAddress, self).to_array()
array['country_code'] = u(self.country_code) # py2: type unicode, py3: ty... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"ShippingAddress",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'country_code'",
"]",
"=",
"u",
"(",
"self",
".",
"country_code",
")",
"# py2: type unicode, py3: type str",
... | Serializes this ShippingAddress to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"ShippingAddress",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L243-L257 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | OrderInfo.to_array | def to_array(self):
"""
Serializes this OrderInfo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(OrderInfo, self).to_array()
if self.name is not None:
array['name'] = u(self.name) # py2: type unicod... | python | def to_array(self):
"""
Serializes this OrderInfo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(OrderInfo, self).to_array()
if self.name is not None:
array['name'] = u(self.name) # py2: type unicod... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"OrderInfo",
",",
"self",
")",
".",
"to_array",
"(",
")",
"if",
"self",
".",
"name",
"is",
"not",
"None",
":",
"array",
"[",
"'name'",
"]",
"=",
"u",
"(",
"self",
".",
"name",
... | Serializes this OrderInfo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"OrderInfo",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L377-L393 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | OrderInfo.from_array | def from_array(array):
"""
Deserialize a new OrderInfo from a given dictionary.
:return: new OrderInfo instance.
:rtype: OrderInfo
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array"... | python | def from_array(array):
"""
Deserialize a new OrderInfo from a given dictionary.
:return: new OrderInfo instance.
:rtype: OrderInfo
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array"... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new OrderInfo from a given dictionary.
:return: new OrderInfo instance.
:rtype: OrderInfo | [
"Deserialize",
"a",
"new",
"OrderInfo",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L397-L415 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | SuccessfulPayment.to_array | def to_array(self):
"""
Serializes this SuccessfulPayment to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(SuccessfulPayment, self).to_array()
array['currency'] = u(self.currency) # py2: type unicode, py3: type s... | python | def to_array(self):
"""
Serializes this SuccessfulPayment to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(SuccessfulPayment, self).to_array()
array['currency'] = u(self.currency) # py2: type unicode, py3: type s... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"SuccessfulPayment",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'currency'",
"]",
"=",
"u",
"(",
"self",
".",
"currency",
")",
"# py2: type unicode, py3: type str",
"arr... | Serializes this SuccessfulPayment to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"SuccessfulPayment",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L544-L561 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | SuccessfulPayment.from_array | def from_array(array):
"""
Deserialize a new SuccessfulPayment from a given dictionary.
:return: new SuccessfulPayment instance.
:rtype: SuccessfulPayment
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict... | python | def from_array(array):
"""
Deserialize a new SuccessfulPayment from a given dictionary.
:return: new SuccessfulPayment instance.
:rtype: SuccessfulPayment
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new SuccessfulPayment from a given dictionary.
:return: new SuccessfulPayment instance.
:rtype: SuccessfulPayment | [
"Deserialize",
"a",
"new",
"SuccessfulPayment",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L565-L586 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | ShippingQuery.to_array | def to_array(self):
"""
Serializes this ShippingQuery to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ShippingQuery, self).to_array()
array['id'] = u(self.id) # py2: type unicode, py3: type str
array['fr... | python | def to_array(self):
"""
Serializes this ShippingQuery to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ShippingQuery, self).to_array()
array['id'] = u(self.id) # py2: type unicode, py3: type str
array['fr... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"ShippingQuery",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'id'",
"]",
"=",
"u",
"(",
"self",
".",
"id",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
"'... | Serializes this ShippingQuery to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"ShippingQuery",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L689-L701 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | ShippingQuery.from_array | def from_array(array):
"""
Deserialize a new ShippingQuery from a given dictionary.
:return: new ShippingQuery instance.
:rtype: ShippingQuery
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_... | python | def from_array(array):
"""
Deserialize a new ShippingQuery from a given dictionary.
:return: new ShippingQuery instance.
:rtype: ShippingQuery
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_... | [
"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... | Deserialize a new ShippingQuery from a given dictionary.
:return: new ShippingQuery instance.
:rtype: ShippingQuery | [
"Deserialize",
"a",
"new",
"ShippingQuery",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L705-L724 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | PreCheckoutQuery.to_array | def to_array(self):
"""
Serializes this PreCheckoutQuery to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PreCheckoutQuery, self).to_array()
array['id'] = u(self.id) # py2: type unicode, py3: type str
arr... | python | def to_array(self):
"""
Serializes this PreCheckoutQuery to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PreCheckoutQuery, self).to_array()
array['id'] = u(self.id) # py2: type unicode, py3: type str
arr... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"PreCheckoutQuery",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'id'",
"]",
"=",
"u",
"(",
"self",
".",
"id",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
... | Serializes this PreCheckoutQuery to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"PreCheckoutQuery",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L854-L871 |
luckydonald/pytgbot | pytgbot/api_types/receivable/payments.py | PreCheckoutQuery.from_array | def from_array(array):
"""
Deserialize a new PreCheckoutQuery from a given dictionary.
:return: new PreCheckoutQuery instance.
:rtype: PreCheckoutQuery
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, p... | python | def from_array(array):
"""
Deserialize a new PreCheckoutQuery from a given dictionary.
:return: new PreCheckoutQuery instance.
:rtype: PreCheckoutQuery
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, p... | [
"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... | Deserialize a new PreCheckoutQuery from a given dictionary.
:return: new PreCheckoutQuery instance.
:rtype: PreCheckoutQuery | [
"Deserialize",
"a",
"new",
"PreCheckoutQuery",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/payments.py#L875-L897 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/input_media.py | InputMediaPhoto.to_array | def to_array(self):
"""
Serializes this InputMediaPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaPhoto, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | python | def to_array(self):
"""
Serializes this InputMediaPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaPhoto, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InputMediaPhoto",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array",
"["... | Serializes this InputMediaPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InputMediaPhoto",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/input_media.py#L72-L90 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/input_media.py | InputMediaAnimation.to_array | def to_array(self):
"""
Serializes this InputMediaAnimation to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaAnimation, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | python | def to_array(self):
"""
Serializes this InputMediaAnimation to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaAnimation, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InputMediaAnimation",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array",
... | Serializes this InputMediaAnimation to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InputMediaAnimation",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/input_media.py#L457-L490 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/input_media.py | InputMediaAudio.to_array | def to_array(self):
"""
Serializes this InputMediaAudio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaAudio, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | python | def to_array(self):
"""
Serializes this InputMediaAudio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaAudio, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InputMediaAudio",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array",
"["... | Serializes this InputMediaAudio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InputMediaAudio",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/input_media.py#L658-L693 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/input_media.py | InputMediaDocument.to_array | def to_array(self):
"""
Serializes this InputMediaDocument to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaDocument, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | python | def to_array(self):
"""
Serializes this InputMediaDocument to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InputMediaDocument, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InputMediaDocument",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array",
... | Serializes this InputMediaDocument to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InputMediaDocument",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/input_media.py#L834-L861 |
delph-in/pydelphin | delphin/mrs/prolog.py | dump | def dump(destination, ms, single=False, pretty_print=False, **kwargs):
"""
Serialize Xmrs objects to the Prolog representation and write to a file.
Args:
destination: filename or file object where data will be written
ms: an iterator of Xmrs objects to serialize (unless the
*sin... | python | def dump(destination, ms, single=False, pretty_print=False, **kwargs):
"""
Serialize Xmrs objects to the Prolog representation and write to a file.
Args:
destination: filename or file object where data will be written
ms: an iterator of Xmrs objects to serialize (unless the
*sin... | [
"def",
"dump",
"(",
"destination",
",",
"ms",
",",
"single",
"=",
"False",
",",
"pretty_print",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"text",
"=",
"dumps",
"(",
"ms",
",",
"single",
"=",
"single",
",",
"pretty_print",
"=",
"pretty_print",
... | Serialize Xmrs objects to the Prolog representation and write to a file.
Args:
destination: filename or file object where data will be written
ms: an iterator of Xmrs objects to serialize (unless the
*single* option is `True`)
single: if `True`, treat *ms* as a single Xmrs objec... | [
"Serialize",
"Xmrs",
"objects",
"to",
"the",
"Prolog",
"representation",
"and",
"write",
"to",
"a",
"file",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/prolog.py#L32-L53 |
delph-in/pydelphin | delphin/mrs/prolog.py | dumps | def dumps(ms, single=False, pretty_print=False, **kwargs):
"""
Serialize an Xmrs object to the Prolog representation
Args:
ms: an iterator of Xmrs objects to serialize (unless the
*single* option is `True`)
single: if `True`, treat *ms* as a single Xmrs object instead
... | python | def dumps(ms, single=False, pretty_print=False, **kwargs):
"""
Serialize an Xmrs object to the Prolog representation
Args:
ms: an iterator of Xmrs objects to serialize (unless the
*single* option is `True`)
single: if `True`, treat *ms* as a single Xmrs object instead
... | [
"def",
"dumps",
"(",
"ms",
",",
"single",
"=",
"False",
",",
"pretty_print",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"single",
":",
"ms",
"=",
"[",
"ms",
"]",
"return",
"serialize",
"(",
"ms",
",",
"pretty_print",
"=",
"pretty_print",
... | Serialize an Xmrs object to the Prolog representation
Args:
ms: an iterator of Xmrs objects to serialize (unless the
*single* option is `True`)
single: if `True`, treat *ms* as a single Xmrs object instead
of as an iterator
pretty_print: if `True`, add newlines and i... | [
"Serialize",
"an",
"Xmrs",
"object",
"to",
"the",
"Prolog",
"representation"
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/prolog.py#L56-L71 |
delph-in/pydelphin | delphin/mrs/vpm.py | load | def load(source, semi=None):
"""
Read a variable-property mapping from *source* and return the VPM.
Args:
source: a filename or file-like object containing the VPM
definitions
semi (:class:`~delphin.mrs.semi.SemI`, optional): if provided,
it is passed to the VPM cons... | python | def load(source, semi=None):
"""
Read a variable-property mapping from *source* and return the VPM.
Args:
source: a filename or file-like object containing the VPM
definitions
semi (:class:`~delphin.mrs.semi.SemI`, optional): if provided,
it is passed to the VPM cons... | [
"def",
"load",
"(",
"source",
",",
"semi",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"source",
",",
"'read'",
")",
":",
"return",
"_load",
"(",
"source",
",",
"semi",
")",
"else",
":",
"with",
"open",
"(",
"source",
",",
"'r'",
")",
"as",
"fh"... | Read a variable-property mapping from *source* and return the VPM.
Args:
source: a filename or file-like object containing the VPM
definitions
semi (:class:`~delphin.mrs.semi.SemI`, optional): if provided,
it is passed to the VPM constructor
Returns:
a :class:`VP... | [
"Read",
"a",
"variable",
"-",
"property",
"mapping",
"from",
"*",
"source",
"*",
"and",
"return",
"the",
"VPM",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/vpm.py#L25-L41 |
delph-in/pydelphin | delphin/mrs/vpm.py | _valmatch | def _valmatch(vs, ss, op, varsort, semi, section):
"""
Return `True` if for every paired *v* and *s* from *vs* and *ss*:
v <> s (subsumption or equality if *semi* is `None`)
v == s (equality)
s == '*'
s == '!' and v == `None`
s == '[xyz]' and varsort == 'xyz'
"""
... | python | def _valmatch(vs, ss, op, varsort, semi, section):
"""
Return `True` if for every paired *v* and *s* from *vs* and *ss*:
v <> s (subsumption or equality if *semi* is `None`)
v == s (equality)
s == '*'
s == '!' and v == `None`
s == '[xyz]' and varsort == 'xyz'
"""
... | [
"def",
"_valmatch",
"(",
"vs",
",",
"ss",
",",
"op",
",",
"varsort",
",",
"semi",
",",
"section",
")",
":",
"if",
"op",
"in",
"_EQUAL_OPS",
"or",
"semi",
"is",
"None",
":",
"return",
"all",
"(",
"s",
"==",
"v",
"or",
"# value equality",
"(",
"s",
... | Return `True` if for every paired *v* and *s* from *vs* and *ss*:
v <> s (subsumption or equality if *semi* is `None`)
v == s (equality)
s == '*'
s == '!' and v == `None`
s == '[xyz]' and varsort == 'xyz' | [
"Return",
"True",
"if",
"for",
"every",
"paired",
"*",
"v",
"*",
"and",
"*",
"s",
"*",
"from",
"*",
"vs",
"*",
"and",
"*",
"ss",
"*",
":",
"v",
"<",
">",
"s",
"(",
"subsumption",
"or",
"equality",
"if",
"*",
"semi",
"*",
"is",
"None",
")",
"v... | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/vpm.py#L151-L173 |
delph-in/pydelphin | delphin/mrs/vpm.py | VPM.apply | def apply(self, var, props, reverse=False):
"""
Apply the VPM to variable *var* and properties *props*.
Args:
var: a variable
props: a dictionary mapping properties to values
reverse: if `True`, apply the rules in reverse (e.g. from
grammar-ex... | python | def apply(self, var, props, reverse=False):
"""
Apply the VPM to variable *var* and properties *props*.
Args:
var: a variable
props: a dictionary mapping properties to values
reverse: if `True`, apply the rules in reverse (e.g. from
grammar-ex... | [
"def",
"apply",
"(",
"self",
",",
"var",
",",
"props",
",",
"reverse",
"=",
"False",
")",
":",
"vs",
",",
"vid",
"=",
"sort_vid_split",
"(",
"var",
")",
"if",
"reverse",
":",
"# variable type mapping is disabled in reverse",
"# tms = [(b, op, a) for a, op, b in se... | Apply the VPM to variable *var* and properties *props*.
Args:
var: a variable
props: a dictionary mapping properties to values
reverse: if `True`, apply the rules in reverse (e.g. from
grammar-external to grammar-internal forms)
Returns:
a... | [
"Apply",
"the",
"VPM",
"to",
"variable",
"*",
"var",
"*",
"and",
"properties",
"*",
"props",
"*",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/vpm.py#L102-L148 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/payments.py | OrderInfo.from_array | def from_array(array):
"""
Deserialize a new OrderInfo from a given dictionary.
:return: new OrderInfo instance.
:rtype: OrderInfo
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array"... | python | def from_array(array):
"""
Deserialize a new OrderInfo from a given dictionary.
:return: new OrderInfo instance.
:rtype: OrderInfo
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array"... | [
"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... | Deserialize a new OrderInfo from a given dictionary.
:return: new OrderInfo instance.
:rtype: OrderInfo | [
"Deserialize",
"a",
"new",
"OrderInfo",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/payments.py#L411-L431 |
delph-in/pydelphin | delphin/commands.py | convert | def convert(path, source_fmt, target_fmt, select='result:mrs',
properties=True, show_status=False, predicate_modifiers=False,
color=False, pretty_print=False, indent=None):
"""
Convert between various DELPH-IN Semantics representations.
Args:
path (str, file): filename, test... | python | def convert(path, source_fmt, target_fmt, select='result:mrs',
properties=True, show_status=False, predicate_modifiers=False,
color=False, pretty_print=False, indent=None):
"""
Convert between various DELPH-IN Semantics representations.
Args:
path (str, file): filename, test... | [
"def",
"convert",
"(",
"path",
",",
"source_fmt",
",",
"target_fmt",
",",
"select",
"=",
"'result:mrs'",
",",
"properties",
"=",
"True",
",",
"show_status",
"=",
"False",
",",
"predicate_modifiers",
"=",
"False",
",",
"color",
"=",
"False",
",",
"pretty_prin... | Convert between various DELPH-IN Semantics representations.
Args:
path (str, file): filename, testsuite directory, open file, or
stream of input representations
source_fmt (str): convert from this format
target_fmt (str): convert to this format
select (str): TSQL query f... | [
"Convert",
"between",
"various",
"DELPH",
"-",
"IN",
"Semantics",
"representations",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/commands.py#L29-L127 |
delph-in/pydelphin | delphin/commands.py | select | def select(dataspec, testsuite, mode='list', cast=True):
"""
Select data from [incr tsdb()] profiles.
Args:
query (str): TSQL select query (e.g., `'i-id i-input mrs'` or
`'* from item where readings > 0'`)
testsuite (str, TestSuite): testsuite or path to testsuite
co... | python | def select(dataspec, testsuite, mode='list', cast=True):
"""
Select data from [incr tsdb()] profiles.
Args:
query (str): TSQL select query (e.g., `'i-id i-input mrs'` or
`'* from item where readings > 0'`)
testsuite (str, TestSuite): testsuite or path to testsuite
co... | [
"def",
"select",
"(",
"dataspec",
",",
"testsuite",
",",
"mode",
"=",
"'list'",
",",
"cast",
"=",
"True",
")",
":",
"if",
"isinstance",
"(",
"testsuite",
",",
"itsdb",
".",
"ItsdbProfile",
")",
":",
"testsuite",
"=",
"itsdb",
".",
"TestSuite",
"(",
"te... | Select data from [incr tsdb()] profiles.
Args:
query (str): TSQL select query (e.g., `'i-id i-input mrs'` or
`'* from item where readings > 0'`)
testsuite (str, TestSuite): testsuite or path to testsuite
containing data to select
mode (str): see :func:`delphin.itsdb.... | [
"Select",
"data",
"from",
"[",
"incr",
"tsdb",
"()",
"]",
"profiles",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/commands.py#L298-L318 |
delph-in/pydelphin | delphin/commands.py | mkprof | def mkprof(destination, source=None, relations=None, where=None,
in_place=False, skeleton=False, full=False, gzip=False):
"""
Create [incr tsdb()] profiles or skeletons.
Data for the testsuite may come from an existing testsuite or from
a list of sentences. There are four main usage patterns... | python | def mkprof(destination, source=None, relations=None, where=None,
in_place=False, skeleton=False, full=False, gzip=False):
"""
Create [incr tsdb()] profiles or skeletons.
Data for the testsuite may come from an existing testsuite or from
a list of sentences. There are four main usage patterns... | [
"def",
"mkprof",
"(",
"destination",
",",
"source",
"=",
"None",
",",
"relations",
"=",
"None",
",",
"where",
"=",
"None",
",",
"in_place",
"=",
"False",
",",
"skeleton",
"=",
"False",
",",
"full",
"=",
"False",
",",
"gzip",
"=",
"False",
")",
":",
... | Create [incr tsdb()] profiles or skeletons.
Data for the testsuite may come from an existing testsuite or from
a list of sentences. There are four main usage patterns:
- `source="testsuite/"` -- read data from `testsuite/`
- `source=None, in_place=True` -- read data from *destination*
... | [
"Create",
"[",
"incr",
"tsdb",
"()",
"]",
"profiles",
"or",
"skeletons",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/commands.py#L324-L422 |
delph-in/pydelphin | delphin/commands.py | process | def process(grammar, testsuite, source=None, select=None,
generate=False, transfer=False, options=None,
all_items=False, result_id=None, gzip=False):
"""
Process (e.g., parse) a [incr tsdb()] profile.
Results are written to directly to *testsuite*.
If *select* is `None`, the de... | python | def process(grammar, testsuite, source=None, select=None,
generate=False, transfer=False, options=None,
all_items=False, result_id=None, gzip=False):
"""
Process (e.g., parse) a [incr tsdb()] profile.
Results are written to directly to *testsuite*.
If *select* is `None`, the de... | [
"def",
"process",
"(",
"grammar",
",",
"testsuite",
",",
"source",
"=",
"None",
",",
"select",
"=",
"None",
",",
"generate",
"=",
"False",
",",
"transfer",
"=",
"False",
",",
"options",
"=",
"None",
",",
"all_items",
"=",
"False",
",",
"result_id",
"="... | Process (e.g., parse) a [incr tsdb()] profile.
Results are written to directly to *testsuite*.
If *select* is `None`, the defaults depend on the task:
========== =========================
Task Default value of *select*
========== =========================
Parsing ... | [
"Process",
"(",
"e",
".",
"g",
".",
"parse",
")",
"a",
"[",
"incr",
"tsdb",
"()",
"]",
"profile",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/commands.py#L448-L518 |
delph-in/pydelphin | delphin/commands.py | repp | def repp(file, config=None, module=None, active=None,
format=None, trace_level=0):
"""
Tokenize with a Regular Expression PreProcessor (REPP).
Results are printed directly to stdout. If more programmatic
access is desired, the :mod:`delphin.repp` module provides a
similar interface.
A... | python | def repp(file, config=None, module=None, active=None,
format=None, trace_level=0):
"""
Tokenize with a Regular Expression PreProcessor (REPP).
Results are printed directly to stdout. If more programmatic
access is desired, the :mod:`delphin.repp` module provides a
similar interface.
A... | [
"def",
"repp",
"(",
"file",
",",
"config",
"=",
"None",
",",
"module",
"=",
"None",
",",
"active",
"=",
"None",
",",
"format",
"=",
"None",
",",
"trace_level",
"=",
"0",
")",
":",
"from",
"delphin",
".",
"repp",
"import",
"REPP",
"if",
"config",
"i... | Tokenize with a Regular Expression PreProcessor (REPP).
Results are printed directly to stdout. If more programmatic
access is desired, the :mod:`delphin.repp` module provides a
similar interface.
Args:
file (str, file): filename, open file, or stream of sentence
inputs
con... | [
"Tokenize",
"with",
"a",
"Regular",
"Expression",
"PreProcessor",
"(",
"REPP",
")",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/commands.py#L544-L587 |
delph-in/pydelphin | delphin/commands.py | compare | def compare(testsuite, gold, select='i-id i-input mrs'):
"""
Compare two [incr tsdb()] profiles.
Args:
testsuite (str, TestSuite): path to the test [incr tsdb()]
testsuite or a :class:`TestSuite` object
gold (str, TestSuite): path to the gold [incr tsdb()]
testsuite ... | python | def compare(testsuite, gold, select='i-id i-input mrs'):
"""
Compare two [incr tsdb()] profiles.
Args:
testsuite (str, TestSuite): path to the test [incr tsdb()]
testsuite or a :class:`TestSuite` object
gold (str, TestSuite): path to the gold [incr tsdb()]
testsuite ... | [
"def",
"compare",
"(",
"testsuite",
",",
"gold",
",",
"select",
"=",
"'i-id i-input mrs'",
")",
":",
"from",
"delphin",
".",
"mrs",
"import",
"simplemrs",
",",
"compare",
"as",
"mrs_compare",
"if",
"not",
"isinstance",
"(",
"testsuite",
",",
"itsdb",
".",
... | Compare two [incr tsdb()] profiles.
Args:
testsuite (str, TestSuite): path to the test [incr tsdb()]
testsuite or a :class:`TestSuite` object
gold (str, TestSuite): path to the gold [incr tsdb()]
testsuite or a :class:`TestSuite` object
select: TSQL query to select (... | [
"Compare",
"two",
"[",
"incr",
"tsdb",
"()",
"]",
"profiles",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/commands.py#L625-L678 |
delph-in/pydelphin | delphin/mrs/eds.py | non_argument_modifiers | def non_argument_modifiers(role='ARG1', only_connecting=True):
"""
Return a function that finds non-argument modifier dependencies.
Args:
role (str): the role that is assigned to the dependency
only_connecting (bool): if `True`, only return dependencies
that connect separate com... | python | def non_argument_modifiers(role='ARG1', only_connecting=True):
"""
Return a function that finds non-argument modifier dependencies.
Args:
role (str): the role that is assigned to the dependency
only_connecting (bool): if `True`, only return dependencies
that connect separate com... | [
"def",
"non_argument_modifiers",
"(",
"role",
"=",
"'ARG1'",
",",
"only_connecting",
"=",
"True",
")",
":",
"def",
"func",
"(",
"xmrs",
",",
"deps",
")",
":",
"edges",
"=",
"[",
"]",
"for",
"src",
"in",
"deps",
":",
"for",
"_",
",",
"tgt",
"in",
"d... | Return a function that finds non-argument modifier dependencies.
Args:
role (str): the role that is assigned to the dependency
only_connecting (bool): if `True`, only return dependencies
that connect separate components in the basic dependencies;
if `False`, all non-argument... | [
"Return",
"a",
"function",
"that",
"finds",
"non",
"-",
"argument",
"modifier",
"dependencies",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L277-L332 |
delph-in/pydelphin | delphin/mrs/eds.py | load | def load(fh, single=False):
"""
Deserialize :class:`Eds` from a file (handle or filename)
Args:
fh (str, file): input filename or file object
single (bool): if `True`, only return the first Xmrs object
Returns:
a generator of :class:`Eds` objects (unless the *single* option
... | python | def load(fh, single=False):
"""
Deserialize :class:`Eds` from a file (handle or filename)
Args:
fh (str, file): input filename or file object
single (bool): if `True`, only return the first Xmrs object
Returns:
a generator of :class:`Eds` objects (unless the *single* option
... | [
"def",
"load",
"(",
"fh",
",",
"single",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"fh",
",",
"stringtypes",
")",
":",
"s",
"=",
"open",
"(",
"fh",
",",
"'r'",
")",
".",
"read",
"(",
")",
"else",
":",
"s",
"=",
"fh",
".",
"read",
"(",
... | Deserialize :class:`Eds` from a file (handle or filename)
Args:
fh (str, file): input filename or file object
single (bool): if `True`, only return the first Xmrs object
Returns:
a generator of :class:`Eds` objects (unless the *single* option
is `True`) | [
"Deserialize",
":",
"class",
":",
"Eds",
"from",
"a",
"file",
"(",
"handle",
"or",
"filename",
")"
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L370-L385 |
delph-in/pydelphin | delphin/mrs/eds.py | loads | def loads(s, single=False):
"""
Deserialize :class:`Eds` string representations
Args:
s (str): Eds string
single (bool): if `True`, only return the first Xmrs object
Returns:
a generator of :class:`Eds` objects (unless the *single* option
is `True`)
"""
es = dese... | python | def loads(s, single=False):
"""
Deserialize :class:`Eds` string representations
Args:
s (str): Eds string
single (bool): if `True`, only return the first Xmrs object
Returns:
a generator of :class:`Eds` objects (unless the *single* option
is `True`)
"""
es = dese... | [
"def",
"loads",
"(",
"s",
",",
"single",
"=",
"False",
")",
":",
"es",
"=",
"deserialize",
"(",
"s",
")",
"if",
"single",
":",
"return",
"next",
"(",
"es",
")",
"return",
"es"
] | Deserialize :class:`Eds` string representations
Args:
s (str): Eds string
single (bool): if `True`, only return the first Xmrs object
Returns:
a generator of :class:`Eds` objects (unless the *single* option
is `True`) | [
"Deserialize",
":",
"class",
":",
"Eds",
"string",
"representations"
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L388-L402 |
delph-in/pydelphin | delphin/mrs/eds.py | dumps | def dumps(ms, single=False,
properties=False, pretty_print=True,
show_status=False, predicate_modifiers=False, **kwargs):
"""
Serialize an Xmrs object to a Eds representation
Args:
ms: an iterator of :class:`~delphin.mrs.xmrs.Xmrs` objects to
serialize (unless the *s... | python | def dumps(ms, single=False,
properties=False, pretty_print=True,
show_status=False, predicate_modifiers=False, **kwargs):
"""
Serialize an Xmrs object to a Eds representation
Args:
ms: an iterator of :class:`~delphin.mrs.xmrs.Xmrs` objects to
serialize (unless the *s... | [
"def",
"dumps",
"(",
"ms",
",",
"single",
"=",
"False",
",",
"properties",
"=",
"False",
",",
"pretty_print",
"=",
"True",
",",
"show_status",
"=",
"False",
",",
"predicate_modifiers",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"pret... | Serialize an Xmrs object to a Eds representation
Args:
ms: an iterator of :class:`~delphin.mrs.xmrs.Xmrs` objects to
serialize (unless the *single* option is `True`)
single (bool): if `True`, treat *ms* as a single
:class:`~delphin.mrs.xmrs.Xmrs` object instead of as an
... | [
"Serialize",
"an",
"Xmrs",
"object",
"to",
"a",
"Eds",
"representation"
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L438-L468 |
delph-in/pydelphin | delphin/mrs/eds.py | Eds.from_xmrs | def from_xmrs(cls, xmrs, predicate_modifiers=False, **kwargs):
"""
Instantiate an Eds from an Xmrs (lossy conversion).
Args:
xmrs (:class:`~delphin.mrs.xmrs.Xmrs`): Xmrs instance to
convert from
predicate_modifiers (function, bool): function that is
... | python | def from_xmrs(cls, xmrs, predicate_modifiers=False, **kwargs):
"""
Instantiate an Eds from an Xmrs (lossy conversion).
Args:
xmrs (:class:`~delphin.mrs.xmrs.Xmrs`): Xmrs instance to
convert from
predicate_modifiers (function, bool): function that is
... | [
"def",
"from_xmrs",
"(",
"cls",
",",
"xmrs",
",",
"predicate_modifiers",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"eps",
"=",
"xmrs",
".",
"eps",
"(",
")",
"deps",
"=",
"_find_basic_dependencies",
"(",
"xmrs",
",",
"eps",
")",
"# if requested, fi... | Instantiate an Eds from an Xmrs (lossy conversion).
Args:
xmrs (:class:`~delphin.mrs.xmrs.Xmrs`): Xmrs instance to
convert from
predicate_modifiers (function, bool): function that is
called as `func(xmrs, deps)` after finding the basic
dep... | [
"Instantiate",
"an",
"Eds",
"from",
"an",
"Xmrs",
"(",
"lossy",
"conversion",
")",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L67-L110 |
delph-in/pydelphin | delphin/mrs/eds.py | Eds.nodes | def nodes(self):
"""Return the list of nodes."""
getnode = self._nodes.__getitem__
return [getnode(nid) for nid in self._nodeids] | python | def nodes(self):
"""Return the list of nodes."""
getnode = self._nodes.__getitem__
return [getnode(nid) for nid in self._nodeids] | [
"def",
"nodes",
"(",
"self",
")",
":",
"getnode",
"=",
"self",
".",
"_nodes",
".",
"__getitem__",
"return",
"[",
"getnode",
"(",
"nid",
")",
"for",
"nid",
"in",
"self",
".",
"_nodeids",
"]"
] | Return the list of nodes. | [
"Return",
"the",
"list",
"of",
"nodes",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L129-L132 |
delph-in/pydelphin | delphin/mrs/eds.py | Eds.to_dict | def to_dict(self, properties=True):
"""
Encode the Eds as a dictionary suitable for JSON serialization.
"""
nodes = {}
for node in self.nodes():
nd = {
'label': node.pred.short_form(),
'edges': self.edges(node.nodeid)
}
... | python | def to_dict(self, properties=True):
"""
Encode the Eds as a dictionary suitable for JSON serialization.
"""
nodes = {}
for node in self.nodes():
nd = {
'label': node.pred.short_form(),
'edges': self.edges(node.nodeid)
}
... | [
"def",
"to_dict",
"(",
"self",
",",
"properties",
"=",
"True",
")",
":",
"nodes",
"=",
"{",
"}",
"for",
"node",
"in",
"self",
".",
"nodes",
"(",
")",
":",
"nd",
"=",
"{",
"'label'",
":",
"node",
".",
"pred",
".",
"short_form",
"(",
")",
",",
"'... | Encode the Eds as a dictionary suitable for JSON serialization. | [
"Encode",
"the",
"Eds",
"as",
"a",
"dictionary",
"suitable",
"for",
"JSON",
"serialization",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L138-L159 |
delph-in/pydelphin | delphin/mrs/eds.py | Eds.from_dict | def from_dict(cls, d):
"""
Decode a dictionary, as from :meth:`to_dict`, into an Eds object.
"""
makepred, charspan = Pred.surface_or_abstract, Lnk.charspan
top = d.get('top')
nodes, edges = [], []
for nid, node in d.get('nodes', {}).items():
props = n... | python | def from_dict(cls, d):
"""
Decode a dictionary, as from :meth:`to_dict`, into an Eds object.
"""
makepred, charspan = Pred.surface_or_abstract, Lnk.charspan
top = d.get('top')
nodes, edges = [], []
for nid, node in d.get('nodes', {}).items():
props = n... | [
"def",
"from_dict",
"(",
"cls",
",",
"d",
")",
":",
"makepred",
",",
"charspan",
"=",
"Pred",
".",
"surface_or_abstract",
",",
"Lnk",
".",
"charspan",
"top",
"=",
"d",
".",
"get",
"(",
"'top'",
")",
"nodes",
",",
"edges",
"=",
"[",
"]",
",",
"[",
... | Decode a dictionary, as from :meth:`to_dict`, into an Eds object. | [
"Decode",
"a",
"dictionary",
"as",
"from",
":",
"meth",
":",
"to_dict",
"into",
"an",
"Eds",
"object",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L162-L192 |
delph-in/pydelphin | delphin/mrs/eds.py | Eds.to_triples | def to_triples(self, short_pred=True, properties=True):
"""
Encode the Eds as triples suitable for PENMAN serialization.
"""
node_triples, edge_triples = [], []
# sort nodeids just so top var is first
nodes = sorted(self.nodes(), key=lambda n: n.nodeid != self.top)
... | python | def to_triples(self, short_pred=True, properties=True):
"""
Encode the Eds as triples suitable for PENMAN serialization.
"""
node_triples, edge_triples = [], []
# sort nodeids just so top var is first
nodes = sorted(self.nodes(), key=lambda n: n.nodeid != self.top)
... | [
"def",
"to_triples",
"(",
"self",
",",
"short_pred",
"=",
"True",
",",
"properties",
"=",
"True",
")",
":",
"node_triples",
",",
"edge_triples",
"=",
"[",
"]",
",",
"[",
"]",
"# sort nodeids just so top var is first",
"nodes",
"=",
"sorted",
"(",
"self",
"."... | Encode the Eds as triples suitable for PENMAN serialization. | [
"Encode",
"the",
"Eds",
"as",
"triples",
"suitable",
"for",
"PENMAN",
"serialization",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L194-L221 |
delph-in/pydelphin | delphin/mrs/eds.py | Eds.from_triples | def from_triples(cls, triples):
"""
Decode triples, as from :meth:`to_triples`, into an Eds object.
"""
nids, nd, edges = [], {}, []
for src, rel, tgt in triples:
if src not in nd:
nids.append(src)
nd[src] = {'pred': None, 'lnk': None, ... | python | def from_triples(cls, triples):
"""
Decode triples, as from :meth:`to_triples`, into an Eds object.
"""
nids, nd, edges = [], {}, []
for src, rel, tgt in triples:
if src not in nd:
nids.append(src)
nd[src] = {'pred': None, 'lnk': None, ... | [
"def",
"from_triples",
"(",
"cls",
",",
"triples",
")",
":",
"nids",
",",
"nd",
",",
"edges",
"=",
"[",
"]",
",",
"{",
"}",
",",
"[",
"]",
"for",
"src",
",",
"rel",
",",
"tgt",
"in",
"triples",
":",
"if",
"src",
"not",
"in",
"nd",
":",
"nids"... | Decode triples, as from :meth:`to_triples`, into an Eds object. | [
"Decode",
"triples",
"as",
"from",
":",
"meth",
":",
"to_triples",
"into",
"an",
"Eds",
"object",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/mrs/eds.py#L224-L258 |
delph-in/pydelphin | delphin/util.py | LookaheadIterator.next | def next(self, skip=None):
"""
Remove the next datum from the buffer and return it.
"""
buffer = self._buffer
popleft = buffer.popleft
if skip is not None:
while True:
try:
if not skip(buffer[0]):
bre... | python | def next(self, skip=None):
"""
Remove the next datum from the buffer and return it.
"""
buffer = self._buffer
popleft = buffer.popleft
if skip is not None:
while True:
try:
if not skip(buffer[0]):
bre... | [
"def",
"next",
"(",
"self",
",",
"skip",
"=",
"None",
")",
":",
"buffer",
"=",
"self",
".",
"_buffer",
"popleft",
"=",
"buffer",
".",
"popleft",
"if",
"skip",
"is",
"not",
"None",
":",
"while",
"True",
":",
"try",
":",
"if",
"not",
"skip",
"(",
"... | Remove the next datum from the buffer and return it. | [
"Remove",
"the",
"next",
"datum",
"from",
"the",
"buffer",
"and",
"return",
"it",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/util.py#L266-L285 |
delph-in/pydelphin | delphin/util.py | LookaheadIterator.peek | def peek(self, n=0, skip=None, drop=False):
"""
Return the *n*th datum from the buffer.
"""
buffer = self._buffer
popleft = buffer.popleft
datum = None
if skip is not None:
stack = []
stackpush = stack.append
while n >= 0:
... | python | def peek(self, n=0, skip=None, drop=False):
"""
Return the *n*th datum from the buffer.
"""
buffer = self._buffer
popleft = buffer.popleft
datum = None
if skip is not None:
stack = []
stackpush = stack.append
while n >= 0:
... | [
"def",
"peek",
"(",
"self",
",",
"n",
"=",
"0",
",",
"skip",
"=",
"None",
",",
"drop",
"=",
"False",
")",
":",
"buffer",
"=",
"self",
".",
"_buffer",
"popleft",
"=",
"buffer",
".",
"popleft",
"datum",
"=",
"None",
"if",
"skip",
"is",
"not",
"None... | Return the *n*th datum from the buffer. | [
"Return",
"the",
"*",
"n",
"*",
"th",
"datum",
"from",
"the",
"buffer",
"."
] | train | https://github.com/delph-in/pydelphin/blob/7bd2cd63ab7cf74803e1d6547b9ebc014b382abd/delphin/util.py#L287-L312 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultPhoto.to_array | def to_array(self):
"""
Serializes this InlineQueryResultPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultPhoto, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | python | def to_array(self):
"""
Serializes this InlineQueryResultPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultPhoto, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultPhoto",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array"... | Serializes this InlineQueryResultPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultPhoto",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L374-L412 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultMpeg4Gif.to_array | def to_array(self):
"""
Serializes this InlineQueryResultMpeg4Gif to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultMpeg4Gif, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3... | python | def to_array(self):
"""
Serializes this InlineQueryResultMpeg4Gif to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultMpeg4Gif, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultMpeg4Gif",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"arr... | Serializes this InlineQueryResultMpeg4Gif to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultMpeg4Gif",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L853-L890 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultVideo.to_array | def to_array(self):
"""
Serializes this InlineQueryResultVideo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultVideo, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | python | def to_array(self):
"""
Serializes this InlineQueryResultVideo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultVideo, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultVideo",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array"... | Serializes this InlineQueryResultVideo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultVideo",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L1114-L1155 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultVoice.to_array | def to_array(self):
"""
Serializes this InlineQueryResultVoice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultVoice, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | python | def to_array(self):
"""
Serializes this InlineQueryResultVoice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultVoice, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultVoice",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array"... | Serializes this InlineQueryResultVoice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultVoice",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L1551-L1581 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultDocument.to_array | def to_array(self):
"""
Serializes this InlineQueryResultDocument to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultDocument, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3... | python | def to_array(self):
"""
Serializes this InlineQueryResultDocument to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultDocument, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultDocument",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"arr... | Serializes this InlineQueryResultDocument to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultDocument",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L1791-L1831 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultVenue.to_array | def to_array(self):
"""
Serializes this InlineQueryResultVenue to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultVenue, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | python | def to_array(self):
"""
Serializes this InlineQueryResultVenue to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultVenue, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultVenue",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array"... | Serializes this InlineQueryResultVenue to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultVenue",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L2270-L2307 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultGame.to_array | def to_array(self):
"""
Serializes this InlineQueryResultGame to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultGame, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type s... | python | def to_array(self):
"""
Serializes this InlineQueryResultGame to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultGame, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type s... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultGame",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array",... | Serializes this InlineQueryResultGame to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultGame",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L2668-L2685 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultCachedPhoto.to_array | def to_array(self):
"""
Serializes this InlineQueryResultCachedPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedPhoto, self).to_array()
array['type'] = u(self.type) # py2: type unicod... | python | def to_array(self):
"""
Serializes this InlineQueryResultCachedPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedPhoto, self).to_array()
array['type'] = u(self.type) # py2: type unicod... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultCachedPhoto",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"... | Serializes this InlineQueryResultCachedPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultCachedPhoto",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L2851-L2883 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultCachedMpeg4Gif.to_array | def to_array(self):
"""
Serializes this InlineQueryResultCachedMpeg4Gif to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedMpeg4Gif, self).to_array()
array['type'] = u(self.type) # py2: type ... | python | def to_array(self):
"""
Serializes this InlineQueryResultCachedMpeg4Gif to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedMpeg4Gif, self).to_array()
array['type'] = u(self.type) # py2: type ... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultCachedMpeg4Gif",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
... | Serializes this InlineQueryResultCachedMpeg4Gif to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultCachedMpeg4Gif",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L3237-L3266 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultCachedSticker.to_array | def to_array(self):
"""
Serializes this InlineQueryResultCachedSticker to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedSticker, self).to_array()
array['type'] = u(self.type) # py2: type un... | python | def to_array(self):
"""
Serializes this InlineQueryResultCachedSticker to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedSticker, self).to_array()
array['type'] = u(self.type) # py2: type un... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultCachedSticker",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
... | Serializes this InlineQueryResultCachedSticker to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultCachedSticker",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L3403-L3423 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultCachedVideo.to_array | def to_array(self):
"""
Serializes this InlineQueryResultCachedVideo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedVideo, self).to_array()
array['type'] = u(self.type) # py2: type unicod... | python | def to_array(self):
"""
Serializes this InlineQueryResultCachedVideo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedVideo, self).to_array()
array['type'] = u(self.type) # py2: type unicod... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultCachedVideo",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"... | Serializes this InlineQueryResultCachedVideo to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultCachedVideo",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L3796-L3827 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/inline.py | InlineQueryResultCachedAudio.to_array | def to_array(self):
"""
Serializes this InlineQueryResultCachedAudio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedAudio, self).to_array()
array['type'] = u(self.type) # py2: type unicod... | python | def to_array(self):
"""
Serializes this InlineQueryResultCachedAudio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedAudio, self).to_array()
array['type'] = u(self.type) # py2: type unicod... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineQueryResultCachedAudio",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"... | Serializes this InlineQueryResultCachedAudio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineQueryResultCachedAudio",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/inline.py#L4175-L4201 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | MessageEntity.to_array | def to_array(self):
"""
Serializes this MessageEntity to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(MessageEntity, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
arra... | python | def to_array(self):
"""
Serializes this MessageEntity to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(MessageEntity, self).to_array()
array['type'] = u(self.type) # py2: type unicode, py3: type str
arra... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"MessageEntity",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'type'",
"]",
"=",
"u",
"(",
"self",
".",
"type",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
... | Serializes this MessageEntity to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"MessageEntity",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L92-L110 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | PhotoSize.to_array | def to_array(self):
"""
Serializes this PhotoSize to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PhotoSize, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array[... | python | def to_array(self):
"""
Serializes this PhotoSize to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PhotoSize, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array[... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"PhotoSize",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"array",
"["... | Serializes this PhotoSize to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"PhotoSize",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L235-L249 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Audio.to_array | def to_array(self):
"""
Serializes this Audio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Audio, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array['duratio... | python | def to_array(self):
"""
Serializes this Audio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Audio, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array['duratio... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Audio",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
... | Serializes this Audio to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Audio",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L400-L425 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Audio.from_array | def from_array(array):
"""
Deserialize a new Audio from a given dictionary.
:return: new Audio instance.
:rtype: Audio
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
fr... | python | def from_array(array):
"""
Deserialize a new Audio from a given dictionary.
:return: new Audio instance.
:rtype: Audio
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
fr... | [
"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... | Deserialize a new Audio from a given dictionary.
:return: new Audio instance.
:rtype: Audio | [
"Deserialize",
"a",
"new",
"Audio",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L429-L452 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Document.to_array | def to_array(self):
"""
Serializes this Document to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Document, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
if self.... | python | def to_array(self):
"""
Serializes this Document to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Document, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
if self.... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Document",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"if",
"self",... | Serializes this Document to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Document",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L563-L584 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Animation.to_array | def to_array(self):
"""
Serializes this Animation to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Animation, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array[... | python | def to_array(self):
"""
Serializes this Animation to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Animation, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array[... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Animation",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"array",
"["... | Serializes this Animation to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Animation",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L924-L948 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Voice.to_array | def to_array(self):
"""
Serializes this Voice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Voice, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array['duratio... | python | def to_array(self):
"""
Serializes this Voice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Voice, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array['duratio... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Voice",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
... | Serializes this Voice to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Voice",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1076-L1092 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | VideoNote.to_array | def to_array(self):
"""
Serializes this VideoNote to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(VideoNote, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array[... | python | def to_array(self):
"""
Serializes this VideoNote to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(VideoNote, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array[... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"VideoNote",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"array",
"["... | Serializes this VideoNote to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"VideoNote",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1225-L1242 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Contact.to_array | def to_array(self):
"""
Serializes this Contact to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Contact, self).to_array()
array['phone_number'] = u(self.phone_number) # py2: type unicode, py3: type str
... | python | def to_array(self):
"""
Serializes this Contact to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Contact, self).to_array()
array['phone_number'] = u(self.phone_number) # py2: type unicode, py3: type str
... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Contact",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'phone_number'",
"]",
"=",
"u",
"(",
"self",
".",
"phone_number",
")",
"# py2: type unicode, py3: type str",
"array... | Serializes this Contact to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Contact",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1376-L1396 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Location.to_array | def to_array(self):
"""
Serializes this Location to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Location, self).to_array()
array['longitude'] = float(self.longitude) # type float
array['latitude'] = flo... | python | def to_array(self):
"""
Serializes this Location to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Location, self).to_array()
array['longitude'] = float(self.longitude) # type float
array['latitude'] = flo... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Location",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'longitude'",
"]",
"=",
"float",
"(",
"self",
".",
"longitude",
")",
"# type float",
"array",
"[",
"'latitude'... | Serializes this Location to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Location",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1501-L1511 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Location.from_array | def from_array(array):
"""
Deserialize a new Location from a given dictionary.
:return: new Location instance.
:rtype: Location
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
... | python | def from_array(array):
"""
Deserialize a new Location from a given dictionary.
:return: new Location instance.
:rtype: Location
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new Location from a given dictionary.
:return: new Location instance.
:rtype: Location | [
"Deserialize",
"a",
"new",
"Location",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1515-L1531 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Venue.to_array | def to_array(self):
"""
Serializes this Venue to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Venue, self).to_array()
array['location'] = self.location.to_array() # type Location
array['title'] = u(self... | python | def to_array(self):
"""
Serializes this Venue to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Venue, self).to_array()
array['location'] = self.location.to_array() # type Location
array['title'] = u(self... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Venue",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'location'",
"]",
"=",
"self",
".",
"location",
".",
"to_array",
"(",
")",
"# type Location",
"array",
"[",
"'t... | Serializes this Venue to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Venue",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1642-L1662 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Venue.from_array | def from_array(array):
"""
Deserialize a new Venue from a given dictionary.
:return: new Venue instance.
:rtype: Venue
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
fr... | python | def from_array(array):
"""
Deserialize a new Venue from a given dictionary.
:return: new Venue instance.
:rtype: Venue
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
fr... | [
"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... | Deserialize a new Venue from a given dictionary.
:return: new Venue instance.
:rtype: Venue | [
"Deserialize",
"a",
"new",
"Venue",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1666-L1687 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | UserProfilePhotos.to_array | def to_array(self):
"""
Serializes this UserProfilePhotos to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(UserProfilePhotos, self).to_array()
array['total_count'] = int(self.total_count) # type int
array... | python | def to_array(self):
"""
Serializes this UserProfilePhotos to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(UserProfilePhotos, self).to_array()
array['total_count'] = int(self.total_count) # type int
array... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"UserProfilePhotos",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'total_count'",
"]",
"=",
"int",
"(",
"self",
".",
"total_count",
")",
"# type int",
"array",
"[",
"'... | Serializes this UserProfilePhotos to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"UserProfilePhotos",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1771-L1782 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | UserProfilePhotos.from_array | def from_array(array):
"""
Deserialize a new UserProfilePhotos from a given dictionary.
:return: new UserProfilePhotos instance.
:rtype: UserProfilePhotos
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict... | python | def from_array(array):
"""
Deserialize a new UserProfilePhotos from a given dictionary.
:return: new UserProfilePhotos instance.
:rtype: UserProfilePhotos
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict... | [
"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... | Deserialize a new UserProfilePhotos from a given dictionary.
:return: new UserProfilePhotos instance.
:rtype: UserProfilePhotos | [
"Deserialize",
"a",
"new",
"UserProfilePhotos",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1786-L1804 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | File.to_array | def to_array(self):
"""
Serializes this File to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(File, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
if self.file_siz... | python | def to_array(self):
"""
Serializes this File to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(File, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
if self.file_siz... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"File",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"if",
"self",
"... | Serializes this File to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"File",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L1899-L1914 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | ChatPhoto.to_array | def to_array(self):
"""
Serializes this ChatPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ChatPhoto, self).to_array()
array['small_file_id'] = u(self.small_file_id) # py2: type unicode, py3: type str
... | python | def to_array(self):
"""
Serializes this ChatPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ChatPhoto, self).to_array()
array['small_file_id'] = u(self.small_file_id) # py2: type unicode, py3: type str
... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"ChatPhoto",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'small_file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"small_file_id",
")",
"# py2: type unicode, py3: type str",
"a... | Serializes this ChatPhoto to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"ChatPhoto",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L2017-L2029 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Sticker.to_array | def to_array(self):
"""
Serializes this Sticker to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Sticker, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array['wid... | python | def to_array(self):
"""
Serializes this Sticker to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Sticker, self).to_array()
array['file_id'] = u(self.file_id) # py2: type unicode, py3: type str
array['wid... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Sticker",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'file_id'",
"]",
"=",
"u",
"(",
"self",
".",
"file_id",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
... | Serializes this Sticker to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Sticker",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L2188-L2214 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Sticker.from_array | def from_array(array):
"""
Deserialize a new Sticker from a given dictionary.
:return: new Sticker instance.
:rtype: Sticker
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
... | python | def from_array(array):
"""
Deserialize a new Sticker from a given dictionary.
:return: new Sticker instance.
:rtype: Sticker
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
... | [
"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... | Deserialize a new Sticker from a given dictionary.
:return: new Sticker instance.
:rtype: Sticker | [
"Deserialize",
"a",
"new",
"Sticker",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L2218-L2243 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Game.to_array | def to_array(self):
"""
Serializes this Game to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Game, self).to_array()
array['title'] = u(self.title) # py2: type unicode, py3: type str
array['description']... | python | def to_array(self):
"""
Serializes this Game to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(Game, self).to_array()
array['title'] = u(self.title) # py2: type unicode, py3: type str
array['description']... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"Game",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'title'",
"]",
"=",
"u",
"(",
"self",
".",
"title",
")",
"# py2: type unicode, py3: type str",
"array",
"[",
"'des... | Serializes this Game to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"Game",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L2365-L2388 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/receivable/media.py | Game.from_array | def from_array(array):
"""
Deserialize a new Game from a given dictionary.
:return: new Game instance.
:rtype: Game
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
from ... | python | def from_array(array):
"""
Deserialize a new Game from a given dictionary.
:return: new Game instance.
:rtype: Game
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
from ... | [
"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... | Deserialize a new Game from a given dictionary.
:return: new Game instance.
:rtype: Game | [
"Deserialize",
"a",
"new",
"Game",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/receivable/media.py#L2392-L2416 |
luckydonald/pytgbot | pytgbot/api_types/receivable/media.py | DownloadableMedia.from_array | def from_array(array):
"""
Subclass for all :class:`Media` which has a :py:attr:`file_id` and optionally a :py:attr:`file_size`
:param array: a array to parse
:type array: dict
:return: a dict with file_id and file_size extracted from the array
:rtype: dict
"""
... | python | def from_array(array):
"""
Subclass for all :class:`Media` which has a :py:attr:`file_id` and optionally a :py:attr:`file_size`
:param array: a array to parse
:type array: dict
:return: a dict with file_id and file_size extracted from the array
:rtype: dict
"""
... | [
"def",
"from_array",
"(",
"array",
")",
":",
"data",
"=",
"super",
"(",
"DownloadableMedia",
")",
".",
"from_array",
"(",
"array",
")",
"data",
"[",
"\"file_id\"",
"]",
"=",
"array",
".",
"get",
"(",
"\"file_id\"",
")",
"data",
"[",
"\"file_size\"",
"]",... | Subclass for all :class:`Media` which has a :py:attr:`file_id` and optionally a :py:attr:`file_size`
:param array: a array to parse
:type array: dict
:return: a dict with file_id and file_size extracted from the array
:rtype: dict | [
"Subclass",
"for",
"all",
":",
"class",
":",
"Media",
"which",
"has",
"a",
":",
"py",
":",
"attr",
":",
"file_id",
"and",
"optionally",
"a",
":",
"py",
":",
"attr",
":",
"file_size",
":",
"param",
"array",
":",
"a",
"array",
"to",
"parse",
":",
"ty... | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/media.py#L165-L176 |
luckydonald/pytgbot | pytgbot/api_types/receivable/media.py | Sticker.from_array | def from_array(array):
"""
Deserialize a new Sticker from a given dictionary.
:return: new Sticker instance.
:rtype: Sticker
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
... | python | def from_array(array):
"""
Deserialize a new Sticker from a given dictionary.
:return: new Sticker instance.
:rtype: Sticker
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
... | [
"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",
".",
"stickers",
"im... | Deserialize a new Sticker from a given dictionary.
:return: new Sticker instance.
:rtype: Sticker | [
"Deserialize",
"a",
"new",
"Sticker",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/media.py#L965-L989 |
luckydonald/pytgbot | pytgbot/api_types/receivable/media.py | VideoNote.from_array | def from_array(array):
"""
Deserialize a new VideoNote from a given dictionary.
:return: new VideoNote instance.
:rtype: VideoNote
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array"... | python | def from_array(array):
"""
Deserialize a new VideoNote from a given dictionary.
:return: new VideoNote instance.
:rtype: VideoNote
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array"... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new VideoNote from a given dictionary.
:return: new VideoNote instance.
:rtype: VideoNote | [
"Deserialize",
"a",
"new",
"VideoNote",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/media.py#L1428-L1447 |
luckydonald/pytgbot | pytgbot/api_types/receivable/media.py | Venue.from_array | def from_array(array):
"""
Deserialize a new Venue from a given dictionary.
:return: new Venue instance.
:rtype: Venue
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
d... | python | def from_array(array):
"""
Deserialize a new Venue from a given dictionary.
:return: new Venue instance.
:rtype: Venue
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
d... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new Venue from a given dictionary.
:return: new Venue instance.
:rtype: Venue | [
"Deserialize",
"a",
"new",
"Venue",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/media.py#L1837-L1856 |
luckydonald/pytgbot | pytgbot/api_types/receivable/media.py | UserProfilePhotos.from_array | def from_array(array):
"""
Deserialize a new UserProfilePhotos from a given dictionary.
:return: new UserProfilePhotos instance.
:rtype: UserProfilePhotos
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict... | python | def from_array(array):
"""
Deserialize a new UserProfilePhotos from a given dictionary.
:return: new UserProfilePhotos instance.
:rtype: UserProfilePhotos
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new UserProfilePhotos from a given dictionary.
:return: new UserProfilePhotos instance.
:rtype: UserProfilePhotos | [
"Deserialize",
"a",
"new",
"UserProfilePhotos",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/media.py#L1953-L1969 |
luckydonald/pytgbot | pytgbot/api_types/receivable/media.py | Game.from_array | def from_array(array):
"""
Deserialize a new Game from a given dictionary.
:return: new Game instance.
:rtype: Game
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
data... | python | def from_array(array):
"""
Deserialize a new Game from a given dictionary.
:return: new Game instance.
:rtype: Game
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="array")
data... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new Game from a given dictionary.
:return: new Game instance.
:rtype: Game | [
"Deserialize",
"a",
"new",
"Game",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/receivable/media.py#L2371-L2391 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | ReplyKeyboardMarkup.to_array | def to_array(self):
"""
Serializes this ReplyKeyboardMarkup to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ReplyKeyboardMarkup, self).to_array()
array['keyboard'] = self._as_array(self.keyboard) # type list of ... | python | def to_array(self):
"""
Serializes this ReplyKeyboardMarkup to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ReplyKeyboardMarkup, self).to_array()
array['keyboard'] = self._as_array(self.keyboard) # type list of ... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"ReplyKeyboardMarkup",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'keyboard'",
"]",
"=",
"self",
".",
"_as_array",
"(",
"self",
".",
"keyboard",
")",
"# type list of l... | Serializes this ReplyKeyboardMarkup to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"ReplyKeyboardMarkup",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L74-L90 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | ReplyKeyboardMarkup.from_array | def from_array(array):
"""
Deserialize a new ReplyKeyboardMarkup from a given dictionary.
:return: new ReplyKeyboardMarkup instance.
:rtype: ReplyKeyboardMarkup
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array... | python | def from_array(array):
"""
Deserialize a new ReplyKeyboardMarkup from a given dictionary.
:return: new ReplyKeyboardMarkup instance.
:rtype: ReplyKeyboardMarkup
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array... | [
"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... | Deserialize a new ReplyKeyboardMarkup from a given dictionary.
:return: new ReplyKeyboardMarkup instance.
:rtype: ReplyKeyboardMarkup | [
"Deserialize",
"a",
"new",
"ReplyKeyboardMarkup",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L94-L116 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | KeyboardButton.to_array | 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... | python | 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... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"KeyboardButton",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'text'",
"]",
"=",
"u",
"(",
"self",
".",
"text",
")",
"# py2: type unicode, py3: type str",
"if",
"self",... | Serializes this KeyboardButton to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"KeyboardButton",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L201-L215 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | KeyboardButton.from_array | def from_array(array):
"""
Deserialize a new KeyboardButton from a given dictionary.
:return: new KeyboardButton instance.
:rtype: KeyboardButton
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, paramet... | python | def from_array(array):
"""
Deserialize a new KeyboardButton from a given dictionary.
:return: new KeyboardButton instance.
:rtype: KeyboardButton
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, paramet... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new KeyboardButton from a given dictionary.
:return: new KeyboardButton instance.
:rtype: KeyboardButton | [
"Deserialize",
"a",
"new",
"KeyboardButton",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L219-L238 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | ReplyKeyboardRemove.to_array | def to_array(self):
"""
Serializes this ReplyKeyboardRemove to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ReplyKeyboardRemove, self).to_array()
array['remove_keyboard'] = bool(self.remove_keyboard) # type bool... | python | def to_array(self):
"""
Serializes this ReplyKeyboardRemove to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ReplyKeyboardRemove, self).to_array()
array['remove_keyboard'] = bool(self.remove_keyboard) # type bool... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"ReplyKeyboardRemove",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'remove_keyboard'",
"]",
"=",
"bool",
"(",
"self",
".",
"remove_keyboard",
")",
"# type bool",
"if",
... | Serializes this ReplyKeyboardRemove to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"ReplyKeyboardRemove",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L312-L323 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | InlineKeyboardMarkup.to_array | def to_array(self):
"""
Serializes this InlineKeyboardMarkup to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineKeyboardMarkup, self).to_array()
array['inline_keyboard'] = self._as_array(self.inline_keyboard) ... | python | def to_array(self):
"""
Serializes this InlineKeyboardMarkup to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineKeyboardMarkup, self).to_array()
array['inline_keyboard'] = self._as_array(self.inline_keyboard) ... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineKeyboardMarkup",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'inline_keyboard'",
"]",
"=",
"self",
".",
"_as_array",
"(",
"self",
".",
"inline_keyboard",
")",
"#... | Serializes this InlineKeyboardMarkup to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineKeyboardMarkup",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L414-L424 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | InlineKeyboardMarkup.from_array | def from_array(array):
"""
Deserialize a new InlineKeyboardMarkup from a given dictionary.
:return: new InlineKeyboardMarkup instance.
:rtype: InlineKeyboardMarkup
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(ar... | python | def from_array(array):
"""
Deserialize a new InlineKeyboardMarkup from a given dictionary.
:return: new InlineKeyboardMarkup instance.
:rtype: InlineKeyboardMarkup
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(ar... | [
"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... | Deserialize a new InlineKeyboardMarkup from a given dictionary.
:return: new InlineKeyboardMarkup instance.
:rtype: InlineKeyboardMarkup | [
"Deserialize",
"a",
"new",
"InlineKeyboardMarkup",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L428-L447 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | InlineKeyboardButton.to_array | def to_array(self):
"""
Serializes this InlineKeyboardButton to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineKeyboardButton, self).to_array()
array['text'] = u(self.text) # py2: type unicode, py3: type str... | python | def to_array(self):
"""
Serializes this InlineKeyboardButton to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineKeyboardButton, self).to_array()
array['text'] = u(self.text) # py2: type unicode, py3: type str... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"InlineKeyboardButton",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'text'",
"]",
"=",
"u",
"(",
"self",
".",
"text",
")",
"# py2: type unicode, py3: type str",
"if",
"... | Serializes this InlineKeyboardButton to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"InlineKeyboardButton",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L568-L595 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | InlineKeyboardButton.from_array | def from_array(array):
"""
Deserialize a new InlineKeyboardButton from a given dictionary.
:return: new InlineKeyboardButton instance.
:rtype: InlineKeyboardButton
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(ar... | python | def from_array(array):
"""
Deserialize a new InlineKeyboardButton from a given dictionary.
:return: new InlineKeyboardButton instance.
:rtype: InlineKeyboardButton
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(ar... | [
"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... | Deserialize a new InlineKeyboardButton from a given dictionary.
:return: new InlineKeyboardButton instance.
:rtype: InlineKeyboardButton | [
"Deserialize",
"a",
"new",
"InlineKeyboardButton",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L599-L624 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | ForceReply.to_array | def to_array(self):
"""
Serializes this ForceReply to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ForceReply, self).to_array()
array['force_reply'] = bool(self.force_reply) # type bool
if self.selective... | python | def to_array(self):
"""
Serializes this ForceReply to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(ForceReply, self).to_array()
array['force_reply'] = bool(self.force_reply) # type bool
if self.selective... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"ForceReply",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'force_reply'",
"]",
"=",
"bool",
"(",
"self",
".",
"force_reply",
")",
"# type bool",
"if",
"self",
".",
... | Serializes this ForceReply to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"ForceReply",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L706-L717 |
luckydonald/pytgbot | code_generation/output/pytgbot/api_types/sendable/reply_markup.py | ForceReply.from_array | def from_array(array):
"""
Deserialize a new ForceReply from a given dictionary.
:return: new ForceReply instance.
:rtype: ForceReply
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="arr... | python | def from_array(array):
"""
Deserialize a new ForceReply from a given dictionary.
:return: new ForceReply instance.
:rtype: ForceReply
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, parameter_name="arr... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new ForceReply from a given dictionary.
:return: new ForceReply instance.
:rtype: ForceReply | [
"Deserialize",
"a",
"new",
"ForceReply",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/code_generation/output/pytgbot/api_types/sendable/reply_markup.py#L721-L739 |
luckydonald/pytgbot | pytgbot/api_types/sendable/passport.py | PassportElementErrorDataField.to_array | def to_array(self):
"""
Serializes this PassportElementErrorDataField to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorDataField, self).to_array()
array['source'] = u(self.source) # py2: type ... | python | def to_array(self):
"""
Serializes this PassportElementErrorDataField to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorDataField, self).to_array()
array['source'] = u(self.source) # py2: type ... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"PassportElementErrorDataField",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'source'",
"]",
"=",
"u",
"(",
"self",
".",
"source",
")",
"# py2: type unicode, py3: type str"... | Serializes this PassportElementErrorDataField to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"PassportElementErrorDataField",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/sendable/passport.py#L91-L104 |
luckydonald/pytgbot | pytgbot/api_types/sendable/passport.py | PassportElementErrorReverseSide.to_array | def to_array(self):
"""
Serializes this PassportElementErrorReverseSide to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorReverseSide, self).to_array()
array['source'] = u(self.source) # py2: t... | python | def to_array(self):
"""
Serializes this PassportElementErrorReverseSide to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorReverseSide, self).to_array()
array['source'] = u(self.source) # py2: t... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"PassportElementErrorReverseSide",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'source'",
"]",
"=",
"u",
"(",
"self",
".",
"source",
")",
"# py2: type unicode, py3: type st... | Serializes this PassportElementErrorReverseSide to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"PassportElementErrorReverseSide",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/sendable/passport.py#L351-L363 |
luckydonald/pytgbot | pytgbot/api_types/sendable/passport.py | PassportElementErrorFiles.to_array | def to_array(self):
"""
Serializes this PassportElementErrorFiles to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorFiles, self).to_array()
array['source'] = u(self.source) # py2: type unicode,... | python | def to_array(self):
"""
Serializes this PassportElementErrorFiles to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorFiles, self).to_array()
array['source'] = u(self.source) # py2: type unicode,... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"PassportElementErrorFiles",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'source'",
"]",
"=",
"u",
"(",
"self",
".",
"source",
")",
"# py2: type unicode, py3: type str",
... | Serializes this PassportElementErrorFiles to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"PassportElementErrorFiles",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/sendable/passport.py#L738-L750 |
luckydonald/pytgbot | pytgbot/api_types/sendable/passport.py | PassportElementErrorFiles.from_array | def from_array(array):
"""
Deserialize a new PassportElementErrorFiles from a given dictionary.
:return: new PassportElementErrorFiles instance.
:rtype: PassportElementErrorFiles
"""
if array is None or not array:
return None
# end if
assert_t... | python | def from_array(array):
"""
Deserialize a new PassportElementErrorFiles from a given dictionary.
:return: new PassportElementErrorFiles instance.
:rtype: PassportElementErrorFiles
"""
if array is None or not array:
return None
# end if
assert_t... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new PassportElementErrorFiles from a given dictionary.
:return: new PassportElementErrorFiles instance.
:rtype: PassportElementErrorFiles | [
"Deserialize",
"a",
"new",
"PassportElementErrorFiles",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/sendable/passport.py#L754-L774 |
luckydonald/pytgbot | pytgbot/api_types/sendable/passport.py | PassportElementErrorUnspecified.to_array | def to_array(self):
"""
Serializes this PassportElementErrorUnspecified to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorUnspecified, self).to_array()
array['source'] = u(self.source) # py2: t... | python | def to_array(self):
"""
Serializes this PassportElementErrorUnspecified to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(PassportElementErrorUnspecified, self).to_array()
array['source'] = u(self.source) # py2: t... | [
"def",
"to_array",
"(",
"self",
")",
":",
"array",
"=",
"super",
"(",
"PassportElementErrorUnspecified",
",",
"self",
")",
".",
"to_array",
"(",
")",
"array",
"[",
"'source'",
"]",
"=",
"u",
"(",
"self",
".",
"source",
")",
"# py2: type unicode, py3: type st... | Serializes this PassportElementErrorUnspecified to a dictionary.
:return: dictionary representation of this object.
:rtype: dict | [
"Serializes",
"this",
"PassportElementErrorUnspecified",
"to",
"a",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/sendable/passport.py#L1130-L1146 |
luckydonald/pytgbot | pytgbot/api_types/sendable/passport.py | PassportElementErrorUnspecified.from_array | def from_array(array):
"""
Deserialize a new PassportElementErrorUnspecified from a given dictionary.
:return: new PassportElementErrorUnspecified instance.
:rtype: PassportElementErrorUnspecified
"""
if array is None or not array:
return None
# end i... | python | def from_array(array):
"""
Deserialize a new PassportElementErrorUnspecified from a given dictionary.
:return: new PassportElementErrorUnspecified instance.
:rtype: PassportElementErrorUnspecified
"""
if array is None or not array:
return None
# end i... | [
"def",
"from_array",
"(",
"array",
")",
":",
"if",
"array",
"is",
"None",
"or",
"not",
"array",
":",
"return",
"None",
"# end if",
"assert_type_or_raise",
"(",
"array",
",",
"dict",
",",
"parameter_name",
"=",
"\"array\"",
")",
"data",
"=",
"{",
"}",
"da... | Deserialize a new PassportElementErrorUnspecified from a given dictionary.
:return: new PassportElementErrorUnspecified instance.
:rtype: PassportElementErrorUnspecified | [
"Deserialize",
"a",
"new",
"PassportElementErrorUnspecified",
"from",
"a",
"given",
"dictionary",
"."
] | train | https://github.com/luckydonald/pytgbot/blob/67f4b5a1510d4583d40b5477e876b1ef0eb8971b/pytgbot/api_types/sendable/passport.py#L1150-L1170 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.