repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eternnoir/pyTelegramBotAPI | examples/detailed_example/detailed_example.py | listener | def listener(messages):
"""
When new messages arrive TeleBot will call this function.
"""
for m in messages:
if m.content_type == 'text':
# print the sent message to the console
print(str(m.chat.first_name) + " [" + str(m.chat.id) + "]: " + m.text) | python | def listener(messages):
"""
When new messages arrive TeleBot will call this function.
"""
for m in messages:
if m.content_type == 'text':
# print the sent message to the console
print(str(m.chat.first_name) + " [" + str(m.chat.id) + "]: " + m.text) | [
"def",
"listener",
"(",
"messages",
")",
":",
"for",
"m",
"in",
"messages",
":",
"if",
"m",
".",
"content_type",
"==",
"'text'",
":",
"# print the sent message to the console",
"print",
"(",
"str",
"(",
"m",
".",
"chat",
".",
"first_name",
")",
"+",
"\" [\... | When new messages arrive TeleBot will call this function. | [
"When",
"new",
"messages",
"arrive",
"TeleBot",
"will",
"call",
"this",
"function",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/examples/detailed_example/detailed_example.py#L42-L49 | train | This function is called when new messages arrive from the TeleBot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/types.py | JsonDeserializable.check_json | def check_json(json_type):
"""
Checks whether json_type is a dict or a string. If it is already a dict, it is returned as-is.
If it is not, it is converted to a dict by means of json.loads(json_type)
:param json_type:
:return:
"""
try:
str_types = (str... | python | def check_json(json_type):
"""
Checks whether json_type is a dict or a string. If it is already a dict, it is returned as-is.
If it is not, it is converted to a dict by means of json.loads(json_type)
:param json_type:
:return:
"""
try:
str_types = (str... | [
"def",
"check_json",
"(",
"json_type",
")",
":",
"try",
":",
"str_types",
"=",
"(",
"str",
",",
"unicode",
")",
"except",
"NameError",
":",
"str_types",
"=",
"(",
"str",
",",
")",
"if",
"type",
"(",
"json_type",
")",
"==",
"dict",
":",
"return",
"jso... | Checks whether json_type is a dict or a string. If it is already a dict, it is returned as-is.
If it is not, it is converted to a dict by means of json.loads(json_type)
:param json_type:
:return: | [
"Checks",
"whether",
"json_type",
"is",
"a",
"dict",
"or",
"a",
"string",
".",
"If",
"it",
"is",
"already",
"a",
"dict",
"it",
"is",
"returned",
"as",
"-",
"is",
".",
"If",
"it",
"is",
"not",
"it",
"is",
"converted",
"to",
"a",
"dict",
"by",
"means... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L62-L79 | train | Checks whether json_type is a dict or a string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/types.py | Message.__html_text | def __html_text(self, text, entities):
"""
Author: @sviat9440
Message: "*Test* parse _formatting_, [url](https://example.com), [text_mention](tg://user?id=123456) and mention @username"
Example:
message.html_text
>> "<b>Test</b> parse <i>formatting</i>, <a href=\... | python | def __html_text(self, text, entities):
"""
Author: @sviat9440
Message: "*Test* parse _formatting_, [url](https://example.com), [text_mention](tg://user?id=123456) and mention @username"
Example:
message.html_text
>> "<b>Test</b> parse <i>formatting</i>, <a href=\... | [
"def",
"__html_text",
"(",
"self",
",",
"text",
",",
"entities",
")",
":",
"if",
"not",
"entities",
":",
"return",
"text",
"_subs",
"=",
"{",
"\"bold\"",
":",
"\"<b>{text}</b>\"",
",",
"\"italic\"",
":",
"\"<i>{text}</i>\"",
",",
"\"pre\"",
":",
"\"<pre>{tex... | Author: @sviat9440
Message: "*Test* parse _formatting_, [url](https://example.com), [text_mention](tg://user?id=123456) and mention @username"
Example:
message.html_text
>> "<b>Test</b> parse <i>formatting</i>, <a href=\"https://example.com\">url</a>, <a href=\"tg://user?id=1234... | [
"Author",
":",
"@sviat9440",
"Message",
":",
"*",
"Test",
"*",
"parse",
"_formatting_",
"[",
"url",
"]",
"(",
"https",
":",
"//",
"example",
".",
"com",
")",
"[",
"text_mention",
"]",
"(",
"tg",
":",
"//",
"user?id",
"=",
"123456",
")",
"and",
"menti... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L440-L495 | train | Parse text and add entities to the html_text attribute of the current object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/types.py | ReplyKeyboardMarkup.add | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | python | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | [
"def",
"add",
"(",
"self",
",",
"*",
"args",
")",
":",
"i",
"=",
"1",
"row",
"=",
"[",
"]",
"for",
"button",
"in",
"args",
":",
"if",
"util",
".",
"is_string",
"(",
"button",
")",
":",
"row",
".",
"append",
"(",
"{",
"'text'",
":",
"button",
... | This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", ... | [
"This",
"function",
"adds",
"strings",
"to",
"the",
"keyboard",
"while",
"not",
"exceeding",
"row_width",
".",
"E",
".",
"g",
".",
"ReplyKeyboardMarkup#add",
"(",
"A",
"B",
"C",
")",
"yields",
"the",
"json",
"result",
"{",
"keyboard",
":",
"[[",
"A",
"]"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L755-L778 | train | This function adds strings to the keyboard while not exceeding row_width. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/types.py | ReplyKeyboardMarkup.to_json | def to_json(self):
"""
Converts this object to its json representation following the Telegram API guidelines described here:
https://core.telegram.org/bots/api#replykeyboardmarkup
:return:
"""
json_dict = {'keyboard': self.keyboard}
if self.one_time_keyboard:
... | python | def to_json(self):
"""
Converts this object to its json representation following the Telegram API guidelines described here:
https://core.telegram.org/bots/api#replykeyboardmarkup
:return:
"""
json_dict = {'keyboard': self.keyboard}
if self.one_time_keyboard:
... | [
"def",
"to_json",
"(",
"self",
")",
":",
"json_dict",
"=",
"{",
"'keyboard'",
":",
"self",
".",
"keyboard",
"}",
"if",
"self",
".",
"one_time_keyboard",
":",
"json_dict",
"[",
"'one_time_keyboard'",
"]",
"=",
"True",
"if",
"self",
".",
"resize_keyboard",
"... | Converts this object to its json representation following the Telegram API guidelines described here:
https://core.telegram.org/bots/api#replykeyboardmarkup
:return: | [
"Converts",
"this",
"object",
"to",
"its",
"json",
"representation",
"following",
"the",
"Telegram",
"API",
"guidelines",
"described",
"here",
":",
"https",
":",
"//",
"core",
".",
"telegram",
".",
"org",
"/",
"bots",
"/",
"api#replykeyboardmarkup",
":",
"retu... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L797-L813 | train | Converts this object to its json representation following the Telegram API guidelines described here. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/types.py | InlineKeyboardMarkup.add | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | python | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | [
"def",
"add",
"(",
"self",
",",
"*",
"args",
")",
":",
"i",
"=",
"1",
"row",
"=",
"[",
"]",
"for",
"button",
"in",
"args",
":",
"row",
".",
"append",
"(",
"button",
".",
"to_dic",
"(",
")",
")",
"if",
"i",
"%",
"self",
".",
"row_width",
"==",... | This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", ... | [
"This",
"function",
"adds",
"strings",
"to",
"the",
"keyboard",
"while",
"not",
"exceeding",
"row_width",
".",
"E",
".",
"g",
".",
"ReplyKeyboardMarkup#add",
"(",
"A",
"B",
"C",
")",
"yields",
"the",
"json",
"result",
"{",
"keyboard",
":",
"[[",
"A",
"]"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L840-L858 | train | This function adds strings to the keyboard while not exceeding row_width. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/types.py | InlineKeyboardMarkup.row | def row(self, *args):
"""
Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param ar... | python | def row(self, *args):
"""
Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param ar... | [
"def",
"row",
"(",
"self",
",",
"*",
"args",
")",
":",
"btn_array",
"=",
"[",
"]",
"for",
"button",
"in",
"args",
":",
"btn_array",
".",
"append",
"(",
"button",
".",
"to_dic",
"(",
")",
")",
"self",
".",
"keyboard",
".",
"append",
"(",
"btn_array"... | Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param args: strings
:return: self, to allo... | [
"Adds",
"a",
"list",
"of",
"KeyboardButton",
"to",
"the",
"keyboard",
".",
"This",
"function",
"does",
"not",
"consider",
"row_width",
".",
"ReplyKeyboardMarkup#row",
"(",
"A",
")",
"#row",
"(",
"B",
"C",
")",
"#to_json",
"()",
"outputs",
"{",
"keyboard",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L860-L872 | train | Adds a list of KeyboardButton to the keyboard. This function does not consider row_width. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | _make_request | def _make_request(token, method_name, method='get', params=None, files=None, base_url=API_URL):
"""
Makes a request to the Telegram API.
:param token: The bot's API token. (Created with @BotFather)
:param method_name: Name of the API method to be called. (E.g. 'getUpdates')
:param method: HTTP metho... | python | def _make_request(token, method_name, method='get', params=None, files=None, base_url=API_URL):
"""
Makes a request to the Telegram API.
:param token: The bot's API token. (Created with @BotFather)
:param method_name: Name of the API method to be called. (E.g. 'getUpdates')
:param method: HTTP metho... | [
"def",
"_make_request",
"(",
"token",
",",
"method_name",
",",
"method",
"=",
"'get'",
",",
"params",
"=",
"None",
",",
"files",
"=",
"None",
",",
"base_url",
"=",
"API_URL",
")",
":",
"request_url",
"=",
"base_url",
".",
"format",
"(",
"token",
",",
"... | Makes a request to the Telegram API.
:param token: The bot's API token. (Created with @BotFather)
:param method_name: Name of the API method to be called. (E.g. 'getUpdates')
:param method: HTTP method to be used. Defaults to 'get'.
:param params: Optional parameters. Should be a dictionary with key-val... | [
"Makes",
"a",
"request",
"to",
"the",
"Telegram",
"API",
".",
":",
"param",
"token",
":",
"The",
"bot",
"s",
"API",
"token",
".",
"(",
"Created",
"with"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L34-L56 | train | Makes a request to the Telegram API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | _check_result | def _check_result(method_name, result):
"""
Checks whether `result` is a valid API response.
A result is considered invalid if:
- The server returned an HTTP response code other than 200
- The content of the result is invalid JSON.
- The method call was unsuccessful (The JSON 'ok' fi... | python | def _check_result(method_name, result):
"""
Checks whether `result` is a valid API response.
A result is considered invalid if:
- The server returned an HTTP response code other than 200
- The content of the result is invalid JSON.
- The method call was unsuccessful (The JSON 'ok' fi... | [
"def",
"_check_result",
"(",
"method_name",
",",
"result",
")",
":",
"if",
"result",
".",
"status_code",
"!=",
"200",
":",
"msg",
"=",
"'The server returned HTTP {0} {1}. Response body:\\n[{2}]'",
".",
"format",
"(",
"result",
".",
"status_code",
",",
"result",
".... | Checks whether `result` is a valid API response.
A result is considered invalid if:
- The server returned an HTTP response code other than 200
- The content of the result is invalid JSON.
- The method call was unsuccessful (The JSON 'ok' field equals False)
:raises ApiException: if one ... | [
"Checks",
"whether",
"result",
"is",
"a",
"valid",
"API",
"response",
".",
"A",
"result",
"is",
"considered",
"invalid",
"if",
":",
"-",
"The",
"server",
"returned",
"an",
"HTTP",
"response",
"code",
"other",
"than",
"200",
"-",
"The",
"content",
"of",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L59-L88 | train | Checks whether the result of a method call is a valid API response. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | send_message | def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages. On success, the sent Message is returned.
:param token:
:param chat_id:
:param t... | python | def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages. On success, the sent Message is returned.
:param token:
:param chat_id:
:param t... | [
"def",
"send_message",
"(",
"token",
",",
"chat_id",
",",
"text",
",",
"disable_web_page_preview",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
... | Use this method to send text messages. On success, the sent Message is returned.
:param token:
:param chat_id:
:param text:
:param disable_web_page_preview:
:param reply_to_message_id:
:param reply_markup:
:param parse_mode:
:param disable_notification:
:return: | [
"Use",
"this",
"method",
"to",
"send",
"text",
"messages",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
".",
":",
"param",
"token",
":",
":",
"param",
"chat_id",
":",
":",
"param",
"text",
":",
":",
"param",
"disable_web_page_preview",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L115-L141 | train | Use this method to send text messages. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | set_game_score | def set_game_score(token, user_id, score, force=None, disable_edit_message=None, chat_id=None, message_id=None,
inline_message_id=None):
"""
Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise ... | python | def set_game_score(token, user_id, score, force=None, disable_edit_message=None, chat_id=None, message_id=None,
inline_message_id=None):
"""
Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise ... | [
"def",
"set_game_score",
"(",
"token",
",",
"user_id",
",",
"score",
",",
"force",
"=",
"None",
",",
"disable_edit_message",
"=",
"None",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
")",
":",
"method_... | Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat.
:param token: Bot's token (you don't need to fill this)
... | [
"Use",
"this",
"method",
"to",
"set",
"the",
"score",
"of",
"the",
"specified",
"user",
"in",
"a",
"game",
".",
"On",
"success",
"if",
"the",
"message",
"was",
"sent",
"by",
"the",
"bot",
"returns",
"the",
"edited",
"Message",
"otherwise",
"returns",
"Tr... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L692-L718 | train | Use this method to set the score of a user in a game. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | get_game_high_scores | def get_game_high_scores(token, user_id, chat_id=None, message_id=None, inline_message_id=None):
"""
Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will ... | python | def get_game_high_scores(token, user_id, chat_id=None, message_id=None, inline_message_id=None):
"""
Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will ... | [
"def",
"get_game_high_scores",
"(",
"token",
",",
"user_id",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
")",
":",
"method_url",
"=",
"r'getGameHighScores'",
"payload",
"=",
"{",
"'user_id'",
":",
"user_i... | Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will currently return scores for the target user, plus two of his closest neighbors on each side. Will also return... | [
"Use",
"this",
"method",
"to",
"get",
"data",
"for",
"high",
"score",
"tables",
".",
"Will",
"return",
"the",
"score",
"of",
"the",
"specified",
"user",
"and",
"several",
"of",
"his",
"neighbors",
"in",
"a",
"game",
".",
"On",
"success",
"returns",
"an",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L722-L741 | train | This method returns the high scores of a user in a chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | send_invoice | def send_invoice(token, chat_id, title, description, invoice_payload, provider_token, currency, prices,
start_parameter, photo_url=None, photo_size=None, photo_width=None, photo_height=None,
need_name=None, need_phone_number=None, need_email=None, need_shipping_address=None, is_flexibl... | python | def send_invoice(token, chat_id, title, description, invoice_payload, provider_token, currency, prices,
start_parameter, photo_url=None, photo_size=None, photo_width=None, photo_height=None,
need_name=None, need_phone_number=None, need_email=None, need_shipping_address=None, is_flexibl... | [
"def",
"send_invoice",
"(",
"token",
",",
"chat_id",
",",
"title",
",",
"description",
",",
"invoice_payload",
",",
"provider_token",
",",
"currency",
",",
"prices",
",",
"start_parameter",
",",
"photo_url",
"=",
"None",
",",
"photo_size",
"=",
"None",
",",
... | Use this method to send invoices. On success, the sent Message is returned.
:param token: Bot's token (you don't need to fill this)
:param chat_id: Unique identifier for the target private chat
:param title: Product name
:param description: Product description
:param invoice_payload: Bot-defined inv... | [
"Use",
"this",
"method",
"to",
"send",
"invoices",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
".",
":",
"param",
"token",
":",
"Bot",
"s",
"token",
"(",
"you",
"don",
"t",
"need",
"to",
"fill",
"this",
")",
":",
"param",
"chat_... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L746-L806 | train | This method is used to send invoices to a private order. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | answer_shipping_query | def answer_shipping_query(token, shipping_query_id, ok, shipping_options=None, error_message=None):
"""
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping q... | python | def answer_shipping_query(token, shipping_query_id, ok, shipping_options=None, error_message=None):
"""
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping q... | [
"def",
"answer_shipping_query",
"(",
"token",
",",
"shipping_query_id",
",",
"ok",
",",
"shipping_options",
"=",
"None",
",",
"error_message",
"=",
"None",
")",
":",
"method_url",
"=",
"'answerShippingQuery'",
"payload",
"=",
"{",
"'shipping_query_id'",
":",
"ship... | If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
:param token: Bot's token (you don't need to fill this)
:param shi... | [
"If",
"you",
"sent",
"an",
"invoice",
"requesting",
"a",
"shipping",
"address",
"and",
"the",
"parameter",
"is_flexible",
"was",
"specified",
"the",
"Bot",
"API",
"will",
"send",
"an",
"Update",
"with",
"a",
"shipping_query",
"field",
"to",
"the",
"bot",
"."... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L809-L825 | train | This method sends an invoice request to a shipping address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | answer_pre_checkout_query | def answer_pre_checkout_query(token, pre_checkout_query_id, ok, error_message=None):
"""
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. O... | python | def answer_pre_checkout_query(token, pre_checkout_query_id, ok, error_message=None):
"""
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. O... | [
"def",
"answer_pre_checkout_query",
"(",
"token",
",",
"pre_checkout_query_id",
",",
"ok",
",",
"error_message",
"=",
"None",
")",
":",
"method_url",
"=",
"'answerPreCheckoutQuery'",
"payload",
"=",
"{",
"'pre_checkout_query_id'",
":",
"pre_checkout_query_id",
",",
"'... | Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the... | [
"Once",
"the",
"user",
"has",
"confirmed",
"their",
"payment",
"and",
"shipping",
"details",
"the",
"Bot",
"API",
"sends",
"the",
"final",
"confirmation",
"in",
"the",
"form",
"of",
"an",
"Update",
"with",
"the",
"field",
"pre_checkout_query",
".",
"Use",
"t... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L828-L841 | train | This method sends an answer to a pre - checkout query to the Bot API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/apihelper.py | answer_callback_query | def answer_callback_query(token, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, Tru... | python | def answer_callback_query(token, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, Tru... | [
"def",
"answer_callback_query",
"(",
"token",
",",
"callback_query_id",
",",
"text",
"=",
"None",
",",
"show_alert",
"=",
"None",
",",
"url",
"=",
"None",
",",
"cache_time",
"=",
"None",
")",
":",
"method_url",
"=",
"'answerCallbackQuery'",
"payload",
"=",
"... | Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you mus... | [
"Use",
"this",
"method",
"to",
"send",
"answers",
"to",
"callback",
"queries",
"sent",
"from",
"inline",
"keyboards",
".",
"The",
"answer",
"will",
"be",
"displayed",
"to",
"the",
"user",
"as",
"a",
"notification",
"at",
"the",
"top",
"of",
"the",
"chat",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L846-L869 | train | This method is used to send answers to callback queries sent from inline keyboards. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.enable_save_next_step_handlers | def enable_save_next_step_handlers(self, delay=120, filename="./.handler-saves/step.save"):
"""
Enable saving next step handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.next_st... | python | def enable_save_next_step_handlers(self, delay=120, filename="./.handler-saves/step.save"):
"""
Enable saving next step handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.next_st... | [
"def",
"enable_save_next_step_handlers",
"(",
"self",
",",
"delay",
"=",
"120",
",",
"filename",
"=",
"\"./.handler-saves/step.save\"",
")",
":",
"self",
".",
"next_step_saver",
"=",
"Saver",
"(",
"self",
".",
"next_step_handlers",
",",
"filename",
",",
"delay",
... | Enable saving next step handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file | [
"Enable",
"saving",
"next",
"step",
"handlers",
"(",
"by",
"default",
"saving",
"disable",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L173-L180 | train | Enable saving next step handlers | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.enable_save_reply_handlers | def enable_save_reply_handlers(self, delay=120, filename="./.handler-saves/reply.save"):
"""
Enable saving reply handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.reply_saver = ... | python | def enable_save_reply_handlers(self, delay=120, filename="./.handler-saves/reply.save"):
"""
Enable saving reply handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.reply_saver = ... | [
"def",
"enable_save_reply_handlers",
"(",
"self",
",",
"delay",
"=",
"120",
",",
"filename",
"=",
"\"./.handler-saves/reply.save\"",
")",
":",
"self",
".",
"reply_saver",
"=",
"Saver",
"(",
"self",
".",
"reply_handlers",
",",
"filename",
",",
"delay",
")"
] | Enable saving reply handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file | [
"Enable",
"saving",
"reply",
"handlers",
"(",
"by",
"default",
"saving",
"disable",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L182-L189 | train | Enable saving reply handlers for the current node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.load_next_step_handlers | def load_next_step_handlers(self, filename="./.handler-saves/step.save", del_file_after_loading=True):
"""
Load next step handlers from save file
:param filename: Filename of the file where handlers was saved
:param del_file_after_loading: Is passed True, after loading save file will be... | python | def load_next_step_handlers(self, filename="./.handler-saves/step.save", del_file_after_loading=True):
"""
Load next step handlers from save file
:param filename: Filename of the file where handlers was saved
:param del_file_after_loading: Is passed True, after loading save file will be... | [
"def",
"load_next_step_handlers",
"(",
"self",
",",
"filename",
"=",
"\"./.handler-saves/step.save\"",
",",
"del_file_after_loading",
"=",
"True",
")",
":",
"self",
".",
"next_step_saver",
".",
"load_handlers",
"(",
"filename",
",",
"del_file_after_loading",
")"
] | Load next step handlers from save file
:param filename: Filename of the file where handlers was saved
:param del_file_after_loading: Is passed True, after loading save file will be deleted | [
"Load",
"next",
"step",
"handlers",
"from",
"save",
"file"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L203-L210 | train | Loads next step handlers from save file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.get_updates | def get_updates(self, offset=None, limit=None, timeout=20, allowed_updates=None):
"""
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
:param allowed_updates: Array of string. List the types of updates you want your bot to receive.
... | python | def get_updates(self, offset=None, limit=None, timeout=20, allowed_updates=None):
"""
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
:param allowed_updates: Array of string. List the types of updates you want your bot to receive.
... | [
"def",
"get_updates",
"(",
"self",
",",
"offset",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"timeout",
"=",
"20",
",",
"allowed_updates",
"=",
"None",
")",
":",
"json_updates",
"=",
"apihelper",
".",
"get_updates",
"(",
"self",
".",
"token",
",",
"o... | Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
:param allowed_updates: Array of string. List the types of updates you want your bot to receive.
:param offset: Integer. Identifier of the first update to be returned.
:param limit: Int... | [
"Use",
"this",
"method",
"to",
"receive",
"incoming",
"updates",
"using",
"long",
"polling",
"(",
"wiki",
")",
".",
"An",
"Array",
"of",
"Update",
"objects",
"is",
"returned",
".",
":",
"param",
"allowed_updates",
":",
"Array",
"of",
"string",
".",
"List",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L238-L251 | train | This method returns a list of updates for the current user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.__skip_updates | def __skip_updates(self):
"""
Get and discard all pending updates before first poll of the bot
:return: total updates skipped
"""
total = 0
updates = self.get_updates(offset=self.last_update_id, timeout=1)
while updates:
total += len(updates)
... | python | def __skip_updates(self):
"""
Get and discard all pending updates before first poll of the bot
:return: total updates skipped
"""
total = 0
updates = self.get_updates(offset=self.last_update_id, timeout=1)
while updates:
total += len(updates)
... | [
"def",
"__skip_updates",
"(",
"self",
")",
":",
"total",
"=",
"0",
"updates",
"=",
"self",
".",
"get_updates",
"(",
"offset",
"=",
"self",
".",
"last_update_id",
",",
"timeout",
"=",
"1",
")",
"while",
"updates",
":",
"total",
"+=",
"len",
"(",
"update... | Get and discard all pending updates before first poll of the bot
:return: total updates skipped | [
"Get",
"and",
"discard",
"all",
"pending",
"updates",
"before",
"first",
"poll",
"of",
"the",
"bot",
":",
"return",
":",
"total",
"updates",
"skipped"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L253-L266 | train | Get and discard all pending updates before first poll of the bot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.__retrieve_updates | def __retrieve_updates(self, timeout=20):
"""
Retrieves any updates from the Telegram API.
Registered listeners and applicable message handlers will be notified when a new message arrives.
:raises ApiException when a call has failed.
"""
if self.skip_pending:
... | python | def __retrieve_updates(self, timeout=20):
"""
Retrieves any updates from the Telegram API.
Registered listeners and applicable message handlers will be notified when a new message arrives.
:raises ApiException when a call has failed.
"""
if self.skip_pending:
... | [
"def",
"__retrieve_updates",
"(",
"self",
",",
"timeout",
"=",
"20",
")",
":",
"if",
"self",
".",
"skip_pending",
":",
"logger",
".",
"debug",
"(",
"'Skipped {0} pending messages'",
".",
"format",
"(",
"self",
".",
"__skip_updates",
"(",
")",
")",
")",
"se... | Retrieves any updates from the Telegram API.
Registered listeners and applicable message handlers will be notified when a new message arrives.
:raises ApiException when a call has failed. | [
"Retrieves",
"any",
"updates",
"from",
"the",
"Telegram",
"API",
".",
"Registered",
"listeners",
"and",
"applicable",
"message",
"handlers",
"will",
"be",
"notified",
"when",
"a",
"new",
"message",
"arrives",
".",
":",
"raises",
"ApiException",
"when",
"a",
"c... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L268-L278 | train | Retrieve any updates from Telegram API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.polling | def polling(self, none_stop=False, interval=0, timeout=20):
"""
This function creates a new Thread that calls an internal __retrieve_updates function.
This allows the bot to retrieve Updates automagically and notify listeners and message handlers accordingly.
Warning: Do not call this f... | python | def polling(self, none_stop=False, interval=0, timeout=20):
"""
This function creates a new Thread that calls an internal __retrieve_updates function.
This allows the bot to retrieve Updates automagically and notify listeners and message handlers accordingly.
Warning: Do not call this f... | [
"def",
"polling",
"(",
"self",
",",
"none_stop",
"=",
"False",
",",
"interval",
"=",
"0",
",",
"timeout",
"=",
"20",
")",
":",
"if",
"self",
".",
"threaded",
":",
"self",
".",
"__threaded_polling",
"(",
"none_stop",
",",
"interval",
",",
"timeout",
")"... | This function creates a new Thread that calls an internal __retrieve_updates function.
This allows the bot to retrieve Updates automagically and notify listeners and message handlers accordingly.
Warning: Do not call this function more than once!
Always get updates.
:param interval:
... | [
"This",
"function",
"creates",
"a",
"new",
"Thread",
"that",
"calls",
"an",
"internal",
"__retrieve_updates",
"function",
".",
"This",
"allows",
"the",
"bot",
"to",
"retrieve",
"Updates",
"automagically",
"and",
"notify",
"listeners",
"and",
"message",
"handlers",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L376-L392 | train | This function creates a Thread that polls the update list for updates. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.get_user_profile_photos | def get_user_profile_photos(self, user_id, offset=None, limit=None):
"""
Retrieves the user profile photos of the person with 'user_id'
See https://core.telegram.org/bots/api#getuserprofilephotos
:param user_id:
:param offset:
:param limit:
:return: API reply.
... | python | def get_user_profile_photos(self, user_id, offset=None, limit=None):
"""
Retrieves the user profile photos of the person with 'user_id'
See https://core.telegram.org/bots/api#getuserprofilephotos
:param user_id:
:param offset:
:param limit:
:return: API reply.
... | [
"def",
"get_user_profile_photos",
"(",
"self",
",",
"user_id",
",",
"offset",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"result",
"=",
"apihelper",
".",
"get_user_profile_photos",
"(",
"self",
".",
"token",
",",
"user_id",
",",
"offset",
",",
"limi... | Retrieves the user profile photos of the person with 'user_id'
See https://core.telegram.org/bots/api#getuserprofilephotos
:param user_id:
:param offset:
:param limit:
:return: API reply. | [
"Retrieves",
"the",
"user",
"profile",
"photos",
"of",
"the",
"person",
"with",
"user_id",
"See",
"https",
":",
"//",
"core",
".",
"telegram",
".",
"org",
"/",
"bots",
"/",
"api#getuserprofilephotos",
":",
"param",
"user_id",
":",
":",
"param",
"offset",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L491-L501 | train | Get the user profile photos of the person with user_id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.get_chat | def get_chat(self, chat_id):
"""
Use this method to get up to date information about the chat (current name of the user for one-on-one
conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
:param chat_id:
:return:
"""
... | python | def get_chat(self, chat_id):
"""
Use this method to get up to date information about the chat (current name of the user for one-on-one
conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
:param chat_id:
:return:
"""
... | [
"def",
"get_chat",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"types",
".",
"Chat",
".",
"de_json",
"(",
"result",
")"
] | Use this method to get up to date information about the chat (current name of the user for one-on-one
conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
:param chat_id:
:return: | [
"Use",
"this",
"method",
"to",
"get",
"up",
"to",
"date",
"information",
"about",
"the",
"chat",
"(",
"current",
"name",
"of",
"the",
"user",
"for",
"one",
"-",
"on",
"-",
"one",
"conversations",
"current",
"username",
"of",
"a",
"user",
"group",
"or",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L503-L511 | train | Use this method to get up to date information about a chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.leave_chat | def leave_chat(self, chat_id):
"""
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
:param chat_id:
:return:
"""
result = apihelper.leave_chat(self.token, chat_id)
return result | python | def leave_chat(self, chat_id):
"""
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
:param chat_id:
:return:
"""
result = apihelper.leave_chat(self.token, chat_id)
return result | [
"def",
"leave_chat",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"leave_chat",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"result"
] | Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
:param chat_id:
:return: | [
"Use",
"this",
"method",
"for",
"your",
"bot",
"to",
"leave",
"a",
"group",
"supergroup",
"or",
"channel",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
":",
"return",
":"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L513-L520 | train | Use this method to leave a chat. Returns True on success. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.get_chat_administrators | def get_chat_administrators(self, chat_id):
"""
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects
that contains information about all chat administrators except other bots.
:param chat_id:
:return:
"""
re... | python | def get_chat_administrators(self, chat_id):
"""
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects
that contains information about all chat administrators except other bots.
:param chat_id:
:return:
"""
re... | [
"def",
"get_chat_administrators",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat_administrators",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"ret",
"=",
"[",
"]",
"for",
"r",
"in",
"result",
":",
"ret",
".",
"appen... | Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects
that contains information about all chat administrators except other bots.
:param chat_id:
:return: | [
"Use",
"this",
"method",
"to",
"get",
"a",
"list",
"of",
"administrators",
"in",
"a",
"chat",
".",
"On",
"success",
"returns",
"an",
"Array",
"of",
"ChatMember",
"objects",
"that",
"contains",
"information",
"about",
"all",
"chat",
"administrators",
"except",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L522-L533 | train | Use this method to get a list of administrators in a chat. On success returns an Array of ChatMember objects containing information about all administrators except other bots. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.get_chat_members_count | def get_chat_members_count(self, chat_id):
"""
Use this method to get the number of members in a chat. Returns Int on success.
:param chat_id:
:return:
"""
result = apihelper.get_chat_members_count(self.token, chat_id)
return result | python | def get_chat_members_count(self, chat_id):
"""
Use this method to get the number of members in a chat. Returns Int on success.
:param chat_id:
:return:
"""
result = apihelper.get_chat_members_count(self.token, chat_id)
return result | [
"def",
"get_chat_members_count",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat_members_count",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"result"
] | Use this method to get the number of members in a chat. Returns Int on success.
:param chat_id:
:return: | [
"Use",
"this",
"method",
"to",
"get",
"the",
"number",
"of",
"members",
"in",
"a",
"chat",
".",
"Returns",
"Int",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
":",
"return",
":"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L535-L542 | train | Use this method to get the number of members in a chat. Returns Int on success. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.set_chat_sticker_set | def set_chat_sticker_set(self, chat_id, sticker_set_name):
"""
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Use the field can_set_sticker_set optionally returned ... | python | def set_chat_sticker_set(self, chat_id, sticker_set_name):
"""
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Use the field can_set_sticker_set optionally returned ... | [
"def",
"set_chat_sticker_set",
"(",
"self",
",",
"chat_id",
",",
"sticker_set_name",
")",
":",
"result",
"=",
"apihelper",
".",
"set_chat_sticker_set",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"sticker_set_name",
")",
"return",
"result"
] | Use this method to set a new group sticker set for a supergroup. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Use the field can_set_sticker_set optionally returned in getChat requests to check
if the bot can use this method. Returns Tr... | [
"Use",
"this",
"method",
"to",
"set",
"a",
"new",
"group",
"sticker",
"set",
"for",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L544-L556 | train | Use this method to set a new group sticker set for a supergroup chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.delete_chat_sticker_set | def delete_chat_sticker_set(self, chat_id):
"""
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat
for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set
optionally returned in getChat requ... | python | def delete_chat_sticker_set(self, chat_id):
"""
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat
for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set
optionally returned in getChat requ... | [
"def",
"delete_chat_sticker_set",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"delete_chat_sticker_set",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"result"
] | Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat
for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set
optionally returned in getChat requests to check if the bot can use this method. Returns True on su... | [
"Use",
"this",
"method",
"to",
"delete",
"a",
"group",
"sticker",
"set",
"from",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
"ad... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L558-L568 | train | Use this method to delete a group sticker set from a supergroup chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.get_chat_member | def get_chat_member(self, chat_id, user_id):
"""
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
:param chat_id:
:param user_id:
:return:
"""
result = apihelper.get_chat_member(self.token, chat_id, user_id)
... | python | def get_chat_member(self, chat_id, user_id):
"""
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
:param chat_id:
:param user_id:
:return:
"""
result = apihelper.get_chat_member(self.token, chat_id, user_id)
... | [
"def",
"get_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat_member",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"user_id",
")",
"return",
"types",
".",
"ChatMember",
".",
"de_json",
"(",
... | Use this method to get information about a member of a chat. Returns a ChatMember object on success.
:param chat_id:
:param user_id:
:return: | [
"Use",
"this",
"method",
"to",
"get",
"information",
"about",
"a",
"member",
"of",
"a",
"chat",
".",
"Returns",
"a",
"ChatMember",
"object",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"user_id",
":",
":",
"return",
":"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L570-L578 | train | Use this method to get information about a member of a chat. Returns a ChatMember object on success. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_message | def send_message(self, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages.
Warning: Do not send more than about 5000 characters each message, other... | python | def send_message(self, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages.
Warning: Do not send more than about 5000 characters each message, other... | [
"def",
"send_message",
"(",
"self",
",",
"chat_id",
",",
"text",
",",
"disable_web_page_preview",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
... | Use this method to send text messages.
Warning: Do not send more than about 5000 characters each message, otherwise you'll risk an HTTP 414 error.
If you must send more than 5000 characters, use the split_string function in apihelper.py.
:param chat_id:
:param text:
:param disa... | [
"Use",
"this",
"method",
"to",
"send",
"text",
"messages",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L580-L599 | train | Use this method to send text messages. You can use this method to send text messages. You can use the split_string function in apihelper. py. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.forward_message | def forward_message(self, chat_id, from_chat_id, message_id, disable_notification=None):
"""
Use this method to forward messages of any kind.
:param disable_notification:
:param chat_id: which chat to forward
:param from_chat_id: which chat message from
:param message_id:... | python | def forward_message(self, chat_id, from_chat_id, message_id, disable_notification=None):
"""
Use this method to forward messages of any kind.
:param disable_notification:
:param chat_id: which chat to forward
:param from_chat_id: which chat message from
:param message_id:... | [
"def",
"forward_message",
"(",
"self",
",",
"chat_id",
",",
"from_chat_id",
",",
"message_id",
",",
"disable_notification",
"=",
"None",
")",
":",
"return",
"types",
".",
"Message",
".",
"de_json",
"(",
"apihelper",
".",
"forward_message",
"(",
"self",
".",
... | Use this method to forward messages of any kind.
:param disable_notification:
:param chat_id: which chat to forward
:param from_chat_id: which chat message from
:param message_id: message id
:return: API reply. | [
"Use",
"this",
"method",
"to",
"forward",
"messages",
"of",
"any",
"kind",
".",
":",
"param",
"disable_notification",
":",
":",
"param",
"chat_id",
":",
"which",
"chat",
"to",
"forward",
":",
"param",
"from_chat_id",
":",
"which",
"chat",
"message",
"from",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L601-L611 | train | Use this method to forward a message from one chat to another. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.delete_message | def delete_message(self, chat_id, message_id):
"""
Use this method to delete message. Returns True on success.
:param chat_id: in which chat to delete
:param message_id: which message to delete
:return: API reply.
"""
return apihelper.delete_message(self.token, ch... | python | def delete_message(self, chat_id, message_id):
"""
Use this method to delete message. Returns True on success.
:param chat_id: in which chat to delete
:param message_id: which message to delete
:return: API reply.
"""
return apihelper.delete_message(self.token, ch... | [
"def",
"delete_message",
"(",
"self",
",",
"chat_id",
",",
"message_id",
")",
":",
"return",
"apihelper",
".",
"delete_message",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"message_id",
")"
] | Use this method to delete message. Returns True on success.
:param chat_id: in which chat to delete
:param message_id: which message to delete
:return: API reply. | [
"Use",
"this",
"method",
"to",
"delete",
"message",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
"in",
"which",
"chat",
"to",
"delete",
":",
"param",
"message_id",
":",
"which",
"message",
"to",
"delete",
":",
"return",
":"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L613-L620 | train | Use this method to delete a message from a chat. Returns True on success. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_photo | def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send photos.
:param disable_notification:
:param chat_id:
:param photo:
:param caption:
... | python | def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send photos.
:param disable_notification:
:param chat_id:
:param photo:
:param caption:
... | [
"def",
"send_photo",
"(",
"self",
",",
"chat_id",
",",
"photo",
",",
"caption",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
")",
":",
"ret... | Use this method to send photos.
:param disable_notification:
:param chat_id:
:param photo:
:param caption:
:param parse_mode
:param reply_to_message_id:
:param reply_markup:
:return: API reply. | [
"Use",
"this",
"method",
"to",
"send",
"photos",
".",
":",
"param",
"disable_notification",
":",
":",
"param",
"chat_id",
":",
":",
"param",
"photo",
":",
":",
"param",
"caption",
":",
":",
"param",
"parse_mode",
":",
"param",
"reply_to_message_id",
":",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L622-L637 | train | Use this method to send photos. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_audio | def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None,
reply_to_message_id=None, reply_markup=None, parse_mode=None, disable_notification=None,
timeout=None):
"""
Use this method to send audio files, if you want Telegram client... | python | def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None,
reply_to_message_id=None, reply_markup=None, parse_mode=None, disable_notification=None,
timeout=None):
"""
Use this method to send audio files, if you want Telegram client... | [
"def",
"send_audio",
"(",
"self",
",",
"chat_id",
",",
"audio",
",",
"caption",
"=",
"None",
",",
"duration",
"=",
"None",
",",
"performer",
"=",
"None",
",",
"title",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None"... | Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format.
:param chat_id:Unique identifier for the message recipient
:param audio:Audio file to send.
:param duration:Duration of the audio in seconds
:para... | [
"Use",
"this",
"method",
"to",
"send",
"audio",
"files",
"if",
"you",
"want",
"Telegram",
"clients",
"to",
"display",
"them",
"in",
"the",
"music",
"player",
".",
"Your",
"audio",
"must",
"be",
"in",
"the",
".",
"mp3",
"format",
".",
":",
"param",
"cha... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L639-L656 | train | Use this method to send audio files. You must be an administrator in the chat for this to work and must have the appropriate admin rights. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_document | def send_document(self, chat_id, data, reply_to_message_id=None, caption=None, reply_markup=None,
parse_mode=None, disable_notification=None, timeout=None):
"""
Use this method to send general files.
:param chat_id:
:param data:
:param reply_to_message_id:
... | python | def send_document(self, chat_id, data, reply_to_message_id=None, caption=None, reply_markup=None,
parse_mode=None, disable_notification=None, timeout=None):
"""
Use this method to send general files.
:param chat_id:
:param data:
:param reply_to_message_id:
... | [
"def",
"send_document",
"(",
"self",
",",
"chat_id",
",",
"data",
",",
"reply_to_message_id",
"=",
"None",
",",
"caption",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"timeout"... | Use this method to send general files.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
:param parse_mode:
:param disable_notification:
:return: API reply. | [
"Use",
"this",
"method",
"to",
"send",
"general",
"files",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"data",
":",
":",
"param",
"reply_to_message_id",
":",
":",
"param",
"reply_markup",
":",
":",
"param",
"parse_mode",
":",
":",
"param",
"disable_no... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L674-L688 | train | Use this method to send a document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_sticker | def send_sticker(self, chat_id, data, reply_to_message_id=None, reply_markup=None, disable_notification=None,
timeout=None):
"""
Use this method to send .webp stickers.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
... | python | def send_sticker(self, chat_id, data, reply_to_message_id=None, reply_markup=None, disable_notification=None,
timeout=None):
"""
Use this method to send .webp stickers.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
... | [
"def",
"send_sticker",
"(",
"self",
",",
"chat_id",
",",
"data",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"return",
"types",
".",
"Message",
... | Use this method to send .webp stickers.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
:return: API reply. | [
"Use",
"this",
"method",
"to",
"send",
".",
"webp",
"stickers",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"data",
":",
":",
"param",
"reply_to_message_id",
":",
":",
"param",
"reply_markup",
":",
":",
"return",
":",
"API",
"reply",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L690-L702 | train | Use this method to send a sticker. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_video_note | def send_video_note(self, chat_id, data, duration=None, length=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None, timeout=None):
"""
Use this method to send video files, Telegram clients support mp4 videos.
:param chat_id: Integer : Unique ident... | python | def send_video_note(self, chat_id, data, duration=None, length=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None, timeout=None):
"""
Use this method to send video files, Telegram clients support mp4 videos.
:param chat_id: Integer : Unique ident... | [
"def",
"send_video_note",
"(",
"self",
",",
"chat_id",
",",
"data",
",",
"duration",
"=",
"None",
",",
"length",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"timeout",... | Use this method to send video files, Telegram clients support mp4 videos.
:param chat_id: Integer : Unique identifier for the message recipient — User or GroupChat id
:param data: InputFile or String : Video note to send. You can either pass a file_id as String to resend a video that is already on the T... | [
"Use",
"this",
"method",
"to",
"send",
"video",
"files",
"Telegram",
"clients",
"support",
"mp4",
"videos",
".",
":",
"param",
"chat_id",
":",
"Integer",
":",
"Unique",
"identifier",
"for",
"the",
"message",
"recipient",
"—",
"User",
"or",
"GroupChat",
"id",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L722-L736 | train | Use this method to send a video note. You can use this method to send video files. You can use the video files Telegram clients can use the mp4 videos API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_media_group | def send_media_group(self, chat_id, media, disable_notification=None, reply_to_message_id=None):
"""
send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
:param chat_id:
:param media:
:param disable_notification:
:param repl... | python | def send_media_group(self, chat_id, media, disable_notification=None, reply_to_message_id=None):
"""
send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
:param chat_id:
:param media:
:param disable_notification:
:param repl... | [
"def",
"send_media_group",
"(",
"self",
",",
"chat_id",
",",
"media",
",",
"disable_notification",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
")",
":",
"result",
"=",
"apihelper",
".",
"send_media_group",
"(",
"self",
".",
"token",
",",
"chat_id",
... | send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
:param chat_id:
:param media:
:param disable_notification:
:param reply_to_message_id:
:return: | [
"send",
"a",
"group",
"of",
"photos",
"or",
"videos",
"as",
"an",
"album",
".",
"On",
"success",
"an",
"array",
"of",
"the",
"sent",
"Messages",
"is",
"returned",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"media",
":",
":",
"param",
"disable_not... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L738-L751 | train | Use this method to send a group of photos or videos as an album. You must be an administrator in the chat for this to work and must have the appropriate admin rights. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_location | def send_location(self, chat_id, latitude, longitude, live_period=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None):
"""
Use this method to send point on the map.
:param chat_id:
:param latitude:
:param longitude:
:param l... | python | def send_location(self, chat_id, latitude, longitude, live_period=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None):
"""
Use this method to send point on the map.
:param chat_id:
:param latitude:
:param longitude:
:param l... | [
"def",
"send_location",
"(",
"self",
",",
"chat_id",
",",
"latitude",
",",
"longitude",
",",
"live_period",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"disable_notification",
"=",
"None",
")",
":",
"return",
... | Use this method to send point on the map.
:param chat_id:
:param latitude:
:param longitude:
:param live_period
:param reply_to_message_id:
:param reply_markup:
:return: API reply. | [
"Use",
"this",
"method",
"to",
"send",
"point",
"on",
"the",
"map",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"latitude",
":",
":",
"param",
"longitude",
":",
":",
"param",
"live_period",
":",
"param",
"reply_to_message_id",
":",
":",
"param",
"re... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L753-L768 | train | Use this method to send location on the map. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.edit_message_live_location | def edit_message_live_location(self, latitude, longitude, chat_id=None, message_id=None,
inline_message_id=None, reply_markup=None):
"""
Use this method to edit live location
:param latitude:
:param longitude:
:param chat_id:
:param mess... | python | def edit_message_live_location(self, latitude, longitude, chat_id=None, message_id=None,
inline_message_id=None, reply_markup=None):
"""
Use this method to edit live location
:param latitude:
:param longitude:
:param chat_id:
:param mess... | [
"def",
"edit_message_live_location",
"(",
"self",
",",
"latitude",
",",
"longitude",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"return",
"types",
".",
"Mess... | Use this method to edit live location
:param latitude:
:param longitude:
:param chat_id:
:param message_id:
:param inline_message_id:
:param reply_markup:
:return: | [
"Use",
"this",
"method",
"to",
"edit",
"live",
"location",
":",
"param",
"latitude",
":",
":",
"param",
"longitude",
":",
":",
"param",
"chat_id",
":",
":",
"param",
"message_id",
":",
":",
"param",
"inline_message_id",
":",
":",
"param",
"reply_markup",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L770-L784 | train | Use this method to edit live location of a message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.stop_message_live_location | def stop_message_live_location(self, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
"""
Use this method to stop updating a live location message sent by the bot
or via the bot (for inline bots) before live_period expires
:param chat_id:
:param message_... | python | def stop_message_live_location(self, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
"""
Use this method to stop updating a live location message sent by the bot
or via the bot (for inline bots) before live_period expires
:param chat_id:
:param message_... | [
"def",
"stop_message_live_location",
"(",
"self",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"return",
"types",
".",
"Message",
".",
"de_json",
"(",
"apihelp... | Use this method to stop updating a live location message sent by the bot
or via the bot (for inline bots) before live_period expires
:param chat_id:
:param message_id:
:param inline_message_id:
:param reply_markup:
:return: | [
"Use",
"this",
"method",
"to",
"stop",
"updating",
"a",
"live",
"location",
"message",
"sent",
"by",
"the",
"bot",
"or",
"via",
"the",
"bot",
"(",
"for",
"inline",
"bots",
")",
"before",
"live_period",
"expires",
":",
"param",
"chat_id",
":",
":",
"param... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L786-L797 | train | Use this method to stop updating a live location message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_venue | def send_venue(self, chat_id, latitude, longitude, title, address, foursquare_id=None, disable_notification=None,
reply_to_message_id=None, reply_markup=None):
"""
Use this method to send information about a venue.
:param chat_id: Integer or String : Unique identifier for the ... | python | def send_venue(self, chat_id, latitude, longitude, title, address, foursquare_id=None, disable_notification=None,
reply_to_message_id=None, reply_markup=None):
"""
Use this method to send information about a venue.
:param chat_id: Integer or String : Unique identifier for the ... | [
"def",
"send_venue",
"(",
"self",
",",
"chat_id",
",",
"latitude",
",",
"longitude",
",",
"title",
",",
"address",
",",
"foursquare_id",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
... | Use this method to send information about a venue.
:param chat_id: Integer or String : Unique identifier for the target chat or username of the target channel
:param latitude: Float : Latitude of the venue
:param longitude: Float : Longitude of the venue
:param title: String : Name of th... | [
"Use",
"this",
"method",
"to",
"send",
"information",
"about",
"a",
"venue",
".",
":",
"param",
"chat_id",
":",
"Integer",
"or",
"String",
":",
"Unique",
"identifier",
"for",
"the",
"target",
"chat",
"or",
"username",
"of",
"the",
"target",
"channel",
":",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L799-L817 | train | Use this method to send information about a venue. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.send_chat_action | def send_chat_action(self, chat_id, action):
"""
Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear
its typing status).
:param chat_id:... | python | def send_chat_action(self, chat_id, action):
"""
Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear
its typing status).
:param chat_id:... | [
"def",
"send_chat_action",
"(",
"self",
",",
"chat_id",
",",
"action",
")",
":",
"return",
"apihelper",
".",
"send_chat_action",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"action",
")"
] | Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear
its typing status).
:param chat_id:
:param action: One of the following strings: 'typing', ... | [
"Use",
"this",
"method",
"when",
"you",
"need",
"to",
"tell",
"the",
"user",
"that",
"something",
"is",
"happening",
"on",
"the",
"bot",
"s",
"side",
".",
"The",
"status",
"is",
"set",
"for",
"5",
"seconds",
"or",
"less",
"(",
"when",
"a",
"message",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L826-L836 | train | Use this method when you want to send a message to a chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.kick_chat_member | def kick_chat_member(self, chat_id, user_id, until_date=None):
"""
Use this method to kick a user from a group or a supergroup.
:param chat_id: Int or string : Unique identifier for the target group or username of the target supergroup
:param user_id: Int : Unique identifier of the targe... | python | def kick_chat_member(self, chat_id, user_id, until_date=None):
"""
Use this method to kick a user from a group or a supergroup.
:param chat_id: Int or string : Unique identifier for the target group or username of the target supergroup
:param user_id: Int : Unique identifier of the targe... | [
"def",
"kick_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
",",
"until_date",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"kick_chat_member",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"user_id",
",",
"until_date",
")"
] | Use this method to kick a user from a group or a supergroup.
:param chat_id: Int or string : Unique identifier for the target group or username of the target supergroup
:param user_id: Int : Unique identifier of the target user
:param until_date: Date when the user will be unbanned, unix time. I... | [
"Use",
"this",
"method",
"to",
"kick",
"a",
"user",
"from",
"a",
"group",
"or",
"a",
"supergroup",
".",
":",
"param",
"chat_id",
":",
"Int",
"or",
"string",
":",
"Unique",
"identifier",
"for",
"the",
"target",
"group",
"or",
"username",
"of",
"the",
"t... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L838-L847 | train | Use this method to kick a user from a chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.restrict_chat_member | def restrict_chat_member(self, chat_id, user_id, until_date=None, can_send_messages=None,
can_send_media_messages=None, can_send_other_messages=None,
can_add_web_page_previews=None):
"""
Use this method to restrict a user in a supergroup.
... | python | def restrict_chat_member(self, chat_id, user_id, until_date=None, can_send_messages=None,
can_send_media_messages=None, can_send_other_messages=None,
can_add_web_page_previews=None):
"""
Use this method to restrict a user in a supergroup.
... | [
"def",
"restrict_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
",",
"until_date",
"=",
"None",
",",
"can_send_messages",
"=",
"None",
",",
"can_send_media_messages",
"=",
"None",
",",
"can_send_other_messages",
"=",
"None",
",",
"can_add_web_page_previe... | Use this method to restrict a user in a supergroup.
The bot must be an administrator in the supergroup for this to work and must have
the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.
Returns True on success.
:param chat_id: Int or Strin... | [
"Use",
"this",
"method",
"to",
"restrict",
"a",
"user",
"in",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"supergroup",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
"admin",
"rights",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L852-L877 | train | Use this method to restrict a user in a supergroup. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.promote_chat_member | def promote_chat_member(self, chat_id, user_id, can_change_info=None, can_post_messages=None,
can_edit_messages=None, can_delete_messages=None, can_invite_users=None,
can_restrict_members=None, can_pin_messages=None, can_promote_members=None):
"""
... | python | def promote_chat_member(self, chat_id, user_id, can_change_info=None, can_post_messages=None,
can_edit_messages=None, can_delete_messages=None, can_invite_users=None,
can_restrict_members=None, can_pin_messages=None, can_promote_members=None):
"""
... | [
"def",
"promote_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
",",
"can_change_info",
"=",
"None",
",",
"can_post_messages",
"=",
"None",
",",
"can_edit_messages",
"=",
"None",
",",
"can_delete_messages",
"=",
"None",
",",
"can_invite_users",
"=",
"... | Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Pass False for all boolean parameters to demote a user. Returns True on success.
:param chat_id: Unique identifier f... | [
"Use",
"this",
"method",
"to",
"promote",
"or",
"demote",
"a",
"user",
"in",
"a",
"supergroup",
"or",
"a",
"channel",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L879-L903 | train | Promote a user in a supergroup or a channel. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.set_chat_photo | def set_chat_photo(self, chat_id, photo):
"""
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Not... | python | def set_chat_photo(self, chat_id, photo):
"""
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Not... | [
"def",
"set_chat_photo",
"(",
"self",
",",
"chat_id",
",",
"photo",
")",
":",
"return",
"apihelper",
".",
"set_chat_photo",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"photo",
")"
] | Use this method to set a new profile photo for the chat. Photos can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regular groups (non-supergroups), this method will only ... | [
"Use",
"this",
"method",
"to",
"set",
"a",
"new",
"profile",
"photo",
"for",
"the",
"chat",
".",
"Photos",
"can",
"t",
"be",
"changed",
"for",
"private",
"chats",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L916-L928 | train | Use this method to set a new profile photo for a chat. Photos can t be changed for private chats. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.set_chat_title | def set_chat_title(self, chat_id, title):
"""
Use this method to change the title of a chat. Titles can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regu... | python | def set_chat_title(self, chat_id, title):
"""
Use this method to change the title of a chat. Titles can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regu... | [
"def",
"set_chat_title",
"(",
"self",
",",
"chat_id",
",",
"title",
")",
":",
"return",
"apihelper",
".",
"set_chat_title",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"title",
")"
] | Use this method to change the title of a chat. Titles can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regular groups (non-supergroups), this method will only work if th... | [
"Use",
"this",
"method",
"to",
"change",
"the",
"title",
"of",
"a",
"chat",
".",
"Titles",
"can",
"t",
"be",
"changed",
"for",
"private",
"chats",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L943-L955 | train | Use this method to change the title of a chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.set_chat_description | def set_chat_description(self, chat_id, description):
"""
Use this method to change the description of a supergroup or a channel.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int... | python | def set_chat_description(self, chat_id, description):
"""
Use this method to change the description of a supergroup or a channel.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int... | [
"def",
"set_chat_description",
"(",
"self",
",",
"chat_id",
",",
"description",
")",
":",
"return",
"apihelper",
".",
"set_chat_description",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"description",
")"
] | Use this method to change the description of a supergroup or a channel.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int or Str: Unique identifier for the target chat or username of the target c... | [
"Use",
"this",
"method",
"to",
"change",
"the",
"description",
"of",
"a",
"supergroup",
"or",
"a",
"channel",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropr... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L957-L967 | train | Use this method to change the chat description | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.pin_chat_message | def pin_chat_message(self, chat_id, message_id, disable_notification=False):
"""
Use this method to pin a message in a supergroup.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: In... | python | def pin_chat_message(self, chat_id, message_id, disable_notification=False):
"""
Use this method to pin a message in a supergroup.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: In... | [
"def",
"pin_chat_message",
"(",
"self",
",",
"chat_id",
",",
"message_id",
",",
"disable_notification",
"=",
"False",
")",
":",
"return",
"apihelper",
".",
"pin_chat_message",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"message_id",
",",
"disable_notificati... | Use this method to pin a message in a supergroup.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int or Str: Unique identifier for the target chat or username of the target channel
(in... | [
"Use",
"this",
"method",
"to",
"pin",
"a",
"message",
"in",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
"admin",
"rights",
".",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L969-L981 | train | Use this method to pin a message in a supergroup. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.reply_to | def reply_to(self, message, text, **kwargs):
"""
Convenience function for `send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs)`
"""
return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) | python | def reply_to(self, message, text, **kwargs):
"""
Convenience function for `send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs)`
"""
return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) | [
"def",
"reply_to",
"(",
"self",
",",
"message",
",",
"text",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"send_message",
"(",
"message",
".",
"chat",
".",
"id",
",",
"text",
",",
"reply_to_message_id",
"=",
"message",
".",
"message_id",
"... | Convenience function for `send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs)` | [
"Convenience",
"function",
"for",
"send_message",
"(",
"message",
".",
"chat",
".",
"id",
"text",
"reply_to_message_id",
"=",
"message",
".",
"message_id",
"**",
"kwargs",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1061-L1065 | train | Reply to a message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.answer_inline_query | def answer_inline_query(self, inline_query_id, results, cache_time=None, is_personal=None, next_offset=None,
switch_pm_text=None, switch_pm_parameter=None):
"""
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results p... | python | def answer_inline_query(self, inline_query_id, results, cache_time=None, is_personal=None, next_offset=None,
switch_pm_text=None, switch_pm_parameter=None):
"""
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results p... | [
"def",
"answer_inline_query",
"(",
"self",
",",
"inline_query_id",
",",
"results",
",",
"cache_time",
"=",
"None",
",",
"is_personal",
"=",
"None",
",",
"next_offset",
"=",
"None",
",",
"switch_pm_text",
"=",
"None",
",",
"switch_pm_parameter",
"=",
"None",
")... | Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.
:param inline_query_id: Unique identifier for the answered query
:param results: Array of results for the inline query
:param cache_time: The maximum amount of... | [
"Use",
"this",
"method",
"to",
"send",
"answers",
"to",
"an",
"inline",
"query",
".",
"On",
"success",
"True",
"is",
"returned",
".",
"No",
"more",
"than",
"50",
"results",
"per",
"query",
"are",
"allowed",
".",
":",
"param",
"inline_query_id",
":",
"Uni... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1067-L1083 | train | Send an inline query to the server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.answer_callback_query | def answer_callback_query(self, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to
the user as a notification at the top of the chat screen or as an alert.
... | python | def answer_callback_query(self, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to
the user as a notification at the top of the chat screen or as an alert.
... | [
"def",
"answer_callback_query",
"(",
"self",
",",
"callback_query_id",
",",
"text",
"=",
"None",
",",
"show_alert",
"=",
"None",
",",
"url",
"=",
"None",
",",
"cache_time",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"answer_callback_query",
"(",
"sel... | Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to
the user as a notification at the top of the chat screen or as an alert.
:param callback_query_id:
:param text:
:param show_alert:
:return: | [
"Use",
"this",
"method",
"to",
"send",
"answers",
"to",
"callback",
"queries",
"sent",
"from",
"inline",
"keyboards",
".",
"The",
"answer",
"will",
"be",
"displayed",
"to",
"the",
"user",
"as",
"a",
"notification",
"at",
"the",
"top",
"of",
"the",
"chat",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1085-L1094 | train | Send an answer to a callback query. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.get_sticker_set | def get_sticker_set(self, name):
"""
Use this method to get a sticker set. On success, a StickerSet object is returned.
:param name:
:return:
"""
result = apihelper.get_sticker_set(self.token, name)
return types.StickerSet.de_json(result) | python | def get_sticker_set(self, name):
"""
Use this method to get a sticker set. On success, a StickerSet object is returned.
:param name:
:return:
"""
result = apihelper.get_sticker_set(self.token, name)
return types.StickerSet.de_json(result) | [
"def",
"get_sticker_set",
"(",
"self",
",",
"name",
")",
":",
"result",
"=",
"apihelper",
".",
"get_sticker_set",
"(",
"self",
".",
"token",
",",
"name",
")",
"return",
"types",
".",
"StickerSet",
".",
"de_json",
"(",
"result",
")"
] | Use this method to get a sticker set. On success, a StickerSet object is returned.
:param name:
:return: | [
"Use",
"this",
"method",
"to",
"get",
"a",
"sticker",
"set",
".",
"On",
"success",
"a",
"StickerSet",
"object",
"is",
"returned",
".",
":",
"param",
"name",
":",
":",
"return",
":"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1109-L1116 | train | Get a specific sticker set by its name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.upload_sticker_file | def upload_sticker_file(self, user_id, png_sticker):
"""
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet
methods (can be used multiple times). Returns the uploaded File on success.
:param user_id:
:param png_sticker:
... | python | def upload_sticker_file(self, user_id, png_sticker):
"""
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet
methods (can be used multiple times). Returns the uploaded File on success.
:param user_id:
:param png_sticker:
... | [
"def",
"upload_sticker_file",
"(",
"self",
",",
"user_id",
",",
"png_sticker",
")",
":",
"result",
"=",
"apihelper",
".",
"upload_sticker_file",
"(",
"self",
".",
"token",
",",
"user_id",
",",
"png_sticker",
")",
"return",
"types",
".",
"File",
".",
"de_json... | Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet
methods (can be used multiple times). Returns the uploaded File on success.
:param user_id:
:param png_sticker:
:return: | [
"Use",
"this",
"method",
"to",
"upload",
"a",
".",
"png",
"file",
"with",
"a",
"sticker",
"for",
"later",
"use",
"in",
"createNewStickerSet",
"and",
"addStickerToSet",
"methods",
"(",
"can",
"be",
"used",
"multiple",
"times",
")",
".",
"Returns",
"the",
"u... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1118-L1127 | train | Upload a. png file with a sticker to a new StickerSet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.create_new_sticker_set | def create_new_sticker_set(self, user_id, name, title, png_sticker, emojis, contains_masks=None,
mask_position=None):
"""
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
Returns True on success.
... | python | def create_new_sticker_set(self, user_id, name, title, png_sticker, emojis, contains_masks=None,
mask_position=None):
"""
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
Returns True on success.
... | [
"def",
"create_new_sticker_set",
"(",
"self",
",",
"user_id",
",",
"name",
",",
"title",
",",
"png_sticker",
",",
"emojis",
",",
"contains_masks",
"=",
"None",
",",
"mask_position",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"create_new_sticker_set",
"... | Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
Returns True on success.
:param user_id:
:param name:
:param title:
:param png_sticker:
:param emojis:
:param contains_masks:
:param mask_posit... | [
"Use",
"this",
"method",
"to",
"create",
"new",
"sticker",
"set",
"owned",
"by",
"a",
"user",
".",
"The",
"bot",
"will",
"be",
"able",
"to",
"edit",
"the",
"created",
"sticker",
"set",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"user_i... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1129-L1144 | train | This method creates a new sticker set owned by a user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.add_sticker_to_set | def add_sticker_to_set(self, user_id, name, png_sticker, emojis, mask_position=None):
"""
Use this method to add a new sticker to a set created by the bot. Returns True on success.
:param user_id:
:param name:
:param png_sticker:
:param emojis:
:param mask_positio... | python | def add_sticker_to_set(self, user_id, name, png_sticker, emojis, mask_position=None):
"""
Use this method to add a new sticker to a set created by the bot. Returns True on success.
:param user_id:
:param name:
:param png_sticker:
:param emojis:
:param mask_positio... | [
"def",
"add_sticker_to_set",
"(",
"self",
",",
"user_id",
",",
"name",
",",
"png_sticker",
",",
"emojis",
",",
"mask_position",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"add_sticker_to_set",
"(",
"self",
".",
"token",
",",
"user_id",
",",
"name",
... | Use this method to add a new sticker to a set created by the bot. Returns True on success.
:param user_id:
:param name:
:param png_sticker:
:param emojis:
:param mask_position:
:return: | [
"Use",
"this",
"method",
"to",
"add",
"a",
"new",
"sticker",
"to",
"a",
"set",
"created",
"by",
"the",
"bot",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"user_id",
":",
":",
"param",
"name",
":",
":",
"param",
"png_sticker",
":",
":"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1146-L1156 | train | Add a new sticker to a set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.set_sticker_position_in_set | def set_sticker_position_in_set(self, sticker, position):
"""
Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
:param sticker:
:param position:
:return:
"""
return apihelper.set_sticker_position_in_set... | python | def set_sticker_position_in_set(self, sticker, position):
"""
Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
:param sticker:
:param position:
:return:
"""
return apihelper.set_sticker_position_in_set... | [
"def",
"set_sticker_position_in_set",
"(",
"self",
",",
"sticker",
",",
"position",
")",
":",
"return",
"apihelper",
".",
"set_sticker_position_in_set",
"(",
"self",
".",
"token",
",",
"sticker",
",",
"position",
")"
] | Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
:param sticker:
:param position:
:return: | [
"Use",
"this",
"method",
"to",
"move",
"a",
"sticker",
"in",
"a",
"set",
"created",
"by",
"the",
"bot",
"to",
"a",
"specific",
"position",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"sticker",
":",
":",
"param",
"position",
":",
":",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1158-L1165 | train | Move a sticker in a specific set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.register_for_reply | def register_for_reply(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message: The message for which we are aw... | python | def register_for_reply(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message: The message for which we are aw... | [
"def",
"register_for_reply",
"(",
"self",
",",
"message",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"message_id",
"=",
"message",
".",
"message_id",
"self",
".",
"register_for_reply_by_message_id",
"(",
"message_id",
",",
"callback"... | Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message: The message for which we are awaiting a reply.
:param callback: The callback function to be called when a ... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"a",
"reply",
"to",
"message",
"arrives",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1175-L1186 | train | Registers a callback function to be notified when a reply to a message arrives. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.register_for_reply_by_message_id | def register_for_reply_by_message_id(self, message_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message_id: The id of the ... | python | def register_for_reply_by_message_id(self, message_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message_id: The id of the ... | [
"def",
"register_for_reply_by_message_id",
"(",
"self",
",",
"message_id",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"message_id",
"in",
"self",
".",
"reply_handlers",
".",
"keys",
"(",
")",
":",
"self",
".",
"reply_handle... | Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message_id: The id of the message for which we are awaiting a reply.
:param callback: The callback function to be call... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"a",
"reply",
"to",
"message",
"arrives",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1188-L1203 | train | Registers a callback function to be notified when a reply to a message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.register_next_step_handler | def register_next_step_handler(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param message: The message ... | python | def register_next_step_handler(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param message: The message ... | [
"def",
"register_next_step_handler",
"(",
"self",
",",
"message",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"chat_id",
"=",
"message",
".",
"chat",
".",
"id",
"self",
".",
"register_next_step_handler_by_chat_id",
"(",
"chat_id",
"... | Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param message: The message for which we want to handle new message in the same chat.
:param callback: The call... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"new",
"message",
"arrives",
"after",
"message",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1217-L1229 | train | Registers a callback function to be notified when new message arrives after message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.register_next_step_handler_by_chat_id | def register_next_step_handler_by_chat_id(self, chat_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param chat_id: T... | python | def register_next_step_handler_by_chat_id(self, chat_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param chat_id: T... | [
"def",
"register_next_step_handler_by_chat_id",
"(",
"self",
",",
"chat_id",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"chat_id",
"in",
"self",
".",
"next_step_handlers",
".",
"keys",
"(",
")",
":",
"self",
".",
"next_step... | Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param chat_id: The chat for which we want to handle new message.
:param callback: The callback function which ... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"new",
"message",
"arrives",
"after",
"message",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1231-L1248 | train | Registers a callback function to be notified when new message arrives after a chat. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.clear_step_handler | def clear_step_handler(self, message):
"""
Clears all callback functions registered by register_next_step_handler().
:param message: The message for which we want to handle new message after that in same chat.
"""
chat_id = message.chat.id
self.clear_step_handler_by_... | python | def clear_step_handler(self, message):
"""
Clears all callback functions registered by register_next_step_handler().
:param message: The message for which we want to handle new message after that in same chat.
"""
chat_id = message.chat.id
self.clear_step_handler_by_... | [
"def",
"clear_step_handler",
"(",
"self",
",",
"message",
")",
":",
"chat_id",
"=",
"message",
".",
"chat",
".",
"id",
"self",
".",
"clear_step_handler_by_chat_id",
"(",
"chat_id",
")"
] | Clears all callback functions registered by register_next_step_handler().
:param message: The message for which we want to handle new message after that in same chat. | [
"Clears",
"all",
"callback",
"functions",
"registered",
"by",
"register_next_step_handler",
"()",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1250-L1257 | train | Clears all callback functions registered by register_next_step_handler. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.clear_step_handler_by_chat_id | def clear_step_handler_by_chat_id(self, chat_id):
"""
Clears all callback functions registered by register_next_step_handler().
:param chat_id: The chat for which we want to clear next step handlers
"""
self.next_step_handlers[chat_id] = []
if self.next_step_saver is no... | python | def clear_step_handler_by_chat_id(self, chat_id):
"""
Clears all callback functions registered by register_next_step_handler().
:param chat_id: The chat for which we want to clear next step handlers
"""
self.next_step_handlers[chat_id] = []
if self.next_step_saver is no... | [
"def",
"clear_step_handler_by_chat_id",
"(",
"self",
",",
"chat_id",
")",
":",
"self",
".",
"next_step_handlers",
"[",
"chat_id",
"]",
"=",
"[",
"]",
"if",
"self",
".",
"next_step_saver",
"is",
"not",
"None",
":",
"self",
".",
"next_step_saver",
".",
"start_... | Clears all callback functions registered by register_next_step_handler().
:param chat_id: The chat for which we want to clear next step handlers | [
"Clears",
"all",
"callback",
"functions",
"registered",
"by",
"register_next_step_handler",
"()",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1259-L1268 | train | Clears all callback functions registered by register_next_step_handler. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.clear_reply_handlers_by_message_id | def clear_reply_handlers_by_message_id(self, message_id):
"""
Clears all callback functions registered by register_for_reply() and register_for_reply_by_message_id().
:param message_id: The message id for which we want to clear reply handlers
"""
self.reply_handlers[message_id] ... | python | def clear_reply_handlers_by_message_id(self, message_id):
"""
Clears all callback functions registered by register_for_reply() and register_for_reply_by_message_id().
:param message_id: The message id for which we want to clear reply handlers
"""
self.reply_handlers[message_id] ... | [
"def",
"clear_reply_handlers_by_message_id",
"(",
"self",
",",
"message_id",
")",
":",
"self",
".",
"reply_handlers",
"[",
"message_id",
"]",
"=",
"[",
"]",
"if",
"self",
".",
"reply_saver",
"is",
"not",
"None",
":",
"self",
".",
"reply_saver",
".",
"start_s... | Clears all callback functions registered by register_for_reply() and register_for_reply_by_message_id().
:param message_id: The message id for which we want to clear reply handlers | [
"Clears",
"all",
"callback",
"functions",
"registered",
"by",
"register_for_reply",
"()",
"and",
"register_for_reply_by_message_id",
"()",
"."
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1279-L1288 | train | Clears all callback functions registered by register_for_reply and register_for_reply_by_message_id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
eternnoir/pyTelegramBotAPI | telebot/__init__.py | TeleBot.message_handler | def message_handler(self, commands=None, regexp=None, func=None, content_types=['text'], **kwargs):
"""
Message handler decorator.
This decorator can be used to decorate functions that must handle certain types of messages.
All message handlers are tested in the order they were added.
... | python | def message_handler(self, commands=None, regexp=None, func=None, content_types=['text'], **kwargs):
"""
Message handler decorator.
This decorator can be used to decorate functions that must handle certain types of messages.
All message handlers are tested in the order they were added.
... | [
"def",
"message_handler",
"(",
"self",
",",
"commands",
"=",
"None",
",",
"regexp",
"=",
"None",
",",
"func",
"=",
"None",
",",
"content_types",
"=",
"[",
"'text'",
"]",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"decorator",
"(",
"handler",
")",
":",... | Message handler decorator.
This decorator can be used to decorate functions that must handle certain types of messages.
All message handlers are tested in the order they were added.
Example:
bot = TeleBot('TOKEN')
# Handles all messages which text matches regexp.
@bot.... | [
"Message",
"handler",
"decorator",
".",
"This",
"decorator",
"can",
"be",
"used",
"to",
"decorate",
"functions",
"that",
"must",
"handle",
"certain",
"types",
"of",
"messages",
".",
"All",
"message",
"handlers",
"are",
"tested",
"in",
"the",
"order",
"they",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1315-L1357 | train | This is a class method that can be used to add a message handler to the TeleBot object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | generate_code | def generate_code(max_length, max_nest, ops):
"""Generates code samples.
Args:
max_length: int. max literal length.
max_nest: int. max nesting level.
ops: CodeOp. set of allowable operations.
Returns:
1. (str) output value.
2. (str) Code operation.
"""
stack = []
def fetch_one():
... | python | def generate_code(max_length, max_nest, ops):
"""Generates code samples.
Args:
max_length: int. max literal length.
max_nest: int. max nesting level.
ops: CodeOp. set of allowable operations.
Returns:
1. (str) output value.
2. (str) Code operation.
"""
stack = []
def fetch_one():
... | [
"def",
"generate_code",
"(",
"max_length",
",",
"max_nest",
",",
"ops",
")",
":",
"stack",
"=",
"[",
"]",
"def",
"fetch_one",
"(",
")",
":",
"# Always use an existing nested value for one of the operands.",
"if",
"stack",
":",
"return",
"stack",
".",
"pop",
"(",... | Generates code samples.
Args:
max_length: int. max literal length.
max_nest: int. max nesting level.
ops: CodeOp. set of allowable operations.
Returns:
1. (str) output value.
2. (str) Code operation. | [
"Generates",
"code",
"samples",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L539-L577 | train | Generates code samples. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | get_tokens | def get_tokens(max_value):
"""Defines tokens.
Args:
max_value: the maximum numeric range for the token.
Returns:
list of string tokens in vocabulary.
"""
vocab = [str(i) for i in range(max_value)]
vocab = set(vocab)
vocab.update(CodeOp.LITERALS)
vocab.update(CodeOp.KEYWORDS)
vocab |= set("".... | python | def get_tokens(max_value):
"""Defines tokens.
Args:
max_value: the maximum numeric range for the token.
Returns:
list of string tokens in vocabulary.
"""
vocab = [str(i) for i in range(max_value)]
vocab = set(vocab)
vocab.update(CodeOp.LITERALS)
vocab.update(CodeOp.KEYWORDS)
vocab |= set("".... | [
"def",
"get_tokens",
"(",
"max_value",
")",
":",
"vocab",
"=",
"[",
"str",
"(",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"max_value",
")",
"]",
"vocab",
"=",
"set",
"(",
"vocab",
")",
"vocab",
".",
"update",
"(",
"CodeOp",
".",
"LITERALS",
")",
... | Defines tokens.
Args:
max_value: the maximum numeric range for the token.
Returns:
list of string tokens in vocabulary. | [
"Defines",
"tokens",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L580-L594 | train | Defines tokens.
Returns a list of string tokens in vocabulary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | LearnToExecute | def LearnToExecute( # pylint: disable=invalid-name
batch_size, max_length=1, max_nesting=1, token_by_char=True,
mode=Mode.TRAIN_COMBINE, loss_threshold=0.1,
min_tries=DEFAULT_MIN_CURRICULUM_EVAL_TRIES, task_type=TaskType.ALG_CTRL):
"""Factory method for LearnToExecute Dataset module.
Args:
batch_... | python | def LearnToExecute( # pylint: disable=invalid-name
batch_size, max_length=1, max_nesting=1, token_by_char=True,
mode=Mode.TRAIN_COMBINE, loss_threshold=0.1,
min_tries=DEFAULT_MIN_CURRICULUM_EVAL_TRIES, task_type=TaskType.ALG_CTRL):
"""Factory method for LearnToExecute Dataset module.
Args:
batch_... | [
"def",
"LearnToExecute",
"(",
"# pylint: disable=invalid-name",
"batch_size",
",",
"max_length",
"=",
"1",
",",
"max_nesting",
"=",
"1",
",",
"token_by_char",
"=",
"True",
",",
"mode",
"=",
"Mode",
".",
"TRAIN_COMBINE",
",",
"loss_threshold",
"=",
"0.1",
",",
... | Factory method for LearnToExecute Dataset module.
Args:
batch_size: (int). The number of elements in a mini-batch.
max_length: (int). Maximum character length.
max_nesting: (int). Maximum level of statement nesting.
token_by_char: (bool). Tokenize by character or words?
mode: (string). Either 'tr... | [
"Factory",
"method",
"for",
"LearnToExecute",
"Dataset",
"module",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L994-L1043 | train | LearnToExecute Dataset module. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | MixCurriculum.fetch | def fetch(self):
"""Samples up to maximum difficulty."""
length = np.random.randint(1, self._max_length + 1)
nesting = np.random.randint(1, self._max_length + 1)
return length, nesting | python | def fetch(self):
"""Samples up to maximum difficulty."""
length = np.random.randint(1, self._max_length + 1)
nesting = np.random.randint(1, self._max_length + 1)
return length, nesting | [
"def",
"fetch",
"(",
"self",
")",
":",
"length",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_max_length",
"+",
"1",
")",
"nesting",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_max_length",
"... | Samples up to maximum difficulty. | [
"Samples",
"up",
"to",
"maximum",
"difficulty",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L234-L238 | train | Samples up to maximum difficulty. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | CombineCurriculum.update | def update(self, loss, force=False):
"""Increments level difficulty (length and nesting) by 1 until maximum."""
do_update = super(CombineCurriculum, self).update(loss, force)
if not do_update:
return False
if self._curr_length < self._max_length:
self._curr_length += 1
elif self._curr_n... | python | def update(self, loss, force=False):
"""Increments level difficulty (length and nesting) by 1 until maximum."""
do_update = super(CombineCurriculum, self).update(loss, force)
if not do_update:
return False
if self._curr_length < self._max_length:
self._curr_length += 1
elif self._curr_n... | [
"def",
"update",
"(",
"self",
",",
"loss",
",",
"force",
"=",
"False",
")",
":",
"do_update",
"=",
"super",
"(",
"CombineCurriculum",
",",
"self",
")",
".",
"update",
"(",
"loss",
",",
"force",
")",
"if",
"not",
"do_update",
":",
"return",
"False",
"... | Increments level difficulty (length and nesting) by 1 until maximum. | [
"Increments",
"level",
"difficulty",
"(",
"length",
"and",
"nesting",
")",
"by",
"1",
"until",
"maximum",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L255-L271 | train | Increments level difficulty by 1 until maximum. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | CombineCurriculum.fetch | def fetch(self):
"""Samples up to current difficulty."""
length = np.random.randint(1, self._curr_length + 1)
nesting = np.random.randint(1, self._curr_nesting + 1)
return length, nesting | python | def fetch(self):
"""Samples up to current difficulty."""
length = np.random.randint(1, self._curr_length + 1)
nesting = np.random.randint(1, self._curr_nesting + 1)
return length, nesting | [
"def",
"fetch",
"(",
"self",
")",
":",
"length",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_curr_length",
"+",
"1",
")",
"nesting",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_curr_nesting",
... | Samples up to current difficulty. | [
"Samples",
"up",
"to",
"current",
"difficulty",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L273-L277 | train | Samples up to current difficulty. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | TokenDataSource.generate_flat_data | def generate_flat_data(self):
"""Generates batched data in flat numpy arrays.
Raises:
ValueError: When too many generate calls are required.
"""
# Construct the string statements.
all_statements = []
all_targets = []
self.sequence_sizes_in = []
self.sequence_sizes_out = []
for... | python | def generate_flat_data(self):
"""Generates batched data in flat numpy arrays.
Raises:
ValueError: When too many generate calls are required.
"""
# Construct the string statements.
all_statements = []
all_targets = []
self.sequence_sizes_in = []
self.sequence_sizes_out = []
for... | [
"def",
"generate_flat_data",
"(",
"self",
")",
":",
"# Construct the string statements.",
"all_statements",
"=",
"[",
"]",
"all_targets",
"=",
"[",
"]",
"self",
".",
"sequence_sizes_in",
"=",
"[",
"]",
"self",
".",
"sequence_sizes_out",
"=",
"[",
"]",
"for",
"... | Generates batched data in flat numpy arrays.
Raises:
ValueError: When too many generate calls are required. | [
"Generates",
"batched",
"data",
"in",
"flat",
"numpy",
"arrays",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L656-L699 | train | Generates batched data in flat numpy arrays. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | TokenDataSource.tokenize | def tokenize(self, char_input, max_len, by_char=False):
"""Produces the list of integer indices corresponding to a token list.
Args:
char_input: The character string to be tokenized.
max_len: Truncation length.
by_char: If true each character is a token - otherwise alpha-numeric
... | python | def tokenize(self, char_input, max_len, by_char=False):
"""Produces the list of integer indices corresponding to a token list.
Args:
char_input: The character string to be tokenized.
max_len: Truncation length.
by_char: If true each character is a token - otherwise alpha-numeric
... | [
"def",
"tokenize",
"(",
"self",
",",
"char_input",
",",
"max_len",
",",
"by_char",
"=",
"False",
")",
":",
"if",
"by_char",
":",
"tokenized_list",
"=",
"[",
"self",
".",
"_vocab_dict",
"[",
"token",
"]",
"for",
"token",
"in",
"char_input",
"]",
"else",
... | Produces the list of integer indices corresponding to a token list.
Args:
char_input: The character string to be tokenized.
max_len: Truncation length.
by_char: If true each character is a token - otherwise alpha-numeric
groupings are tokens.
Returns:
A padded list of st... | [
"Produces",
"the",
"list",
"of",
"integer",
"indices",
"corresponding",
"to",
"a",
"token",
"list",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L701-L747 | train | Takes a character string and returns a list of integer indices corresponding to a token list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | LearnToExecuteState.get_task_ops | def get_task_ops(task_type=TaskType.ALG_CTRL):
"""Returns an operations list based on the specified task index.
Args:
task_type: indicates the task type used.
Returns:
List of the eligible ops.
"""
try:
return LearnToExecuteState.TASK_TYPE_OPS[task_type]
except KeyError:
... | python | def get_task_ops(task_type=TaskType.ALG_CTRL):
"""Returns an operations list based on the specified task index.
Args:
task_type: indicates the task type used.
Returns:
List of the eligible ops.
"""
try:
return LearnToExecuteState.TASK_TYPE_OPS[task_type]
except KeyError:
... | [
"def",
"get_task_ops",
"(",
"task_type",
"=",
"TaskType",
".",
"ALG_CTRL",
")",
":",
"try",
":",
"return",
"LearnToExecuteState",
".",
"TASK_TYPE_OPS",
"[",
"task_type",
"]",
"except",
"KeyError",
":",
"raise",
"KeyError",
"(",
"\"Bad task_type '%s', check config.\"... | Returns an operations list based on the specified task index.
Args:
task_type: indicates the task type used.
Returns:
List of the eligible ops. | [
"Returns",
"an",
"operations",
"list",
"based",
"on",
"the",
"specified",
"task",
"index",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L863-L875 | train | Returns an operations list based on the specified task type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | LearnToExecuteState.make_batch | def make_batch(self):
"""Generator function for batchifying data for learning to execute.
Yields:
tuple:
1. one-hot input tensor, representing programmatic input
2. one-hot target tensor, the vealuation result.
3. one-hot decoder target, start symbol added for sequence decoding.
... | python | def make_batch(self):
"""Generator function for batchifying data for learning to execute.
Yields:
tuple:
1. one-hot input tensor, representing programmatic input
2. one-hot target tensor, the vealuation result.
3. one-hot decoder target, start symbol added for sequence decoding.
... | [
"def",
"make_batch",
"(",
"self",
")",
":",
"while",
"True",
":",
"self",
".",
"reset_data_source",
"(",
")",
"obs",
"=",
"np",
".",
"reshape",
"(",
"self",
".",
"_data_source",
".",
"flat_data",
",",
"[",
"self",
".",
"batch_size",
",",
"-",
"1",
"]... | Generator function for batchifying data for learning to execute.
Yields:
tuple:
1. one-hot input tensor, representing programmatic input
2. one-hot target tensor, the vealuation result.
3. one-hot decoder target, start symbol added for sequence decoding.
4. batch size tensor c... | [
"Generator",
"function",
"for",
"batchifying",
"data",
"for",
"learning",
"to",
"execute",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L932-L957 | train | Generates a batch of data for learning. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/learn_to_execute.py | LearnToExecuteState.to_human_readable | def to_human_readable(self, data, label_batch_entries=True, indices=None,
sep="\n"):
"""Returns a human-readable version of a one-hot encoding of words.
Args:
data: (numpy.ndarray S x B x OH). One-hot encoding of words. S is
sequence length, B is batch size, OH is one ho... | python | def to_human_readable(self, data, label_batch_entries=True, indices=None,
sep="\n"):
"""Returns a human-readable version of a one-hot encoding of words.
Args:
data: (numpy.ndarray S x B x OH). One-hot encoding of words. S is
sequence length, B is batch size, OH is one ho... | [
"def",
"to_human_readable",
"(",
"self",
",",
"data",
",",
"label_batch_entries",
"=",
"True",
",",
"indices",
"=",
"None",
",",
"sep",
"=",
"\"\\n\"",
")",
":",
"batch_size",
"=",
"data",
".",
"shape",
"[",
"1",
"]",
"result",
"=",
"[",
"]",
"indices"... | Returns a human-readable version of a one-hot encoding of words.
Args:
data: (numpy.ndarray S x B x OH). One-hot encoding of words. S is
sequence length, B is batch size, OH is one hot dimensionality.
label_batch_entries: (bool). Whether to add numerical label before each
batch elem... | [
"Returns",
"a",
"human",
"-",
"readable",
"version",
"of",
"a",
"one",
"-",
"hot",
"encoding",
"of",
"words",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L959-L983 | train | Returns a human - readable version of a one - hot encoding of words. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/batch_norm.py | BatchNorm._infer_fused_data_format | def _infer_fused_data_format(self, input_batch):
"""Infers the data format for the fused batch norm.
It uses the axis option to infer this information. Specifically, the
axis value (0, 1, 2) corresponds to data format NHWC and the
axis value (0, 2, 3) to data format NCHW.
Args:
input_batch: ... | python | def _infer_fused_data_format(self, input_batch):
"""Infers the data format for the fused batch norm.
It uses the axis option to infer this information. Specifically, the
axis value (0, 1, 2) corresponds to data format NHWC and the
axis value (0, 2, 3) to data format NCHW.
Args:
input_batch: ... | [
"def",
"_infer_fused_data_format",
"(",
"self",
",",
"input_batch",
")",
":",
"input_shape",
"=",
"input_batch",
".",
"get_shape",
"(",
")",
".",
"as_list",
"(",
")",
"input_shape_len",
"=",
"len",
"(",
"input_shape",
")",
"if",
"input_shape_len",
"!=",
"4",
... | Infers the data format for the fused batch norm.
It uses the axis option to infer this information. Specifically, the
axis value (0, 1, 2) corresponds to data format NHWC and the
axis value (0, 2, 3) to data format NCHW.
Args:
input_batch: A Tensor of arbitrary dimension.
Returns:
A s... | [
"Infers",
"the",
"data",
"format",
"for",
"the",
"fused",
"batch",
"norm",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/batch_norm.py#L325-L359 | train | Infer the data format for the fused batch norm. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/batch_norm.py | BatchNorm._fused_batch_norm_op | def _fused_batch_norm_op(self, input_batch, mean, variance, use_batch_stats):
"""Creates a fused batch normalization op."""
# Store the original shape of the mean and variance.
mean_shape = mean.get_shape()
variance_shape = variance.get_shape()
# The fused batch norm expects the mean, variance, gamm... | python | def _fused_batch_norm_op(self, input_batch, mean, variance, use_batch_stats):
"""Creates a fused batch normalization op."""
# Store the original shape of the mean and variance.
mean_shape = mean.get_shape()
variance_shape = variance.get_shape()
# The fused batch norm expects the mean, variance, gamm... | [
"def",
"_fused_batch_norm_op",
"(",
"self",
",",
"input_batch",
",",
"mean",
",",
"variance",
",",
"use_batch_stats",
")",
":",
"# Store the original shape of the mean and variance.",
"mean_shape",
"=",
"mean",
".",
"get_shape",
"(",
")",
"variance_shape",
"=",
"varia... | Creates a fused batch normalization op. | [
"Creates",
"a",
"fused",
"batch",
"normalization",
"op",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/batch_norm.py#L361-L398 | train | Creates a fused batch normalization op. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/batch_norm.py | BatchNorm._batch_norm_op | def _batch_norm_op(self, input_batch, mean, variance, use_batch_stats,
stat_dtype):
"""Creates a batch normalization op.
It uses the tf.nn.batch_normalization op by default and the
tf.nn.fused_batch_norm op to support fused batch normalization.
Args:
input_batch: A input Ten... | python | def _batch_norm_op(self, input_batch, mean, variance, use_batch_stats,
stat_dtype):
"""Creates a batch normalization op.
It uses the tf.nn.batch_normalization op by default and the
tf.nn.fused_batch_norm op to support fused batch normalization.
Args:
input_batch: A input Ten... | [
"def",
"_batch_norm_op",
"(",
"self",
",",
"input_batch",
",",
"mean",
",",
"variance",
",",
"use_batch_stats",
",",
"stat_dtype",
")",
":",
"if",
"self",
".",
"_fused",
":",
"# For the non-training case where not using batch stats,",
"# pass in the moving statistic varia... | Creates a batch normalization op.
It uses the tf.nn.batch_normalization op by default and the
tf.nn.fused_batch_norm op to support fused batch normalization.
Args:
input_batch: A input Tensor of arbitrary dimension.
mean: A mean tensor, of the same dtype as `input_batch`.
variance: A var... | [
"Creates",
"a",
"batch",
"normalization",
"op",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/batch_norm.py#L400-L442 | train | Creates a batch normalization op. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/batch_norm.py | BatchNorm._build_scale_offset | def _build_scale_offset(self, dtype):
"""Sets up optional scale and offset factors."""
# tf.nn.fused_batch_norm accepts float16 batch data, but not scale/offset.
if self._fused and dtype == tf.float16:
dtype = tf.float32
# The fused batch norm operation needs the beta, gamma variables,
# so ... | python | def _build_scale_offset(self, dtype):
"""Sets up optional scale and offset factors."""
# tf.nn.fused_batch_norm accepts float16 batch data, but not scale/offset.
if self._fused and dtype == tf.float16:
dtype = tf.float32
# The fused batch norm operation needs the beta, gamma variables,
# so ... | [
"def",
"_build_scale_offset",
"(",
"self",
",",
"dtype",
")",
":",
"# tf.nn.fused_batch_norm accepts float16 batch data, but not scale/offset.",
"if",
"self",
".",
"_fused",
"and",
"dtype",
"==",
"tf",
".",
"float16",
":",
"dtype",
"=",
"tf",
".",
"float32",
"# The ... | Sets up optional scale and offset factors. | [
"Sets",
"up",
"optional",
"scale",
"and",
"offset",
"factors",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/batch_norm.py#L444-L478 | train | Sets up optional scale and offset factors. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/batch_norm.py | BatchNorm._build | def _build(self, input_batch, is_training, test_local_stats=True):
"""Connects the BatchNorm module into the graph.
Args:
input_batch: A Tensor of arbitrary dimension. By default, the final
dimension is not reduced over when computing the minibatch statistics.
is_training: A boolean to indi... | python | def _build(self, input_batch, is_training, test_local_stats=True):
"""Connects the BatchNorm module into the graph.
Args:
input_batch: A Tensor of arbitrary dimension. By default, the final
dimension is not reduced over when computing the minibatch statistics.
is_training: A boolean to indi... | [
"def",
"_build",
"(",
"self",
",",
"input_batch",
",",
"is_training",
",",
"test_local_stats",
"=",
"True",
")",
":",
"input_shape",
"=",
"input_batch",
".",
"get_shape",
"(",
")",
"if",
"self",
".",
"_axis",
"is",
"not",
"None",
":",
"if",
"len",
"(",
... | Connects the BatchNorm module into the graph.
Args:
input_batch: A Tensor of arbitrary dimension. By default, the final
dimension is not reduced over when computing the minibatch statistics.
is_training: A boolean to indicate if the module should be connected in
training mode, meaning t... | [
"Connects",
"the",
"BatchNorm",
"module",
"into",
"the",
"graph",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/batch_norm.py#L480-L557 | train | Connects the BatchNorm module into the graph. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/dataset_shakespeare.py | TokenDataSource.tokenize | def tokenize(self, token_list):
"""Produces the list of integer indices corresponding to a token list."""
return [
self._vocab_dict.get(token, self._vocab_dict[self.UNK])
for token in token_list
] | python | def tokenize(self, token_list):
"""Produces the list of integer indices corresponding to a token list."""
return [
self._vocab_dict.get(token, self._vocab_dict[self.UNK])
for token in token_list
] | [
"def",
"tokenize",
"(",
"self",
",",
"token_list",
")",
":",
"return",
"[",
"self",
".",
"_vocab_dict",
".",
"get",
"(",
"token",
",",
"self",
".",
"_vocab_dict",
"[",
"self",
".",
"UNK",
"]",
")",
"for",
"token",
"in",
"token_list",
"]"
] | Produces the list of integer indices corresponding to a token list. | [
"Produces",
"the",
"list",
"of",
"integer",
"indices",
"corresponding",
"to",
"a",
"token",
"list",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/dataset_shakespeare.py#L81-L86 | train | Produces the list of integer indices corresponding to a token list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/dataset_shakespeare.py | TinyShakespeareDataset._get_batch | def _get_batch(self):
"""Returns a batch of sequences.
Returns:
obs: np.int32 array of size [Time, Batch]
target: np.int32 array of size [Time, Batch]
"""
batch_indices = np.mod(
np.array([
np.arange(head_index, head_index + self._num_steps + 1) for
head_inde... | python | def _get_batch(self):
"""Returns a batch of sequences.
Returns:
obs: np.int32 array of size [Time, Batch]
target: np.int32 array of size [Time, Batch]
"""
batch_indices = np.mod(
np.array([
np.arange(head_index, head_index + self._num_steps + 1) for
head_inde... | [
"def",
"_get_batch",
"(",
"self",
")",
":",
"batch_indices",
"=",
"np",
".",
"mod",
"(",
"np",
".",
"array",
"(",
"[",
"np",
".",
"arange",
"(",
"head_index",
",",
"head_index",
"+",
"self",
".",
"_num_steps",
"+",
"1",
")",
"for",
"head_index",
"in"... | Returns a batch of sequences.
Returns:
obs: np.int32 array of size [Time, Batch]
target: np.int32 array of size [Time, Batch] | [
"Returns",
"a",
"batch",
"of",
"sequences",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/dataset_shakespeare.py#L156-L181 | train | Returns a batch of sequences. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/dataset_shakespeare.py | TinyShakespeareDataset._build | def _build(self):
"""Returns a tuple containing observation and target one-hot tensors."""
q = tf.FIFOQueue(
self._queue_capacity, [self._dtype, self._dtype],
shapes=[[self._num_steps, self._batch_size, self._vocab_size]]*2)
obs, target = tf.py_func(self._get_batch, [], [tf.int32, tf.int32])... | python | def _build(self):
"""Returns a tuple containing observation and target one-hot tensors."""
q = tf.FIFOQueue(
self._queue_capacity, [self._dtype, self._dtype],
shapes=[[self._num_steps, self._batch_size, self._vocab_size]]*2)
obs, target = tf.py_func(self._get_batch, [], [tf.int32, tf.int32])... | [
"def",
"_build",
"(",
"self",
")",
":",
"q",
"=",
"tf",
".",
"FIFOQueue",
"(",
"self",
".",
"_queue_capacity",
",",
"[",
"self",
".",
"_dtype",
",",
"self",
".",
"_dtype",
"]",
",",
"shapes",
"=",
"[",
"[",
"self",
".",
"_num_steps",
",",
"self",
... | Returns a tuple containing observation and target one-hot tensors. | [
"Returns",
"a",
"tuple",
"containing",
"observation",
"and",
"target",
"one",
"-",
"hot",
"tensors",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/dataset_shakespeare.py#L183-L194 | train | Builds the sequence data ops. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/dataset_shakespeare.py | TinyShakespeareDataset.cost | def cost(self, logits, target):
"""Returns cost.
Args:
logits: model output.
target: target.
Returns:
Cross-entropy loss for a sequence of logits. The loss will be averaged
across time steps if time_average_cost was enabled at construction time.
"""
logits = tf.reshape(logi... | python | def cost(self, logits, target):
"""Returns cost.
Args:
logits: model output.
target: target.
Returns:
Cross-entropy loss for a sequence of logits. The loss will be averaged
across time steps if time_average_cost was enabled at construction time.
"""
logits = tf.reshape(logi... | [
"def",
"cost",
"(",
"self",
",",
"logits",
",",
"target",
")",
":",
"logits",
"=",
"tf",
".",
"reshape",
"(",
"logits",
",",
"[",
"self",
".",
"_num_steps",
"*",
"self",
".",
"_batch_size",
",",
"-",
"1",
"]",
")",
"target",
"=",
"tf",
".",
"resh... | Returns cost.
Args:
logits: model output.
target: target.
Returns:
Cross-entropy loss for a sequence of logits. The loss will be averaged
across time steps if time_average_cost was enabled at construction time. | [
"Returns",
"cost",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/dataset_shakespeare.py#L196-L212 | train | Returns the cost for a sequence of logits and target. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/dataset_shakespeare.py | TinyShakespeareDataset.to_human_readable | def to_human_readable(self,
data,
label_batch_entries=True,
indices=None,
sep="\n"):
"""Returns a human-readable version of a one-hot encoding of words.
Args:
data: A tuple with (obs, target). `obs` is a numpy... | python | def to_human_readable(self,
data,
label_batch_entries=True,
indices=None,
sep="\n"):
"""Returns a human-readable version of a one-hot encoding of words.
Args:
data: A tuple with (obs, target). `obs` is a numpy... | [
"def",
"to_human_readable",
"(",
"self",
",",
"data",
",",
"label_batch_entries",
"=",
"True",
",",
"indices",
"=",
"None",
",",
"sep",
"=",
"\"\\n\"",
")",
":",
"obs",
"=",
"data",
"[",
"0",
"]",
"batch_size",
"=",
"obs",
".",
"shape",
"[",
"1",
"]"... | Returns a human-readable version of a one-hot encoding of words.
Args:
data: A tuple with (obs, target). `obs` is a numpy array with one-hot
encoding of words.
label_batch_entries: bool. Whether to add numerical label before each
batch element in the output string.
indices: Li... | [
"Returns",
"a",
"human",
"-",
"readable",
"version",
"of",
"a",
"one",
"-",
"hot",
"encoding",
"of",
"words",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/dataset_shakespeare.py#L214-L242 | train | Returns a human - readable version of a one - hot encoding of words. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/examples/dataset_mnist_cifar10.py | get_data | def get_data(name, train_batch_size, test_batch_size):
"""Gets training and testing dataset iterators.
Args:
name: String. Name of dataset, either 'mnist' or 'cifar10'.
train_batch_size: Integer. Batch size for training.
test_batch_size: Integer. Batch size for testing.
Returns:
Dict containing:... | python | def get_data(name, train_batch_size, test_batch_size):
"""Gets training and testing dataset iterators.
Args:
name: String. Name of dataset, either 'mnist' or 'cifar10'.
train_batch_size: Integer. Batch size for training.
test_batch_size: Integer. Batch size for testing.
Returns:
Dict containing:... | [
"def",
"get_data",
"(",
"name",
",",
"train_batch_size",
",",
"test_batch_size",
")",
":",
"if",
"name",
"not",
"in",
"[",
"'mnist'",
",",
"'cifar10'",
"]",
":",
"raise",
"ValueError",
"(",
"'Expected dataset \\'mnist\\' or \\'cifar10\\', but got %s'",
"%",
"name",
... | Gets training and testing dataset iterators.
Args:
name: String. Name of dataset, either 'mnist' or 'cifar10'.
train_batch_size: Integer. Batch size for training.
test_batch_size: Integer. Batch size for testing.
Returns:
Dict containing:
train_iterator: A tf.data.Iterator, over training dat... | [
"Gets",
"training",
"and",
"testing",
"dataset",
"iterators",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/dataset_mnist_cifar10.py#L34-L87 | train | Returns training and testing dataset iterators. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | get_variable_scope_name | def get_variable_scope_name(value):
"""Returns the name of the variable scope indicated by the given value.
Args:
value: String, variable scope, or object with `variable_scope` attribute
(e.g., Sonnet module).
Returns:
The name (a string) of the corresponding variable scope.
Raises:
ValueErro... | python | def get_variable_scope_name(value):
"""Returns the name of the variable scope indicated by the given value.
Args:
value: String, variable scope, or object with `variable_scope` attribute
(e.g., Sonnet module).
Returns:
The name (a string) of the corresponding variable scope.
Raises:
ValueErro... | [
"def",
"get_variable_scope_name",
"(",
"value",
")",
":",
"# If the object has a \"variable_scope\" property, use it.",
"value",
"=",
"getattr",
"(",
"value",
",",
"\"variable_scope\"",
",",
"value",
")",
"if",
"isinstance",
"(",
"value",
",",
"tf",
".",
"VariableScop... | Returns the name of the variable scope indicated by the given value.
Args:
value: String, variable scope, or object with `variable_scope` attribute
(e.g., Sonnet module).
Returns:
The name (a string) of the corresponding variable scope.
Raises:
ValueError: If `value` does not identify a variabl... | [
"Returns",
"the",
"name",
"of",
"the",
"variable",
"scope",
"indicated",
"by",
"the",
"given",
"value",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L38-L58 | train | Returns the name of the variable scope indicated by the given value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | get_variables_in_scope | def get_variables_in_scope(scope, collection=tf.GraphKeys.TRAINABLE_VARIABLES):
"""Returns a tuple `tf.Variable`s in a scope for a given collection.
Args:
scope: `tf.VariableScope` or string to retrieve variables from.
collection: Collection to restrict query to. By default this is
`tf.Graphkeys.TR... | python | def get_variables_in_scope(scope, collection=tf.GraphKeys.TRAINABLE_VARIABLES):
"""Returns a tuple `tf.Variable`s in a scope for a given collection.
Args:
scope: `tf.VariableScope` or string to retrieve variables from.
collection: Collection to restrict query to. By default this is
`tf.Graphkeys.TR... | [
"def",
"get_variables_in_scope",
"(",
"scope",
",",
"collection",
"=",
"tf",
".",
"GraphKeys",
".",
"TRAINABLE_VARIABLES",
")",
":",
"scope_name",
"=",
"get_variable_scope_name",
"(",
"scope",
")",
"if",
"scope_name",
":",
"# Escape the name in case it contains any \".\... | Returns a tuple `tf.Variable`s in a scope for a given collection.
Args:
scope: `tf.VariableScope` or string to retrieve variables from.
collection: Collection to restrict query to. By default this is
`tf.Graphkeys.TRAINABLE_VARIABLES`, which doesn't include non-trainable
variables such as mov... | [
"Returns",
"a",
"tuple",
"tf",
".",
"Variable",
"s",
"in",
"a",
"scope",
"for",
"a",
"given",
"collection",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L61-L81 | train | Returns a tuple of tf. Variable s in a given scope for a given collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | get_variables_in_module | def get_variables_in_module(module,
collection=tf.GraphKeys.TRAINABLE_VARIABLES):
"""Returns tuple of `tf.Variable`s declared inside an `snt.Module`.
Note that this operates by searching the variable scope a module contains,
and so does not know about any modules which were constructe... | python | def get_variables_in_module(module,
collection=tf.GraphKeys.TRAINABLE_VARIABLES):
"""Returns tuple of `tf.Variable`s declared inside an `snt.Module`.
Note that this operates by searching the variable scope a module contains,
and so does not know about any modules which were constructe... | [
"def",
"get_variables_in_module",
"(",
"module",
",",
"collection",
"=",
"tf",
".",
"GraphKeys",
".",
"TRAINABLE_VARIABLES",
")",
":",
"return",
"module",
".",
"get_variables",
"(",
"collection",
"=",
"collection",
")"
] | Returns tuple of `tf.Variable`s declared inside an `snt.Module`.
Note that this operates by searching the variable scope a module contains,
and so does not know about any modules which were constructed elsewhere but
used inside this module.
Args:
module: `snt.Module` instance to query the scope of.
co... | [
"Returns",
"tuple",
"of",
"tf",
".",
"Variable",
"s",
"declared",
"inside",
"an",
"snt",
".",
"Module",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L84-L104 | train | Returns a tuple of tf. Variable s declared inside a module. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | _check_nested_callables | def _check_nested_callables(dictionary, object_name):
"""Checks if all items in the dictionary and in subdictionaries are callables.
Args:
dictionary: Dictionary of callables or other dictionaries with callables.
object_name: The name of the object that is expected in the dictionary.
E.g. 'Initialize... | python | def _check_nested_callables(dictionary, object_name):
"""Checks if all items in the dictionary and in subdictionaries are callables.
Args:
dictionary: Dictionary of callables or other dictionaries with callables.
object_name: The name of the object that is expected in the dictionary.
E.g. 'Initialize... | [
"def",
"_check_nested_callables",
"(",
"dictionary",
",",
"object_name",
")",
":",
"for",
"key",
",",
"entry",
"in",
"six",
".",
"iteritems",
"(",
"dictionary",
")",
":",
"if",
"hasattr",
"(",
"entry",
",",
"\"items\"",
")",
":",
"_check_nested_callables",
"... | Checks if all items in the dictionary and in subdictionaries are callables.
Args:
dictionary: Dictionary of callables or other dictionaries with callables.
object_name: The name of the object that is expected in the dictionary.
E.g. 'Initializer', 'Partitioner' or 'Regularizer'. The first letter
... | [
"Checks",
"if",
"all",
"items",
"in",
"the",
"dictionary",
"and",
"in",
"subdictionaries",
"are",
"callables",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L107-L126 | train | Checks if all items in the dictionary and all subdictionaries with callables are callables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | _assert_is_dictlike | def _assert_is_dictlike(maybe_dictlike, valid_keys):
"""Raises a TypeError iff `maybe_dictlike` is not a dictlike object."""
# This covers a common mistake when people use incorrect dictionary nesting
# for initializers / partitioners etc. The previous error message was quite
# opaque, this should be much clear... | python | def _assert_is_dictlike(maybe_dictlike, valid_keys):
"""Raises a TypeError iff `maybe_dictlike` is not a dictlike object."""
# This covers a common mistake when people use incorrect dictionary nesting
# for initializers / partitioners etc. The previous error message was quite
# opaque, this should be much clear... | [
"def",
"_assert_is_dictlike",
"(",
"maybe_dictlike",
",",
"valid_keys",
")",
":",
"# This covers a common mistake when people use incorrect dictionary nesting",
"# for initializers / partitioners etc. The previous error message was quite",
"# opaque, this should be much clearer.",
"if",
"not... | Raises a TypeError iff `maybe_dictlike` is not a dictlike object. | [
"Raises",
"a",
"TypeError",
"iff",
"maybe_dictlike",
"is",
"not",
"a",
"dictlike",
"object",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L129-L137 | train | Raises a TypeError iff maybe_dictlike is not a dictlike object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | check_initializers | def check_initializers(initializers, keys):
"""Checks the given initializers.
This checks that `initializers` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `initializers` are functions or
further dictionaries (the latter used, for example, in passing initializers
to module... | python | def check_initializers(initializers, keys):
"""Checks the given initializers.
This checks that `initializers` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `initializers` are functions or
further dictionaries (the latter used, for example, in passing initializers
to module... | [
"def",
"check_initializers",
"(",
"initializers",
",",
"keys",
")",
":",
"if",
"initializers",
"is",
"None",
":",
"return",
"{",
"}",
"_assert_is_dictlike",
"(",
"initializers",
",",
"valid_keys",
"=",
"keys",
")",
"keys",
"=",
"set",
"(",
"keys",
")",
"if... | Checks the given initializers.
This checks that `initializers` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `initializers` are functions or
further dictionaries (the latter used, for example, in passing initializers
to modules inside modules) that must satisfy the same cons... | [
"Checks",
"the",
"given",
"initializers",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L140-L178 | train | Checks that the given initializers are valid and that all of the keys in
are in the given keys. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | check_partitioners | def check_partitioners(partitioners, keys):
"""Checks the given partitioners.
This checks that `partitioners` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `partitioners` are functions or
further dictionaries (the latter used, for example, in passing partitioners
to module... | python | def check_partitioners(partitioners, keys):
"""Checks the given partitioners.
This checks that `partitioners` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `partitioners` are functions or
further dictionaries (the latter used, for example, in passing partitioners
to module... | [
"def",
"check_partitioners",
"(",
"partitioners",
",",
"keys",
")",
":",
"if",
"partitioners",
"is",
"None",
":",
"return",
"{",
"}",
"_assert_is_dictlike",
"(",
"partitioners",
",",
"valid_keys",
"=",
"keys",
")",
"keys",
"=",
"set",
"(",
"keys",
")",
"if... | Checks the given partitioners.
This checks that `partitioners` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `partitioners` are functions or
further dictionaries (the latter used, for example, in passing partitioners
to modules inside modules) that must satisfy the same cons... | [
"Checks",
"the",
"given",
"partitioners",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L181-L219 | train | Checks that the given partitioners are valid and that they are nested dictionaries. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | check_regularizers | def check_regularizers(regularizers, keys):
"""Checks the given regularizers.
This checks that `regularizers` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `regularizers` are functions or
further dictionaries (the latter used, for example, in passing regularizers
to module... | python | def check_regularizers(regularizers, keys):
"""Checks the given regularizers.
This checks that `regularizers` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `regularizers` are functions or
further dictionaries (the latter used, for example, in passing regularizers
to module... | [
"def",
"check_regularizers",
"(",
"regularizers",
",",
"keys",
")",
":",
"if",
"regularizers",
"is",
"None",
":",
"return",
"{",
"}",
"_assert_is_dictlike",
"(",
"regularizers",
",",
"valid_keys",
"=",
"keys",
")",
"keys",
"=",
"set",
"(",
"keys",
")",
"if... | Checks the given regularizers.
This checks that `regularizers` is a dictionary that only contains keys in
`keys`, and furthermore the entries in `regularizers` are functions or
further dictionaries (the latter used, for example, in passing regularizers
to modules inside modules) that must satisfy the same cons... | [
"Checks",
"the",
"given",
"regularizers",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L222-L260 | train | Checks that regularizers are valid and that all of the keys in keys are valid. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | _is_scope_prefix | def _is_scope_prefix(scope_name, prefix_name):
"""Checks that `prefix_name` is a proper scope prefix of `scope_name`."""
if not prefix_name:
return True
if not scope_name.endswith("/"):
scope_name += "/"
if not prefix_name.endswith("/"):
prefix_name += "/"
return scope_name.startswith(prefix_n... | python | def _is_scope_prefix(scope_name, prefix_name):
"""Checks that `prefix_name` is a proper scope prefix of `scope_name`."""
if not prefix_name:
return True
if not scope_name.endswith("/"):
scope_name += "/"
if not prefix_name.endswith("/"):
prefix_name += "/"
return scope_name.startswith(prefix_n... | [
"def",
"_is_scope_prefix",
"(",
"scope_name",
",",
"prefix_name",
")",
":",
"if",
"not",
"prefix_name",
":",
"return",
"True",
"if",
"not",
"scope_name",
".",
"endswith",
"(",
"\"/\"",
")",
":",
"scope_name",
"+=",
"\"/\"",
"if",
"not",
"prefix_name",
".",
... | Checks that `prefix_name` is a proper scope prefix of `scope_name`. | [
"Checks",
"that",
"prefix_name",
"is",
"a",
"proper",
"scope",
"prefix",
"of",
"scope_name",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L263-L275 | train | Checks that prefix_name is a proper scope prefix of scope_name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
deepmind/sonnet | sonnet/python/modules/util.py | _get_sliced_variables | def _get_sliced_variables(var_list):
"""Separates the sliced (partitioned) and unsliced variables in var_list.
Args:
var_list: a list of variables.
Returns:
A list of unsliced variables in var_list, and a dict mapping names to parts
for the sliced variables in var_list.
"""
unsliced_variables = ... | python | def _get_sliced_variables(var_list):
"""Separates the sliced (partitioned) and unsliced variables in var_list.
Args:
var_list: a list of variables.
Returns:
A list of unsliced variables in var_list, and a dict mapping names to parts
for the sliced variables in var_list.
"""
unsliced_variables = ... | [
"def",
"_get_sliced_variables",
"(",
"var_list",
")",
":",
"unsliced_variables",
"=",
"[",
"]",
"sliced_variables",
"=",
"collections",
".",
"defaultdict",
"(",
"lambda",
":",
"[",
"]",
")",
"for",
"var",
"in",
"var_list",
":",
"if",
"var",
".",
"_save_slice... | Separates the sliced (partitioned) and unsliced variables in var_list.
Args:
var_list: a list of variables.
Returns:
A list of unsliced variables in var_list, and a dict mapping names to parts
for the sliced variables in var_list. | [
"Separates",
"the",
"sliced",
"(",
"partitioned",
")",
"and",
"unsliced",
"variables",
"in",
"var_list",
"."
] | 00612ca3178964d86b556e062694d808ff81fcca | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/python/modules/util.py#L279-L296 | train | Separates the sliced ( partitioned ) and unsliced variables in var_list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.