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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bloomberg/bqplot | bqplot/pyplot.py | plot | def plot(*args, **kwargs):
"""Draw lines in the current context figure.
Signature: `plot(x, y, **kwargs)` or `plot(y, **kwargs)`, depending of the
length of the list of positional arguments. In the case where the `x` array
is not provided.
Parameters
----------
x: numpy.ndarray or list, 1d... | python | def plot(*args, **kwargs):
"""Draw lines in the current context figure.
Signature: `plot(x, y, **kwargs)` or `plot(y, **kwargs)`, depending of the
length of the list of positional arguments. In the case where the `x` array
is not provided.
Parameters
----------
x: numpy.ndarray or list, 1d... | [
"def",
"plot",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"marker_str",
"=",
"None",
"if",
"len",
"(",
"args",
")",
"==",
"1",
":",
"kwargs",
"[",
"'y'",
"]",
"=",
"args",
"[",
"0",
"]",
"if",
"kwargs",
".",
"get",
"(",
"'index_data'"... | Draw lines in the current context figure.
Signature: `plot(x, y, **kwargs)` or `plot(y, **kwargs)`, depending of the
length of the list of positional arguments. In the case where the `x` array
is not provided.
Parameters
----------
x: numpy.ndarray or list, 1d or 2d (optional)
The x-co... | [
"Draw",
"lines",
"in",
"the",
"current",
"context",
"figure",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L670-L740 | train | Plots a line in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | imshow | def imshow(image, format, **kwargs):
"""Draw an image in the current context figure.
Parameters
----------
image: image data
Image data, depending on the passed format, can be one of:
- an instance of an ipywidgets Image
- a file name
- a raw byte string
f... | python | def imshow(image, format, **kwargs):
"""Draw an image in the current context figure.
Parameters
----------
image: image data
Image data, depending on the passed format, can be one of:
- an instance of an ipywidgets Image
- a file name
- a raw byte string
f... | [
"def",
"imshow",
"(",
"image",
",",
"format",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"format",
"==",
"'widget'",
":",
"ipyimage",
"=",
"image",
"elif",
"format",
"==",
"'filename'",
":",
"with",
"open",
"(",
"image",
",",
"'rb'",
")",
"as",
"f",
... | Draw an image in the current context figure.
Parameters
----------
image: image data
Image data, depending on the passed format, can be one of:
- an instance of an ipywidgets Image
- a file name
- a raw byte string
format: {'widget', 'filename', ...}
T... | [
"Draw",
"an",
"image",
"in",
"the",
"current",
"context",
"figure",
".",
"Parameters",
"----------",
"image",
":",
"image",
"data",
"Image",
"data",
"depending",
"on",
"the",
"passed",
"format",
"can",
"be",
"one",
"of",
":",
"-",
"an",
"instance",
"of",
... | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L743-L778 | train | Draw an image in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | ohlc | def ohlc(*args, **kwargs):
"""Draw OHLC bars or candle bars in the current context figure.
Signature: `ohlc(x, y, **kwargs)` or `ohlc(y, **kwargs)`, depending of the
length of the list of positional arguments. In the case where the `x` array
is not provided
Parameters
----------
x: numpy.n... | python | def ohlc(*args, **kwargs):
"""Draw OHLC bars or candle bars in the current context figure.
Signature: `ohlc(x, y, **kwargs)` or `ohlc(y, **kwargs)`, depending of the
length of the list of positional arguments. In the case where the `x` array
is not provided
Parameters
----------
x: numpy.n... | [
"def",
"ohlc",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"args",
")",
"==",
"2",
":",
"kwargs",
"[",
"'x'",
"]",
"=",
"args",
"[",
"0",
"]",
"kwargs",
"[",
"'y'",
"]",
"=",
"args",
"[",
"1",
"]",
"elif",
"len",
... | Draw OHLC bars or candle bars in the current context figure.
Signature: `ohlc(x, y, **kwargs)` or `ohlc(y, **kwargs)`, depending of the
length of the list of positional arguments. In the case where the `x` array
is not provided
Parameters
----------
x: numpy.ndarray or list, 1d (optional)
... | [
"Draw",
"OHLC",
"bars",
"or",
"candle",
"bars",
"in",
"the",
"current",
"context",
"figure",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L781-L812 | train | Draw OHLC bars or candle bars in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | scatter | def scatter(x, y, **kwargs):
"""Draw a scatter in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 1d
The y-coordinates of the data points.
options: dict (default: {})
Options for the scales t... | python | def scatter(x, y, **kwargs):
"""Draw a scatter in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 1d
The y-coordinates of the data points.
options: dict (default: {})
Options for the scales t... | [
"def",
"scatter",
"(",
"x",
",",
"y",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'x'",
"]",
"=",
"x",
"kwargs",
"[",
"'y'",
"]",
"=",
"y",
"return",
"_draw_mark",
"(",
"Scatter",
",",
"*",
"*",
"kwargs",
")"
] | Draw a scatter in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 1d
The y-coordinates of the data points.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'x'... | [
"Draw",
"a",
"scatter",
"in",
"the",
"current",
"context",
"figure",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L816-L837 | train | Draw a scatter in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | hist | def hist(sample, options={}, **kwargs):
"""Draw a histogram in the current context figure.
Parameters
----------
sample: numpy.ndarray, 1d
The sample for which the histogram must be generated.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'coun... | python | def hist(sample, options={}, **kwargs):
"""Draw a histogram in the current context figure.
Parameters
----------
sample: numpy.ndarray, 1d
The sample for which the histogram must be generated.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'coun... | [
"def",
"hist",
"(",
"sample",
",",
"options",
"=",
"{",
"}",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'sample'",
"]",
"=",
"sample",
"scales",
"=",
"kwargs",
".",
"pop",
"(",
"'scales'",
",",
"{",
"}",
")",
"if",
"'count'",
"not",
"in",... | Draw a histogram in the current context figure.
Parameters
----------
sample: numpy.ndarray, 1d
The sample for which the histogram must be generated.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'counts'
is required for that mark, options[... | [
"Draw",
"a",
"histogram",
"in",
"the",
"current",
"context",
"figure",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L841-L867 | train | Draw a histogram in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | bin | def bin(sample, options={}, **kwargs):
"""Draw a histogram in the current context figure.
Parameters
----------
sample: numpy.ndarray, 1d
The sample for which the histogram must be generated.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'x'
... | python | def bin(sample, options={}, **kwargs):
"""Draw a histogram in the current context figure.
Parameters
----------
sample: numpy.ndarray, 1d
The sample for which the histogram must be generated.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'x'
... | [
"def",
"bin",
"(",
"sample",
",",
"options",
"=",
"{",
"}",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'sample'",
"]",
"=",
"sample",
"scales",
"=",
"kwargs",
".",
"pop",
"(",
"'scales'",
",",
"{",
"}",
")",
"for",
"xy",
"in",
"[",
"'x'... | Draw a histogram in the current context figure.
Parameters
----------
sample: numpy.ndarray, 1d
The sample for which the histogram must be generated.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'x'
is required for that mark, options['x'] c... | [
"Draw",
"a",
"histogram",
"in",
"the",
"current",
"context",
"figure",
".",
"Parameters",
"----------",
"sample",
":",
"numpy",
".",
"ndarray",
"1d",
"The",
"sample",
"for",
"which",
"the",
"histogram",
"must",
"be",
"generated",
".",
"options",
":",
"dict",... | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L871-L897 | train | Draw a histogram in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | bar | def bar(x, y, **kwargs):
"""Draws a bar chart in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 1d
The y-coordinates of the data pints.
options: dict (default: {})
Options for the scales to ... | python | def bar(x, y, **kwargs):
"""Draws a bar chart in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 1d
The y-coordinates of the data pints.
options: dict (default: {})
Options for the scales to ... | [
"def",
"bar",
"(",
"x",
",",
"y",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'x'",
"]",
"=",
"x",
"kwargs",
"[",
"'y'",
"]",
"=",
"y",
"return",
"_draw_mark",
"(",
"Bars",
",",
"*",
"*",
"kwargs",
")"
] | Draws a bar chart in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 1d
The y-coordinates of the data pints.
options: dict (default: {})
Options for the scales to be created. If a scale labeled '... | [
"Draws",
"a",
"bar",
"chart",
"in",
"the",
"current",
"context",
"figure",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L901-L922 | train | Draws a bar chart in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | boxplot | def boxplot(x, y, **kwargs):
"""Draws a boxplot in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 2d
The data from which the boxes are to be created. Each row of the data
corresponds to one box ... | python | def boxplot(x, y, **kwargs):
"""Draws a boxplot in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 2d
The data from which the boxes are to be created. Each row of the data
corresponds to one box ... | [
"def",
"boxplot",
"(",
"x",
",",
"y",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'x'",
"]",
"=",
"x",
"kwargs",
"[",
"'y'",
"]",
"=",
"y",
"return",
"_draw_mark",
"(",
"Boxplot",
",",
"*",
"*",
"kwargs",
")"
] | Draws a boxplot in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 2d
The data from which the boxes are to be created. Each row of the data
corresponds to one box drawn in the plot.
options: dict... | [
"Draws",
"a",
"boxplot",
"in",
"the",
"current",
"context",
"figure",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L926-L948 | train | Draws a boxplot in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | geo | def geo(map_data, **kwargs):
"""Draw a map in the current context figure.
Parameters
----------
map_data: string or bqplot.map (default: WorldMap)
Name of the map or json file required for the map data.
options: dict (default: {})
Options for the scales to be created. If a scale lab... | python | def geo(map_data, **kwargs):
"""Draw a map in the current context figure.
Parameters
----------
map_data: string or bqplot.map (default: WorldMap)
Name of the map or json file required for the map data.
options: dict (default: {})
Options for the scales to be created. If a scale lab... | [
"def",
"geo",
"(",
"map_data",
",",
"*",
"*",
"kwargs",
")",
":",
"scales",
"=",
"kwargs",
".",
"pop",
"(",
"'scales'",
",",
"_context",
"[",
"'scales'",
"]",
")",
"options",
"=",
"kwargs",
".",
"get",
"(",
"'options'",
",",
"{",
"}",
")",
"if",
... | Draw a map in the current context figure.
Parameters
----------
map_data: string or bqplot.map (default: WorldMap)
Name of the map or json file required for the map data.
options: dict (default: {})
Options for the scales to be created. If a scale labeled 'x' is
required for tha... | [
"Draw",
"a",
"map",
"in",
"the",
"current",
"context",
"figure",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1017-L1042 | train | Draw a map in the current context figure. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | _add_interaction | def _add_interaction(int_type, **kwargs):
"""Add the interaction for the specified type.
If a figure is passed using the key-word argument `figure` it is used. Else
the context figure is used.
If a list of marks are passed using the key-word argument `marks` it
is used. Else the latest mark that is... | python | def _add_interaction(int_type, **kwargs):
"""Add the interaction for the specified type.
If a figure is passed using the key-word argument `figure` it is used. Else
the context figure is used.
If a list of marks are passed using the key-word argument `marks` it
is used. Else the latest mark that is... | [
"def",
"_add_interaction",
"(",
"int_type",
",",
"*",
"*",
"kwargs",
")",
":",
"fig",
"=",
"kwargs",
".",
"pop",
"(",
"'figure'",
",",
"current_figure",
"(",
")",
")",
"marks",
"=",
"kwargs",
".",
"pop",
"(",
"'marks'",
",",
"[",
"_context",
"[",
"'l... | Add the interaction for the specified type.
If a figure is passed using the key-word argument `figure` it is used. Else
the context figure is used.
If a list of marks are passed using the key-word argument `marks` it
is used. Else the latest mark that is passed is used as the only mark
associated w... | [
"Add",
"the",
"interaction",
"for",
"the",
"specified",
"type",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1085-L1113 | train | Add the interaction for the specified 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... |
bloomberg/bqplot | bqplot/pyplot.py | _create_selector | def _create_selector(int_type, func, trait, **kwargs):
"""Create a selector of the specified type.
Also attaches the function `func` as an `on_trait_change` listener
for the trait `trait` of the selector.
This is an internal function which should not be called by the user.
Parameters
--------... | python | def _create_selector(int_type, func, trait, **kwargs):
"""Create a selector of the specified type.
Also attaches the function `func` as an `on_trait_change` listener
for the trait `trait` of the selector.
This is an internal function which should not be called by the user.
Parameters
--------... | [
"def",
"_create_selector",
"(",
"int_type",
",",
"func",
",",
"trait",
",",
"*",
"*",
"kwargs",
")",
":",
"interaction",
"=",
"_add_interaction",
"(",
"int_type",
",",
"*",
"*",
"kwargs",
")",
"if",
"func",
"is",
"not",
"None",
":",
"interaction",
".",
... | Create a selector of the specified type.
Also attaches the function `func` as an `on_trait_change` listener
for the trait `trait` of the selector.
This is an internal function which should not be called by the user.
Parameters
----------
int_type: type
The type of selector to be adde... | [
"Create",
"a",
"selector",
"of",
"the",
"specified",
"type",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1128-L1151 | train | Create a new selector of the specified 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... |
bloomberg/bqplot | bqplot/pyplot.py | clear | def clear():
"""Clears the current context figure of all marks axes and grid lines."""
fig = _context['figure']
if fig is not None:
fig.marks = []
fig.axes = []
setattr(fig, 'axis_registry', {})
_context['scales'] = {}
key = _context['current_key']
if key is n... | python | def clear():
"""Clears the current context figure of all marks axes and grid lines."""
fig = _context['figure']
if fig is not None:
fig.marks = []
fig.axes = []
setattr(fig, 'axis_registry', {})
_context['scales'] = {}
key = _context['current_key']
if key is n... | [
"def",
"clear",
"(",
")",
":",
"fig",
"=",
"_context",
"[",
"'figure'",
"]",
"if",
"fig",
"is",
"not",
"None",
":",
"fig",
".",
"marks",
"=",
"[",
"]",
"fig",
".",
"axes",
"=",
"[",
"]",
"setattr",
"(",
"fig",
",",
"'axis_registry'",
",",
"{",
... | Clears the current context figure of all marks axes and grid lines. | [
"Clears",
"the",
"current",
"context",
"figure",
"of",
"all",
"marks",
"axes",
"and",
"grid",
"lines",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1268-L1278 | train | Clears the current context figure of all marks axes and grid lines. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | set_context | def set_context(context):
"""Sets the current global context dictionary. All the attributes to be set
should be set. Otherwise, it will result in unpredictable behavior."""
global _context
_context = {k: v for k, v in context.items()} | python | def set_context(context):
"""Sets the current global context dictionary. All the attributes to be set
should be set. Otherwise, it will result in unpredictable behavior."""
global _context
_context = {k: v for k, v in context.items()} | [
"def",
"set_context",
"(",
"context",
")",
":",
"global",
"_context",
"_context",
"=",
"{",
"k",
":",
"v",
"for",
"k",
",",
"v",
"in",
"context",
".",
"items",
"(",
")",
"}"
] | Sets the current global context dictionary. All the attributes to be set
should be set. Otherwise, it will result in unpredictable behavior. | [
"Sets",
"the",
"current",
"global",
"context",
"dictionary",
".",
"All",
"the",
"attributes",
"to",
"be",
"set",
"should",
"be",
"set",
".",
"Otherwise",
"it",
"will",
"result",
"in",
"unpredictable",
"behavior",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1296-L1300 | train | Sets the current global context dictionary. All the attributes to be set
should be 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... |
bloomberg/bqplot | bqplot/pyplot.py | _get_attribute_dimension | def _get_attribute_dimension(trait_name, mark_type=None):
"""Returns the dimension for the name of the trait for the specified mark.
If `mark_type` is `None`, then the `trait_name` is returned
as is.
Returns `None` if the `trait_name` is not valid for `mark_type`.
"""
if(mark_type is None):
... | python | def _get_attribute_dimension(trait_name, mark_type=None):
"""Returns the dimension for the name of the trait for the specified mark.
If `mark_type` is `None`, then the `trait_name` is returned
as is.
Returns `None` if the `trait_name` is not valid for `mark_type`.
"""
if(mark_type is None):
... | [
"def",
"_get_attribute_dimension",
"(",
"trait_name",
",",
"mark_type",
"=",
"None",
")",
":",
"if",
"(",
"mark_type",
"is",
"None",
")",
":",
"return",
"trait_name",
"scale_metadata",
"=",
"mark_type",
".",
"class_traits",
"(",
")",
"[",
"'scales_metadata'",
... | Returns the dimension for the name of the trait for the specified mark.
If `mark_type` is `None`, then the `trait_name` is returned
as is.
Returns `None` if the `trait_name` is not valid for `mark_type`. | [
"Returns",
"the",
"dimension",
"for",
"the",
"name",
"of",
"the",
"trait",
"for",
"the",
"specified",
"mark",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1326-L1337 | train | Returns the dimension for the name of the trait for the specified mark. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | _apply_properties | def _apply_properties(widget, properties={}):
"""Applies the specified properties to the widget.
`properties` is a dictionary with key value pairs corresponding
to the properties to be applied to the widget.
"""
with widget.hold_sync():
for key, value in properties.items():
seta... | python | def _apply_properties(widget, properties={}):
"""Applies the specified properties to the widget.
`properties` is a dictionary with key value pairs corresponding
to the properties to be applied to the widget.
"""
with widget.hold_sync():
for key, value in properties.items():
seta... | [
"def",
"_apply_properties",
"(",
"widget",
",",
"properties",
"=",
"{",
"}",
")",
":",
"with",
"widget",
".",
"hold_sync",
"(",
")",
":",
"for",
"key",
",",
"value",
"in",
"properties",
".",
"items",
"(",
")",
":",
"setattr",
"(",
"widget",
",",
"key... | Applies the specified properties to the widget.
`properties` is a dictionary with key value pairs corresponding
to the properties to be applied to the widget. | [
"Applies",
"the",
"specified",
"properties",
"to",
"the",
"widget",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1340-L1348 | train | Applies the specified properties to the widget. | 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... |
bloomberg/bqplot | bqplot/pyplot.py | _get_line_styles | def _get_line_styles(marker_str):
"""Return line style, color and marker type from specified marker string.
For example, if ``marker_str`` is 'g-o' then the method returns
``('solid', 'green', 'circle')``.
"""
def _extract_marker_value(marker_str, code_dict):
"""Extracts the marker value fr... | python | def _get_line_styles(marker_str):
"""Return line style, color and marker type from specified marker string.
For example, if ``marker_str`` is 'g-o' then the method returns
``('solid', 'green', 'circle')``.
"""
def _extract_marker_value(marker_str, code_dict):
"""Extracts the marker value fr... | [
"def",
"_get_line_styles",
"(",
"marker_str",
")",
":",
"def",
"_extract_marker_value",
"(",
"marker_str",
",",
"code_dict",
")",
":",
"\"\"\"Extracts the marker value from a given marker string.\n\n Looks up the `code_dict` and returns the corresponding marker for a\n spec... | Return line style, color and marker type from specified marker string.
For example, if ``marker_str`` is 'g-o' then the method returns
``('solid', 'green', 'circle')``. | [
"Return",
"line",
"style",
"color",
"and",
"marker",
"type",
"from",
"specified",
"marker",
"string",
"."
] | 8eb8b163abe9ee6306f6918067e2f36c1caef2ef | https://github.com/bloomberg/bqplot/blob/8eb8b163abe9ee6306f6918067e2f36c1caef2ef/bqplot/pyplot.py#L1351-L1375 | train | Returns a list of line style color and marker type from a given marker 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... |
LonamiWebs/Telethon | telethon/requestiter.py | RequestIter.collect | async def collect(self):
"""
Create a `self` iterator and collect it into a `TotalList`
(a normal list with a `.total` attribute).
"""
result = helpers.TotalList()
async for message in self:
result.append(message)
result.total = self.total
ret... | python | async def collect(self):
"""
Create a `self` iterator and collect it into a `TotalList`
(a normal list with a `.total` attribute).
"""
result = helpers.TotalList()
async for message in self:
result.append(message)
result.total = self.total
ret... | [
"async",
"def",
"collect",
"(",
"self",
")",
":",
"result",
"=",
"helpers",
".",
"TotalList",
"(",
")",
"async",
"for",
"message",
"in",
"self",
":",
"result",
".",
"append",
"(",
"message",
")",
"result",
".",
"total",
"=",
"self",
".",
"total",
"re... | Create a `self` iterator and collect it into a `TotalList`
(a normal list with a `.total` attribute). | [
"Create",
"a",
"self",
"iterator",
"and",
"collect",
"it",
"into",
"a",
"TotalList",
"(",
"a",
"normal",
"list",
"with",
"a",
".",
"total",
"attribute",
")",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/requestiter.py#L108-L118 | train | Create a self iterator and collect it into a TotalList. | 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... |
LonamiWebs/Telethon | telethon_examples/assistant.py | handler | async def handler(event):
"""#full: Advises to read "Accessing the full API" in the docs."""
await asyncio.wait([
event.delete(),
event.respond(READ_FULL, reply_to=event.reply_to_msg_id)
]) | python | async def handler(event):
"""#full: Advises to read "Accessing the full API" in the docs."""
await asyncio.wait([
event.delete(),
event.respond(READ_FULL, reply_to=event.reply_to_msg_id)
]) | [
"async",
"def",
"handler",
"(",
"event",
")",
":",
"await",
"asyncio",
".",
"wait",
"(",
"[",
"event",
".",
"delete",
"(",
")",
",",
"event",
".",
"respond",
"(",
"READ_FULL",
",",
"reply_to",
"=",
"event",
".",
"reply_to_msg_id",
")",
"]",
")"
] | #full: Advises to read "Accessing the full API" in the docs. | [
"#full",
":",
"Advises",
"to",
"read",
"Accessing",
"the",
"full",
"API",
"in",
"the",
"docs",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/assistant.py#L174-L179 | train | Handle a full API request. | 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... |
LonamiWebs/Telethon | telethon_examples/assistant.py | handler | async def handler(event):
"""#search query: Searches for "query" in the method reference."""
query = urllib.parse.quote(event.pattern_match.group(1))
await asyncio.wait([
event.delete(),
event.respond(SEARCH.format(query), reply_to=event.reply_to_msg_id)
]) | python | async def handler(event):
"""#search query: Searches for "query" in the method reference."""
query = urllib.parse.quote(event.pattern_match.group(1))
await asyncio.wait([
event.delete(),
event.respond(SEARCH.format(query), reply_to=event.reply_to_msg_id)
]) | [
"async",
"def",
"handler",
"(",
"event",
")",
":",
"query",
"=",
"urllib",
".",
"parse",
".",
"quote",
"(",
"event",
".",
"pattern_match",
".",
"group",
"(",
"1",
")",
")",
"await",
"asyncio",
".",
"wait",
"(",
"[",
"event",
".",
"delete",
"(",
")"... | #search query: Searches for "query" in the method reference. | [
"#search",
"query",
":",
"Searches",
"for",
"query",
"in",
"the",
"method",
"reference",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/assistant.py#L183-L189 | train | Search query in the method reference. | 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... |
LonamiWebs/Telethon | telethon_examples/assistant.py | handler | async def handler(event):
"""#docs or #ref query: Like #search but shows the query."""
q1 = event.pattern_match.group(1)
q2 = urllib.parse.quote(q1)
await asyncio.wait([
event.delete(),
event.respond(DOCS.format(q1, q2), reply_to=event.reply_to_msg_id)
]) | python | async def handler(event):
"""#docs or #ref query: Like #search but shows the query."""
q1 = event.pattern_match.group(1)
q2 = urllib.parse.quote(q1)
await asyncio.wait([
event.delete(),
event.respond(DOCS.format(q1, q2), reply_to=event.reply_to_msg_id)
]) | [
"async",
"def",
"handler",
"(",
"event",
")",
":",
"q1",
"=",
"event",
".",
"pattern_match",
".",
"group",
"(",
"1",
")",
"q2",
"=",
"urllib",
".",
"parse",
".",
"quote",
"(",
"q1",
")",
"await",
"asyncio",
".",
"wait",
"(",
"[",
"event",
".",
"d... | #docs or #ref query: Like #search but shows the query. | [
"#docs",
"or",
"#ref",
"query",
":",
"Like",
"#search",
"but",
"shows",
"the",
"query",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/assistant.py#L193-L200 | train | Handles the event. | 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... |
LonamiWebs/Telethon | telethon_examples/assistant.py | handler | async def handler(event):
"""#rtd: Tells the user to please read the docs."""
rtd = RTFD if event.pattern_match.group(1) else RTD
await asyncio.wait([
event.delete(),
event.respond(rtd, reply_to=event.reply_to_msg_id)
]) | python | async def handler(event):
"""#rtd: Tells the user to please read the docs."""
rtd = RTFD if event.pattern_match.group(1) else RTD
await asyncio.wait([
event.delete(),
event.respond(rtd, reply_to=event.reply_to_msg_id)
]) | [
"async",
"def",
"handler",
"(",
"event",
")",
":",
"rtd",
"=",
"RTFD",
"if",
"event",
".",
"pattern_match",
".",
"group",
"(",
"1",
")",
"else",
"RTD",
"await",
"asyncio",
".",
"wait",
"(",
"[",
"event",
".",
"delete",
"(",
")",
",",
"event",
".",
... | #rtd: Tells the user to please read the docs. | [
"#rtd",
":",
"Tells",
"the",
"user",
"to",
"please",
"read",
"the",
"docs",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/assistant.py#L204-L210 | train | Handle 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... |
LonamiWebs/Telethon | telethon_examples/assistant.py | handler | async def handler(event):
"""#client or #msg query: Looks for the given attribute in RTD."""
await event.delete()
await event.respond(
get_docs_message(kind=event.pattern_match.group(1),
query=event.pattern_match.group(2)),
reply_to=event.reply_to_msg_id
) | python | async def handler(event):
"""#client or #msg query: Looks for the given attribute in RTD."""
await event.delete()
await event.respond(
get_docs_message(kind=event.pattern_match.group(1),
query=event.pattern_match.group(2)),
reply_to=event.reply_to_msg_id
) | [
"async",
"def",
"handler",
"(",
"event",
")",
":",
"await",
"event",
".",
"delete",
"(",
")",
"await",
"event",
".",
"respond",
"(",
"get_docs_message",
"(",
"kind",
"=",
"event",
".",
"pattern_match",
".",
"group",
"(",
"1",
")",
",",
"query",
"=",
... | #client or #msg query: Looks for the given attribute in RTD. | [
"#client",
"or",
"#msg",
"query",
":",
"Looks",
"for",
"the",
"given",
"attribute",
"in",
"RTD",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/assistant.py#L244-L252 | train | Handles a message 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... |
LonamiWebs/Telethon | telethon_examples/assistant.py | handler | async def handler(event):
"""#ot, #offtopic: Tells the user to move to @TelethonOffTopic."""
await asyncio.wait([
event.delete(),
event.respond(OFFTOPIC[event.chat_id], reply_to=event.reply_to_msg_id)
]) | python | async def handler(event):
"""#ot, #offtopic: Tells the user to move to @TelethonOffTopic."""
await asyncio.wait([
event.delete(),
event.respond(OFFTOPIC[event.chat_id], reply_to=event.reply_to_msg_id)
]) | [
"async",
"def",
"handler",
"(",
"event",
")",
":",
"await",
"asyncio",
".",
"wait",
"(",
"[",
"event",
".",
"delete",
"(",
")",
",",
"event",
".",
"respond",
"(",
"OFFTOPIC",
"[",
"event",
".",
"chat_id",
"]",
",",
"reply_to",
"=",
"event",
".",
"r... | #ot, #offtopic: Tells the user to move to @TelethonOffTopic. | [
"#ot",
"#offtopic",
":",
"Tells",
"the",
"user",
"to",
"move",
"to"
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/assistant.py#L274-L279 | train | Handle an OFFTOPIC event. | 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... |
LonamiWebs/Telethon | telethon_examples/assistant.py | handler | async def handler(event):
"""#learn or #python: Tells the user to learn some Python first."""
await asyncio.wait([
event.delete(),
event.respond(
LEARN_PYTHON, reply_to=event.reply_to_msg_id, link_preview=False)
]) | python | async def handler(event):
"""#learn or #python: Tells the user to learn some Python first."""
await asyncio.wait([
event.delete(),
event.respond(
LEARN_PYTHON, reply_to=event.reply_to_msg_id, link_preview=False)
]) | [
"async",
"def",
"handler",
"(",
"event",
")",
":",
"await",
"asyncio",
".",
"wait",
"(",
"[",
"event",
".",
"delete",
"(",
")",
",",
"event",
".",
"respond",
"(",
"LEARN_PYTHON",
",",
"reply_to",
"=",
"event",
".",
"reply_to_msg_id",
",",
"link_preview",... | #learn or #python: Tells the user to learn some Python first. | [
"#learn",
"or",
"#python",
":",
"Tells",
"the",
"user",
"to",
"learn",
"some",
"Python",
"first",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/assistant.py#L301-L307 | train | Handle an event. | 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... |
LonamiWebs/Telethon | telethon/client/buttons.py | ButtonMethods.build_reply_markup | def build_reply_markup(self, buttons, inline_only=False):
"""
Builds a :tl`ReplyInlineMarkup` or :tl:`ReplyKeyboardMarkup` for
the given buttons, or does nothing if either no buttons are
provided or the provided argument is already a reply markup.
This will add any event handler... | python | def build_reply_markup(self, buttons, inline_only=False):
"""
Builds a :tl`ReplyInlineMarkup` or :tl:`ReplyKeyboardMarkup` for
the given buttons, or does nothing if either no buttons are
provided or the provided argument is already a reply markup.
This will add any event handler... | [
"def",
"build_reply_markup",
"(",
"self",
",",
"buttons",
",",
"inline_only",
"=",
"False",
")",
":",
"if",
"buttons",
"is",
"None",
":",
"return",
"None",
"try",
":",
"if",
"buttons",
".",
"SUBCLASS_OF_ID",
"==",
"0xe2e10ef2",
":",
"return",
"buttons",
"#... | Builds a :tl`ReplyInlineMarkup` or :tl:`ReplyKeyboardMarkup` for
the given buttons, or does nothing if either no buttons are
provided or the provided argument is already a reply markup.
This will add any event handlers defined in the
buttons and delete old ones not to call them twice,
... | [
"Builds",
"a",
":",
"tl",
"ReplyInlineMarkup",
"or",
":",
"tl",
":",
"ReplyKeyboardMarkup",
"for",
"the",
"given",
"buttons",
"or",
"does",
"nothing",
"if",
"either",
"no",
"buttons",
"are",
"provided",
"or",
"the",
"provided",
"argument",
"is",
"already",
"... | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/buttons.py#L7-L74 | train | Builds a reply markup for the given buttons. | 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... |
LonamiWebs/Telethon | telethon/tl/tlobject.py | TLObject.pretty_format | def pretty_format(obj, indent=None):
"""
Pretty formats the given object as a string which is returned.
If indent is None, a single line will be returned.
"""
if indent is None:
if isinstance(obj, TLObject):
obj = obj.to_dict()
if isinstan... | python | def pretty_format(obj, indent=None):
"""
Pretty formats the given object as a string which is returned.
If indent is None, a single line will be returned.
"""
if indent is None:
if isinstance(obj, TLObject):
obj = obj.to_dict()
if isinstan... | [
"def",
"pretty_format",
"(",
"obj",
",",
"indent",
"=",
"None",
")",
":",
"if",
"indent",
"is",
"None",
":",
"if",
"isinstance",
"(",
"obj",
",",
"TLObject",
")",
":",
"obj",
"=",
"obj",
".",
"to_dict",
"(",
")",
"if",
"isinstance",
"(",
"obj",
","... | Pretty formats the given object as a string which is returned.
If indent is None, a single line will be returned. | [
"Pretty",
"formats",
"the",
"given",
"object",
"as",
"a",
"string",
"which",
"is",
"returned",
".",
"If",
"indent",
"is",
"None",
"a",
"single",
"line",
"will",
"be",
"returned",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/tlobject.py#L21-L85 | train | Pretty formats the given object as a string which is returned. | 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... |
LonamiWebs/Telethon | telethon/tl/tlobject.py | TLObject.serialize_bytes | def serialize_bytes(data):
"""Write bytes by using Telegram guidelines"""
if not isinstance(data, bytes):
if isinstance(data, str):
data = data.encode('utf-8')
else:
raise TypeError(
'bytes or str expected, not {}'.format(type(d... | python | def serialize_bytes(data):
"""Write bytes by using Telegram guidelines"""
if not isinstance(data, bytes):
if isinstance(data, str):
data = data.encode('utf-8')
else:
raise TypeError(
'bytes or str expected, not {}'.format(type(d... | [
"def",
"serialize_bytes",
"(",
"data",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"bytes",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"str",
")",
":",
"data",
"=",
"data",
".",
"encode",
"(",
"'utf-8'",
")",
"else",
":",
"raise",
"... | Write bytes by using Telegram guidelines | [
"Write",
"bytes",
"by",
"using",
"Telegram",
"guidelines"
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/tlobject.py#L88-L120 | train | Serialize a single object into a byte 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... |
LonamiWebs/Telethon | telethon/tl/tlobject.py | TLObject.to_json | def to_json(self, fp=None, default=_json_default, **kwargs):
"""
Represent the current `TLObject` as JSON.
If ``fp`` is given, the JSON will be dumped to said
file pointer, otherwise a JSON string will be returned.
Note that bytes and datetimes cannot be represented
in ... | python | def to_json(self, fp=None, default=_json_default, **kwargs):
"""
Represent the current `TLObject` as JSON.
If ``fp`` is given, the JSON will be dumped to said
file pointer, otherwise a JSON string will be returned.
Note that bytes and datetimes cannot be represented
in ... | [
"def",
"to_json",
"(",
"self",
",",
"fp",
"=",
"None",
",",
"default",
"=",
"_json_default",
",",
"*",
"*",
"kwargs",
")",
":",
"d",
"=",
"self",
".",
"to_dict",
"(",
")",
"if",
"fp",
":",
"return",
"json",
".",
"dump",
"(",
"d",
",",
"fp",
","... | Represent the current `TLObject` as JSON.
If ``fp`` is given, the JSON will be dumped to said
file pointer, otherwise a JSON string will be returned.
Note that bytes and datetimes cannot be represented
in JSON, so if those are found, they will be base64
encoded and ISO-formatte... | [
"Represent",
"the",
"current",
"TLObject",
"as",
"JSON",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/tlobject.py#L157-L172 | train | Represent the current TLE as JSON. | 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... |
LonamiWebs/Telethon | telethon/client/messageparse.py | MessageParseMethods._replace_with_mention | async def _replace_with_mention(self, entities, i, user):
"""
Helper method to replace ``entities[i]`` to mention ``user``,
or do nothing if it can't be found.
"""
try:
entities[i] = types.InputMessageEntityMentionName(
entities[i].offset, entities[i].... | python | async def _replace_with_mention(self, entities, i, user):
"""
Helper method to replace ``entities[i]`` to mention ``user``,
or do nothing if it can't be found.
"""
try:
entities[i] = types.InputMessageEntityMentionName(
entities[i].offset, entities[i].... | [
"async",
"def",
"_replace_with_mention",
"(",
"self",
",",
"entities",
",",
"i",
",",
"user",
")",
":",
"try",
":",
"entities",
"[",
"i",
"]",
"=",
"types",
".",
"InputMessageEntityMentionName",
"(",
"entities",
"[",
"i",
"]",
".",
"offset",
",",
"entiti... | Helper method to replace ``entities[i]`` to mention ``user``,
or do nothing if it can't be found. | [
"Helper",
"method",
"to",
"replace",
"entities",
"[",
"i",
"]",
"to",
"mention",
"user",
"or",
"do",
"nothing",
"if",
"it",
"can",
"t",
"be",
"found",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/messageparse.py#L48-L60 | train | Helper method to replace entities [ i ] with mention 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... |
LonamiWebs/Telethon | telethon/client/messageparse.py | MessageParseMethods._parse_message_text | async def _parse_message_text(self, message, parse_mode):
"""
Returns a (parsed message, entities) tuple depending on ``parse_mode``.
"""
if parse_mode is ():
parse_mode = self._parse_mode
else:
parse_mode = utils.sanitize_parse_mode(parse_mode)
i... | python | async def _parse_message_text(self, message, parse_mode):
"""
Returns a (parsed message, entities) tuple depending on ``parse_mode``.
"""
if parse_mode is ():
parse_mode = self._parse_mode
else:
parse_mode = utils.sanitize_parse_mode(parse_mode)
i... | [
"async",
"def",
"_parse_message_text",
"(",
"self",
",",
"message",
",",
"parse_mode",
")",
":",
"if",
"parse_mode",
"is",
"(",
")",
":",
"parse_mode",
"=",
"self",
".",
"_parse_mode",
"else",
":",
"parse_mode",
"=",
"utils",
".",
"sanitize_parse_mode",
"(",... | Returns a (parsed message, entities) tuple depending on ``parse_mode``. | [
"Returns",
"a",
"(",
"parsed",
"message",
"entities",
")",
"tuple",
"depending",
"on",
"parse_mode",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/messageparse.py#L62-L90 | train | Parses the text 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... |
LonamiWebs/Telethon | telethon/client/messageparse.py | MessageParseMethods._get_response_message | def _get_response_message(self, request, result, input_chat):
"""
Extracts the response message known a request and Update result.
The request may also be the ID of the message to match.
If ``request is None`` this method returns ``{id: message}``.
If ``request.random_id`` is a... | python | def _get_response_message(self, request, result, input_chat):
"""
Extracts the response message known a request and Update result.
The request may also be the ID of the message to match.
If ``request is None`` this method returns ``{id: message}``.
If ``request.random_id`` is a... | [
"def",
"_get_response_message",
"(",
"self",
",",
"request",
",",
"result",
",",
"input_chat",
")",
":",
"if",
"isinstance",
"(",
"result",
",",
"types",
".",
"UpdateShort",
")",
":",
"updates",
"=",
"[",
"result",
".",
"update",
"]",
"entities",
"=",
"{... | Extracts the response message known a request and Update result.
The request may also be the ID of the message to match.
If ``request is None`` this method returns ``{id: message}``.
If ``request.random_id`` is a list, this method returns a list too. | [
"Extracts",
"the",
"response",
"message",
"known",
"a",
"request",
"and",
"Update",
"result",
".",
"The",
"request",
"may",
"also",
"be",
"the",
"ID",
"of",
"the",
"message",
"to",
"match",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/messageparse.py#L92-L153 | train | Extracts the response message from the result of a request and Update result. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/sendergetter.py | SenderGetter.get_sender | async def get_sender(self):
"""
Returns `sender`, but will make an API call to find the
sender unless it's already cached.
"""
# ``sender.min`` is present both in :tl:`User` and :tl:`Channel`.
# It's a flag that will be set if only minimal information is
# availab... | python | async def get_sender(self):
"""
Returns `sender`, but will make an API call to find the
sender unless it's already cached.
"""
# ``sender.min`` is present both in :tl:`User` and :tl:`Channel`.
# It's a flag that will be set if only minimal information is
# availab... | [
"async",
"def",
"get_sender",
"(",
"self",
")",
":",
"# ``sender.min`` is present both in :tl:`User` and :tl:`Channel`.",
"# It's a flag that will be set if only minimal information is",
"# available (such as display name, but username may be missing),",
"# in which case we want to force fetch t... | Returns `sender`, but will make an API call to find the
sender unless it's already cached. | [
"Returns",
"sender",
"but",
"will",
"make",
"an",
"API",
"call",
"to",
"find",
"the",
"sender",
"unless",
"it",
"s",
"already",
"cached",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/sendergetter.py#L24-L42 | train | Returns the sender if it s not already cached. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/sendergetter.py | SenderGetter.input_sender | def input_sender(self):
"""
This :tl:`InputPeer` is the input version of the user/channel who
sent the message. Similarly to `input_chat`, this doesn't have
things like username or similar, but still useful in some cases.
Note that this might not be available if the library can'... | python | def input_sender(self):
"""
This :tl:`InputPeer` is the input version of the user/channel who
sent the message. Similarly to `input_chat`, this doesn't have
things like username or similar, but still useful in some cases.
Note that this might not be available if the library can'... | [
"def",
"input_sender",
"(",
"self",
")",
":",
"if",
"self",
".",
"_input_sender",
"is",
"None",
"and",
"self",
".",
"_sender_id",
":",
"try",
":",
"self",
".",
"_input_sender",
"=",
"self",
".",
"_client",
".",
"session",
".",
"get_input_entity",
"(",
"s... | This :tl:`InputPeer` is the input version of the user/channel who
sent the message. Similarly to `input_chat`, this doesn't have
things like username or similar, but still useful in some cases.
Note that this might not be available if the library can't
find the input chat, or if the mes... | [
"This",
":",
"tl",
":",
"InputPeer",
"is",
"the",
"input",
"version",
"of",
"the",
"user",
"/",
"channel",
"who",
"sent",
"the",
"message",
".",
"Similarly",
"to",
"input_chat",
"this",
"doesn",
"t",
"have",
"things",
"like",
"username",
"or",
"similar",
... | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/sendergetter.py#L45-L60 | train | This is the input version of the input chat who has the message sent. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/sendergetter.py | SenderGetter.get_input_sender | async def get_input_sender(self):
"""
Returns `input_sender`, but will make an API call to find the
input sender unless it's already cached.
"""
if self.input_sender is None and self._sender_id:
await self._refetch_sender()
return self._input_sender | python | async def get_input_sender(self):
"""
Returns `input_sender`, but will make an API call to find the
input sender unless it's already cached.
"""
if self.input_sender is None and self._sender_id:
await self._refetch_sender()
return self._input_sender | [
"async",
"def",
"get_input_sender",
"(",
"self",
")",
":",
"if",
"self",
".",
"input_sender",
"is",
"None",
"and",
"self",
".",
"_sender_id",
":",
"await",
"self",
".",
"_refetch_sender",
"(",
")",
"return",
"self",
".",
"_input_sender"
] | Returns `input_sender`, but will make an API call to find the
input sender unless it's already cached. | [
"Returns",
"input_sender",
"but",
"will",
"make",
"an",
"API",
"call",
"to",
"find",
"the",
"input",
"sender",
"unless",
"it",
"s",
"already",
"cached",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/sendergetter.py#L62-L69 | train | Returns the input sender if it s not already cached. | 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... |
LonamiWebs/Telethon | telethon/events/__init__.py | register | def register(event=None):
"""
Decorator method to *register* event handlers. This is the client-less
`add_event_handler
<telethon.client.updates.UpdateMethods.add_event_handler>` variant.
Note that this method only registers callbacks as handlers,
and does not attach them to any client. This is... | python | def register(event=None):
"""
Decorator method to *register* event handlers. This is the client-less
`add_event_handler
<telethon.client.updates.UpdateMethods.add_event_handler>` variant.
Note that this method only registers callbacks as handlers,
and does not attach them to any client. This is... | [
"def",
"register",
"(",
"event",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"event",
",",
"type",
")",
":",
"event",
"=",
"event",
"(",
")",
"elif",
"not",
"event",
":",
"event",
"=",
"Raw",
"(",
")",
"def",
"decorator",
"(",
"callback",
")",
... | Decorator method to *register* event handlers. This is the client-less
`add_event_handler
<telethon.client.updates.UpdateMethods.add_event_handler>` variant.
Note that this method only registers callbacks as handlers,
and does not attach them to any client. This is useful for
external modules that ... | [
"Decorator",
"method",
"to",
"*",
"register",
"*",
"event",
"handlers",
".",
"This",
"is",
"the",
"client",
"-",
"less",
"add_event_handler",
"<telethon",
".",
"client",
".",
"updates",
".",
"UpdateMethods",
".",
"add_event_handler",
">",
"variant",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/events/__init__.py#L42-L83 | train | Decorator to register event 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... |
LonamiWebs/Telethon | telethon/events/__init__.py | unregister | def unregister(callback, event=None):
"""
Inverse operation of `register` (though not a decorator). Client-less
`remove_event_handler
<telethon.client.updates.UpdateMethods.remove_event_handler>`
variant. **Note that this won't remove handlers from the client**,
because it simply can't, so you w... | python | def unregister(callback, event=None):
"""
Inverse operation of `register` (though not a decorator). Client-less
`remove_event_handler
<telethon.client.updates.UpdateMethods.remove_event_handler>`
variant. **Note that this won't remove handlers from the client**,
because it simply can't, so you w... | [
"def",
"unregister",
"(",
"callback",
",",
"event",
"=",
"None",
")",
":",
"found",
"=",
"0",
"if",
"event",
"and",
"not",
"isinstance",
"(",
"event",
",",
"type",
")",
":",
"event",
"=",
"type",
"(",
"event",
")",
"handlers",
"=",
"getattr",
"(",
... | Inverse operation of `register` (though not a decorator). Client-less
`remove_event_handler
<telethon.client.updates.UpdateMethods.remove_event_handler>`
variant. **Note that this won't remove handlers from the client**,
because it simply can't, so you would generally use this before
adding the hand... | [
"Inverse",
"operation",
"of",
"register",
"(",
"though",
"not",
"a",
"decorator",
")",
".",
"Client",
"-",
"less",
"remove_event_handler",
"<telethon",
".",
"client",
".",
"updates",
".",
"UpdateMethods",
".",
"remove_event_handler",
">",
"variant",
".",
"**",
... | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/events/__init__.py#L86-L116 | train | Unregister a callback from the base base. | 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... |
LonamiWebs/Telethon | telethon/extensions/markdown.py | parse | def parse(message, delimiters=None, url_re=None):
"""
Parses the given markdown message and returns its stripped representation
plus a list of the MessageEntity's that were found.
:param message: the message with markdown-like syntax to be parsed.
:param delimiters: the delimiters to be used, {deli... | python | def parse(message, delimiters=None, url_re=None):
"""
Parses the given markdown message and returns its stripped representation
plus a list of the MessageEntity's that were found.
:param message: the message with markdown-like syntax to be parsed.
:param delimiters: the delimiters to be used, {deli... | [
"def",
"parse",
"(",
"message",
",",
"delimiters",
"=",
"None",
",",
"url_re",
"=",
"None",
")",
":",
"if",
"not",
"message",
":",
"return",
"message",
",",
"[",
"]",
"if",
"url_re",
"is",
"None",
":",
"url_re",
"=",
"DEFAULT_URL_RE",
"elif",
"isinstan... | Parses the given markdown message and returns its stripped representation
plus a list of the MessageEntity's that were found.
:param message: the message with markdown-like syntax to be parsed.
:param delimiters: the delimiters to be used, {delimiter: type}.
:param url_re: the URL bytes regex to be use... | [
"Parses",
"the",
"given",
"markdown",
"message",
"and",
"returns",
"its",
"stripped",
"representation",
"plus",
"a",
"list",
"of",
"the",
"MessageEntity",
"s",
"that",
"were",
"found",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/extensions/markdown.py#L26-L129 | train | Parses a given markdown message and returns its stripped representation and a list of MessageEntities that were found. | 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... |
LonamiWebs/Telethon | telethon/extensions/markdown.py | unparse | def unparse(text, entities, delimiters=None, url_fmt=None):
"""
Performs the reverse operation to .parse(), effectively returning
markdown-like syntax given a normal text and its MessageEntity's.
:param text: the text to be reconverted into markdown.
:param entities: the MessageEntity's applied to ... | python | def unparse(text, entities, delimiters=None, url_fmt=None):
"""
Performs the reverse operation to .parse(), effectively returning
markdown-like syntax given a normal text and its MessageEntity's.
:param text: the text to be reconverted into markdown.
:param entities: the MessageEntity's applied to ... | [
"def",
"unparse",
"(",
"text",
",",
"entities",
",",
"delimiters",
"=",
"None",
",",
"url_fmt",
"=",
"None",
")",
":",
"if",
"not",
"text",
"or",
"not",
"entities",
":",
"return",
"text",
"if",
"not",
"delimiters",
":",
"if",
"delimiters",
"is",
"not",... | Performs the reverse operation to .parse(), effectively returning
markdown-like syntax given a normal text and its MessageEntity's.
:param text: the text to be reconverted into markdown.
:param entities: the MessageEntity's applied to the text.
:return: a markdown-like text representing the combination... | [
"Performs",
"the",
"reverse",
"operation",
"to",
".",
"parse",
"()",
"effectively",
"returning",
"markdown",
"-",
"like",
"syntax",
"given",
"a",
"normal",
"text",
"and",
"its",
"MessageEntity",
"s",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/extensions/markdown.py#L132-L200 | train | This function unparses a text and a MessageEntity s into a sequence of MessageEntities. | 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... |
LonamiWebs/Telethon | telethon/crypto/authkey.py | AuthKey.calc_new_nonce_hash | def calc_new_nonce_hash(self, new_nonce, number):
"""
Calculates the new nonce hash based on the current attributes.
:param new_nonce: the new nonce to be hashed.
:param number: number to prepend before the hash.
:return: the hash for the given new nonce.
"""
new... | python | def calc_new_nonce_hash(self, new_nonce, number):
"""
Calculates the new nonce hash based on the current attributes.
:param new_nonce: the new nonce to be hashed.
:param number: number to prepend before the hash.
:return: the hash for the given new nonce.
"""
new... | [
"def",
"calc_new_nonce_hash",
"(",
"self",
",",
"new_nonce",
",",
"number",
")",
":",
"new_nonce",
"=",
"new_nonce",
".",
"to_bytes",
"(",
"32",
",",
"'little'",
",",
"signed",
"=",
"True",
")",
"data",
"=",
"new_nonce",
"+",
"struct",
".",
"pack",
"(",
... | Calculates the new nonce hash based on the current attributes.
:param new_nonce: the new nonce to be hashed.
:param number: number to prepend before the hash.
:return: the hash for the given new nonce. | [
"Calculates",
"the",
"new",
"nonce",
"hash",
"based",
"on",
"the",
"current",
"attributes",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/authkey.py#L45-L57 | train | Calculates the new nonce hash based on the current attributes. | 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... |
LonamiWebs/Telethon | telethon/crypto/rsa.py | get_byte_array | def get_byte_array(integer):
"""Return the variable length bytes corresponding to the given int"""
# Operate in big endian (unlike most of Telegram API) since:
# > "...pq is a representation of a natural number
# (in binary *big endian* format)..."
# > "...current value of dh_prime equals
# ... | python | def get_byte_array(integer):
"""Return the variable length bytes corresponding to the given int"""
# Operate in big endian (unlike most of Telegram API) since:
# > "...pq is a representation of a natural number
# (in binary *big endian* format)..."
# > "...current value of dh_prime equals
# ... | [
"def",
"get_byte_array",
"(",
"integer",
")",
":",
"# Operate in big endian (unlike most of Telegram API) since:",
"# > \"...pq is a representation of a natural number",
"# (in binary *big endian* format)...\"",
"# > \"...current value of dh_prime equals",
"# (in *big-endian* byte order)..... | Return the variable length bytes corresponding to the given int | [
"Return",
"the",
"variable",
"length",
"bytes",
"corresponding",
"to",
"the",
"given",
"int"
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/rsa.py#L21-L34 | train | Return the variable length bytes corresponding to the given integer | 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... |
LonamiWebs/Telethon | telethon/crypto/rsa.py | _compute_fingerprint | def _compute_fingerprint(key):
"""
Given a RSA key, computes its fingerprint like Telegram does.
:param key: the Crypto.RSA key.
:return: its 8-bytes-long fingerprint.
"""
n = TLObject.serialize_bytes(get_byte_array(key.n))
e = TLObject.serialize_bytes(get_byte_array(key.e))
# Telegram ... | python | def _compute_fingerprint(key):
"""
Given a RSA key, computes its fingerprint like Telegram does.
:param key: the Crypto.RSA key.
:return: its 8-bytes-long fingerprint.
"""
n = TLObject.serialize_bytes(get_byte_array(key.n))
e = TLObject.serialize_bytes(get_byte_array(key.e))
# Telegram ... | [
"def",
"_compute_fingerprint",
"(",
"key",
")",
":",
"n",
"=",
"TLObject",
".",
"serialize_bytes",
"(",
"get_byte_array",
"(",
"key",
".",
"n",
")",
")",
"e",
"=",
"TLObject",
".",
"serialize_bytes",
"(",
"get_byte_array",
"(",
"key",
".",
"e",
")",
")",... | Given a RSA key, computes its fingerprint like Telegram does.
:param key: the Crypto.RSA key.
:return: its 8-bytes-long fingerprint. | [
"Given",
"a",
"RSA",
"key",
"computes",
"its",
"fingerprint",
"like",
"Telegram",
"does",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/rsa.py#L37-L47 | train | Given a RSA key computes its 8 - byte - long fingerprint. | 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... |
LonamiWebs/Telethon | telethon/crypto/rsa.py | add_key | def add_key(pub):
"""Adds a new public key to be used when encrypting new data is needed"""
global _server_keys
key = rsa.PublicKey.load_pkcs1(pub)
_server_keys[_compute_fingerprint(key)] = key | python | def add_key(pub):
"""Adds a new public key to be used when encrypting new data is needed"""
global _server_keys
key = rsa.PublicKey.load_pkcs1(pub)
_server_keys[_compute_fingerprint(key)] = key | [
"def",
"add_key",
"(",
"pub",
")",
":",
"global",
"_server_keys",
"key",
"=",
"rsa",
".",
"PublicKey",
".",
"load_pkcs1",
"(",
"pub",
")",
"_server_keys",
"[",
"_compute_fingerprint",
"(",
"key",
")",
"]",
"=",
"key"
] | Adds a new public key to be used when encrypting new data is needed | [
"Adds",
"a",
"new",
"public",
"key",
"to",
"be",
"used",
"when",
"encrypting",
"new",
"data",
"is",
"needed"
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/rsa.py#L50-L54 | train | Adds a new public key to be used when encrypting new data is needed | 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... |
LonamiWebs/Telethon | telethon/crypto/rsa.py | encrypt | def encrypt(fingerprint, data):
"""
Encrypts the given data known the fingerprint to be used
in the way Telegram requires us to do so (sha1(data) + data + padding)
:param fingerprint: the fingerprint of the RSA key.
:param data: the data to be encrypted.
:return:
the cipher text, or Non... | python | def encrypt(fingerprint, data):
"""
Encrypts the given data known the fingerprint to be used
in the way Telegram requires us to do so (sha1(data) + data + padding)
:param fingerprint: the fingerprint of the RSA key.
:param data: the data to be encrypted.
:return:
the cipher text, or Non... | [
"def",
"encrypt",
"(",
"fingerprint",
",",
"data",
")",
":",
"global",
"_server_keys",
"key",
"=",
"_server_keys",
".",
"get",
"(",
"fingerprint",
",",
"None",
")",
"if",
"not",
"key",
":",
"return",
"None",
"# len(sha1.digest) is always 20, so we're left with 255... | Encrypts the given data known the fingerprint to be used
in the way Telegram requires us to do so (sha1(data) + data + padding)
:param fingerprint: the fingerprint of the RSA key.
:param data: the data to be encrypted.
:return:
the cipher text, or None if no key matching this fingerprint is fou... | [
"Encrypts",
"the",
"given",
"data",
"known",
"the",
"fingerprint",
"to",
"be",
"used",
"in",
"the",
"way",
"Telegram",
"requires",
"us",
"to",
"do",
"so",
"(",
"sha1",
"(",
"data",
")",
"+",
"data",
"+",
"padding",
")"
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/rsa.py#L57-L81 | train | Encrypts the given data using the RSA key matching the given fingerprint. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation.send_message | async def send_message(self, *args, **kwargs):
"""
Sends a message in the context of this conversation. Shorthand
for `telethon.client.messages.MessageMethods.send_message` with
``entity`` already set.
"""
message = await self._client.send_message(
self._input... | python | async def send_message(self, *args, **kwargs):
"""
Sends a message in the context of this conversation. Shorthand
for `telethon.client.messages.MessageMethods.send_message` with
``entity`` already set.
"""
message = await self._client.send_message(
self._input... | [
"async",
"def",
"send_message",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"message",
"=",
"await",
"self",
".",
"_client",
".",
"send_message",
"(",
"self",
".",
"_input_chat",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
... | Sends a message in the context of this conversation. Shorthand
for `telethon.client.messages.MessageMethods.send_message` with
``entity`` already set. | [
"Sends",
"a",
"message",
"in",
"the",
"context",
"of",
"this",
"conversation",
".",
"Shorthand",
"for",
"telethon",
".",
"client",
".",
"messages",
".",
"MessageMethods",
".",
"send_message",
"with",
"entity",
"already",
"set",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L71-L82 | train | Sends a message in the context of this conversation. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation.mark_read | def mark_read(self, message=None):
"""
Marks as read the latest received message if ``message is None``.
Otherwise, marks as read until the given message (or message ID).
This is equivalent to calling `client.send_read_acknowledge
<telethon.client.messages.MessageMethods.send_re... | python | def mark_read(self, message=None):
"""
Marks as read the latest received message if ``message is None``.
Otherwise, marks as read until the given message (or message ID).
This is equivalent to calling `client.send_read_acknowledge
<telethon.client.messages.MessageMethods.send_re... | [
"def",
"mark_read",
"(",
"self",
",",
"message",
"=",
"None",
")",
":",
"if",
"message",
"is",
"None",
":",
"if",
"self",
".",
"_incoming",
":",
"message",
"=",
"self",
".",
"_incoming",
"[",
"-",
"1",
"]",
".",
"id",
"else",
":",
"message",
"=",
... | Marks as read the latest received message if ``message is None``.
Otherwise, marks as read until the given message (or message ID).
This is equivalent to calling `client.send_read_acknowledge
<telethon.client.messages.MessageMethods.send_read_acknowledge>`. | [
"Marks",
"as",
"read",
"the",
"latest",
"received",
"message",
"if",
"message",
"is",
"None",
".",
"Otherwise",
"marks",
"as",
"read",
"until",
"the",
"given",
"message",
"(",
"or",
"message",
"ID",
")",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L97-L114 | train | Mark the user as read. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation.get_response | async def get_response(self, message=None, *, timeout=None):
"""
Returns a coroutine that will resolve once a response arrives.
Args:
message (`Message <telethon.tl.custom.message.Message>` | `int`, optional):
The message (or the message ID) for which a response
... | python | async def get_response(self, message=None, *, timeout=None):
"""
Returns a coroutine that will resolve once a response arrives.
Args:
message (`Message <telethon.tl.custom.message.Message>` | `int`, optional):
The message (or the message ID) for which a response
... | [
"async",
"def",
"get_response",
"(",
"self",
",",
"message",
"=",
"None",
",",
"*",
",",
"timeout",
"=",
"None",
")",
":",
"return",
"await",
"self",
".",
"_get_message",
"(",
"message",
",",
"self",
".",
"_response_indices",
",",
"self",
".",
"_pending_... | Returns a coroutine that will resolve once a response arrives.
Args:
message (`Message <telethon.tl.custom.message.Message>` | `int`, optional):
The message (or the message ID) for which a response
is expected. By default this is the last sent message.
t... | [
"Returns",
"a",
"coroutine",
"that",
"will",
"resolve",
"once",
"a",
"response",
"arrives",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L116-L132 | train | Returns a coroutine that will resolve once a response 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation.get_reply | async def get_reply(self, message=None, *, timeout=None):
"""
Returns a coroutine that will resolve once a reply
(that is, a message being a reply) arrives. The
arguments are the same as those for `get_response`.
"""
return await self._get_message(
message, se... | python | async def get_reply(self, message=None, *, timeout=None):
"""
Returns a coroutine that will resolve once a reply
(that is, a message being a reply) arrives. The
arguments are the same as those for `get_response`.
"""
return await self._get_message(
message, se... | [
"async",
"def",
"get_reply",
"(",
"self",
",",
"message",
"=",
"None",
",",
"*",
",",
"timeout",
"=",
"None",
")",
":",
"return",
"await",
"self",
".",
"_get_message",
"(",
"message",
",",
"self",
".",
"_reply_indices",
",",
"self",
".",
"_pending_replie... | Returns a coroutine that will resolve once a reply
(that is, a message being a reply) arrives. The
arguments are the same as those for `get_response`. | [
"Returns",
"a",
"coroutine",
"that",
"will",
"resolve",
"once",
"a",
"reply",
"(",
"that",
"is",
"a",
"message",
"being",
"a",
"reply",
")",
"arrives",
".",
"The",
"arguments",
"are",
"the",
"same",
"as",
"those",
"for",
"get_response",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L134-L143 | train | Get a reply from the specified 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation._get_message | def _get_message(
self, target_message, indices, pending, timeout, condition):
"""
Gets the next desired message under the desired condition.
Args:
target_message (`object`):
The target message for which we want to find another
response th... | python | def _get_message(
self, target_message, indices, pending, timeout, condition):
"""
Gets the next desired message under the desired condition.
Args:
target_message (`object`):
The target message for which we want to find another
response th... | [
"def",
"_get_message",
"(",
"self",
",",
"target_message",
",",
"indices",
",",
"pending",
",",
"timeout",
",",
"condition",
")",
":",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"target_id",
"=",
"self",
".",
"_get_message_id",
"(",
"target_message",
... | Gets the next desired message under the desired condition.
Args:
target_message (`object`):
The target message for which we want to find another
response that applies based on `condition`.
indices (`dict`):
This dictionary remembers the l... | [
"Gets",
"the",
"next",
"desired",
"message",
"under",
"the",
"desired",
"condition",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L145-L200 | train | Internal method that returns the next desired message that applies to the target 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation.get_edit | async def get_edit(self, message=None, *, timeout=None):
"""
Awaits for an edit after the last message to arrive.
The arguments are the same as those for `get_response`.
"""
start_time = time.time()
target_id = self._get_message_id(message)
target_date = self._ed... | python | async def get_edit(self, message=None, *, timeout=None):
"""
Awaits for an edit after the last message to arrive.
The arguments are the same as those for `get_response`.
"""
start_time = time.time()
target_id = self._get_message_id(message)
target_date = self._ed... | [
"async",
"def",
"get_edit",
"(",
"self",
",",
"message",
"=",
"None",
",",
"*",
",",
"timeout",
"=",
"None",
")",
":",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"target_id",
"=",
"self",
".",
"_get_message_id",
"(",
"message",
")",
"target_date... | Awaits for an edit after the last message to arrive.
The arguments are the same as those for `get_response`. | [
"Awaits",
"for",
"an",
"edit",
"after",
"the",
"last",
"message",
"to",
"arrive",
".",
"The",
"arguments",
"are",
"the",
"same",
"as",
"those",
"for",
"get_response",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L202-L228 | train | Await for an edit after the last 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation.wait_read | async def wait_read(self, message=None, *, timeout=None):
"""
Awaits for the sent message to be read. Note that receiving
a response doesn't imply the message was read, and this action
will also trigger even without a response.
"""
start_time = time.time()
future ... | python | async def wait_read(self, message=None, *, timeout=None):
"""
Awaits for the sent message to be read. Note that receiving
a response doesn't imply the message was read, and this action
will also trigger even without a response.
"""
start_time = time.time()
future ... | [
"async",
"def",
"wait_read",
"(",
"self",
",",
"message",
"=",
"None",
",",
"*",
",",
"timeout",
"=",
"None",
")",
":",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"future",
"=",
"self",
".",
"_client",
".",
"loop",
".",
"create_future",
"(",
... | Awaits for the sent message to be read. Note that receiving
a response doesn't imply the message was read, and this action
will also trigger even without a response. | [
"Awaits",
"for",
"the",
"sent",
"message",
"to",
"be",
"read",
".",
"Note",
"that",
"receiving",
"a",
"response",
"doesn",
"t",
"imply",
"the",
"message",
"was",
"read",
"and",
"this",
"action",
"will",
"also",
"trigger",
"even",
"without",
"a",
"response"... | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L230-L247 | train | Await for the sent message to be read. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/conversation.py | Conversation.wait_event | async def wait_event(self, event, *, timeout=None):
"""
Waits for a custom event to occur. Timeouts still apply.
Unless you're certain that your code will run fast enough,
generally you should get a "handle" of this special coroutine
before acting. Generally, you should do this:... | python | async def wait_event(self, event, *, timeout=None):
"""
Waits for a custom event to occur. Timeouts still apply.
Unless you're certain that your code will run fast enough,
generally you should get a "handle" of this special coroutine
before acting. Generally, you should do this:... | [
"async",
"def",
"wait_event",
"(",
"self",
",",
"event",
",",
"*",
",",
"timeout",
"=",
"None",
")",
":",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"if",
"isinstance",
"(",
"event",
",",
"type",
")",
":",
"event",
"=",
"event",
"(",
")",
... | Waits for a custom event to occur. Timeouts still apply.
Unless you're certain that your code will run fast enough,
generally you should get a "handle" of this special coroutine
before acting. Generally, you should do this:
>>> from telethon import TelegramClient, events
>>>
... | [
"Waits",
"for",
"a",
"custom",
"event",
"to",
"occur",
".",
"Timeouts",
"still",
"apply",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/conversation.py#L249-L295 | train | Waits for a custom event to occur. | 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods.start | def start(
self,
phone=lambda: input('Please enter your phone (or bot token): '),
password=lambda: getpass.getpass('Please enter your password: '),
*,
bot_token=None, force_sms=False, code_callback=None,
first_name='New User', last_name='', max_att... | python | def start(
self,
phone=lambda: input('Please enter your phone (or bot token): '),
password=lambda: getpass.getpass('Please enter your password: '),
*,
bot_token=None, force_sms=False, code_callback=None,
first_name='New User', last_name='', max_att... | [
"def",
"start",
"(",
"self",
",",
"phone",
"=",
"lambda",
":",
"input",
"(",
"'Please enter your phone (or bot token): '",
")",
",",
"password",
"=",
"lambda",
":",
"getpass",
".",
"getpass",
"(",
"'Please enter your password: '",
")",
",",
"*",
",",
"bot_token"... | Convenience method to interactively connect and sign in if required,
also taking into consideration that 2FA may be enabled in the account.
If the phone doesn't belong to an existing account (and will hence
`sign_up` for a new one), **you are agreeing to Telegram's
Terms of Service. Th... | [
"Convenience",
"method",
"to",
"interactively",
"connect",
"and",
"sign",
"in",
"if",
"required",
"also",
"taking",
"into",
"consideration",
"that",
"2FA",
"may",
"be",
"enabled",
"in",
"the",
"account",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L18-L116 | train | Start the event loop. | 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods._parse_phone_and_hash | def _parse_phone_and_hash(self, phone, phone_hash):
"""
Helper method to both parse and validate phone and its hash.
"""
phone = utils.parse_phone(phone) or self._phone
if not phone:
raise ValueError(
'Please make sure to call send_code_request first.'... | python | def _parse_phone_and_hash(self, phone, phone_hash):
"""
Helper method to both parse and validate phone and its hash.
"""
phone = utils.parse_phone(phone) or self._phone
if not phone:
raise ValueError(
'Please make sure to call send_code_request first.'... | [
"def",
"_parse_phone_and_hash",
"(",
"self",
",",
"phone",
",",
"phone_hash",
")",
":",
"phone",
"=",
"utils",
".",
"parse_phone",
"(",
"phone",
")",
"or",
"self",
".",
"_phone",
"if",
"not",
"phone",
":",
"raise",
"ValueError",
"(",
"'Please make sure to ca... | Helper method to both parse and validate phone and its hash. | [
"Helper",
"method",
"to",
"both",
"parse",
"and",
"validate",
"phone",
"and",
"its",
"hash",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L224-L238 | train | Helper method to parse and validate phone and hash. | 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods.sign_in | async def sign_in(
self, phone=None, code=None, *, password=None,
bot_token=None, phone_code_hash=None):
"""
Starts or completes the sign in process with the given phone number
or code that Telegram sent.
Args:
phone (`str` | `int`):
T... | python | async def sign_in(
self, phone=None, code=None, *, password=None,
bot_token=None, phone_code_hash=None):
"""
Starts or completes the sign in process with the given phone number
or code that Telegram sent.
Args:
phone (`str` | `int`):
T... | [
"async",
"def",
"sign_in",
"(",
"self",
",",
"phone",
"=",
"None",
",",
"code",
"=",
"None",
",",
"*",
",",
"password",
"=",
"None",
",",
"bot_token",
"=",
"None",
",",
"phone_code_hash",
"=",
"None",
")",
":",
"me",
"=",
"await",
"self",
".",
"get... | Starts or completes the sign in process with the given phone number
or code that Telegram sent.
Args:
phone (`str` | `int`):
The phone to send the code to if no code was provided,
or to override the phone that was previously used with
these re... | [
"Starts",
"or",
"completes",
"the",
"sign",
"in",
"process",
"with",
"the",
"given",
"phone",
"number",
"or",
"code",
"that",
"Telegram",
"sent",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L240-L305 | train | Starts or completes the sign in process with the given phone number or code. | 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods.sign_up | async def sign_up(self, code, first_name, last_name='',
*, phone=None, phone_code_hash=None):
"""
Signs up to Telegram if you don't have an account yet.
You must call .send_code_request(phone) first.
**By using this method you're agreeing to Telegram's
Term... | python | async def sign_up(self, code, first_name, last_name='',
*, phone=None, phone_code_hash=None):
"""
Signs up to Telegram if you don't have an account yet.
You must call .send_code_request(phone) first.
**By using this method you're agreeing to Telegram's
Term... | [
"async",
"def",
"sign_up",
"(",
"self",
",",
"code",
",",
"first_name",
",",
"last_name",
"=",
"''",
",",
"*",
",",
"phone",
"=",
"None",
",",
"phone_code_hash",
"=",
"None",
")",
":",
"me",
"=",
"await",
"self",
".",
"get_me",
"(",
")",
"if",
"me"... | Signs up to Telegram if you don't have an account yet.
You must call .send_code_request(phone) first.
**By using this method you're agreeing to Telegram's
Terms of Service. This is required and your account
will be banned otherwise.** See https://telegram.org/tos
and https://cor... | [
"Signs",
"up",
"to",
"Telegram",
"if",
"you",
"don",
"t",
"have",
"an",
"account",
"yet",
".",
"You",
"must",
"call",
".",
"send_code_request",
"(",
"phone",
")",
"first",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L307-L366 | train | Signs up to Telegram. | 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods._on_login | def _on_login(self, user):
"""
Callback called whenever the login or sign up process completes.
Returns the input user parameter.
"""
self._bot = bool(user.bot)
self._self_input_peer = utils.get_input_peer(user, allow_self=False)
self._authorized = True
... | python | def _on_login(self, user):
"""
Callback called whenever the login or sign up process completes.
Returns the input user parameter.
"""
self._bot = bool(user.bot)
self._self_input_peer = utils.get_input_peer(user, allow_self=False)
self._authorized = True
... | [
"def",
"_on_login",
"(",
"self",
",",
"user",
")",
":",
"self",
".",
"_bot",
"=",
"bool",
"(",
"user",
".",
"bot",
")",
"self",
".",
"_self_input_peer",
"=",
"utils",
".",
"get_input_peer",
"(",
"user",
",",
"allow_self",
"=",
"False",
")",
"self",
"... | Callback called whenever the login or sign up process completes.
Returns the input user parameter. | [
"Callback",
"called",
"whenever",
"the",
"login",
"or",
"sign",
"up",
"process",
"completes",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L368-L378 | train | Called when the login or sign up process completes. | 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods.send_code_request | async def send_code_request(self, phone, *, force_sms=False):
"""
Sends a code request to the specified phone number.
Args:
phone (`str` | `int`):
The phone to which the code will be sent.
force_sms (`bool`, optional):
Whether to force se... | python | async def send_code_request(self, phone, *, force_sms=False):
"""
Sends a code request to the specified phone number.
Args:
phone (`str` | `int`):
The phone to which the code will be sent.
force_sms (`bool`, optional):
Whether to force se... | [
"async",
"def",
"send_code_request",
"(",
"self",
",",
"phone",
",",
"*",
",",
"force_sms",
"=",
"False",
")",
":",
"phone",
"=",
"utils",
".",
"parse_phone",
"(",
"phone",
")",
"or",
"self",
".",
"_phone",
"phone_hash",
"=",
"self",
".",
"_phone_code_ha... | Sends a code request to the specified phone number.
Args:
phone (`str` | `int`):
The phone to which the code will be sent.
force_sms (`bool`, optional):
Whether to force sending as SMS.
Returns:
An instance of :tl:`SentCode`. | [
"Sends",
"a",
"code",
"request",
"to",
"the",
"specified",
"phone",
"number",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L380-L417 | train | Sends a code request to the specified phone number. | 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods.log_out | async def log_out(self):
"""
Logs out Telegram and deletes the current ``*.session`` file.
Returns:
``True`` if the operation was successful.
"""
try:
await self(functions.auth.LogOutRequest())
except errors.RPCError:
return False
... | python | async def log_out(self):
"""
Logs out Telegram and deletes the current ``*.session`` file.
Returns:
``True`` if the operation was successful.
"""
try:
await self(functions.auth.LogOutRequest())
except errors.RPCError:
return False
... | [
"async",
"def",
"log_out",
"(",
"self",
")",
":",
"try",
":",
"await",
"self",
"(",
"functions",
".",
"auth",
".",
"LogOutRequest",
"(",
")",
")",
"except",
"errors",
".",
"RPCError",
":",
"return",
"False",
"self",
".",
"_bot",
"=",
"None",
"self",
... | Logs out Telegram and deletes the current ``*.session`` file.
Returns:
``True`` if the operation was successful. | [
"Logs",
"out",
"Telegram",
"and",
"deletes",
"the",
"current",
"*",
".",
"session",
"file",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L419-L438 | train | Logs out Telegram and deletes the current. session 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... |
LonamiWebs/Telethon | telethon/client/auth.py | AuthMethods.edit_2fa | async def edit_2fa(
self, current_password=None, new_password=None,
*, hint='', email=None, email_code_callback=None):
"""
Changes the 2FA settings of the logged in user, according to the
passed parameters. Take note of the parameter explanations.
Note that this ... | python | async def edit_2fa(
self, current_password=None, new_password=None,
*, hint='', email=None, email_code_callback=None):
"""
Changes the 2FA settings of the logged in user, according to the
passed parameters. Take note of the parameter explanations.
Note that this ... | [
"async",
"def",
"edit_2fa",
"(",
"self",
",",
"current_password",
"=",
"None",
",",
"new_password",
"=",
"None",
",",
"*",
",",
"hint",
"=",
"''",
",",
"email",
"=",
"None",
",",
"email_code_callback",
"=",
"None",
")",
":",
"if",
"new_password",
"is",
... | Changes the 2FA settings of the logged in user, according to the
passed parameters. Take note of the parameter explanations.
Note that this method may be *incredibly* slow depending on the
prime numbers that must be used during the process to make sure
that everything is safe.
... | [
"Changes",
"the",
"2FA",
"settings",
"of",
"the",
"logged",
"in",
"user",
"according",
"to",
"the",
"passed",
"parameters",
".",
"Take",
"note",
"of",
"the",
"parameter",
"explanations",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/auth.py#L440-L527 | train | Edit the 2FA settings of the logged in 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... |
LonamiWebs/Telethon | telethon_generator/parsers/errors.py | _get_class_name | def _get_class_name(error_code):
"""
Gets the corresponding class name for the given error code,
this either being an integer (thus base error name) or str.
"""
if isinstance(error_code, int):
return KNOWN_BASE_CLASSES.get(
error_code, 'RPCError' + str(error_code).replace('-', 'N... | python | def _get_class_name(error_code):
"""
Gets the corresponding class name for the given error code,
this either being an integer (thus base error name) or str.
"""
if isinstance(error_code, int):
return KNOWN_BASE_CLASSES.get(
error_code, 'RPCError' + str(error_code).replace('-', 'N... | [
"def",
"_get_class_name",
"(",
"error_code",
")",
":",
"if",
"isinstance",
"(",
"error_code",
",",
"int",
")",
":",
"return",
"KNOWN_BASE_CLASSES",
".",
"get",
"(",
"error_code",
",",
"'RPCError'",
"+",
"str",
"(",
"error_code",
")",
".",
"replace",
"(",
"... | Gets the corresponding class name for the given error code,
this either being an integer (thus base error name) or str. | [
"Gets",
"the",
"corresponding",
"class",
"name",
"for",
"the",
"given",
"error",
"code",
"this",
"either",
"being",
"an",
"integer",
"(",
"thus",
"base",
"error",
"name",
")",
"or",
"str",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_generator/parsers/errors.py#L19-L30 | train | Gets the class name for the given error code. | 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... |
LonamiWebs/Telethon | telethon_generator/parsers/errors.py | parse_errors | def parse_errors(csv_file):
"""
Parses the input CSV file with columns (name, error codes, description)
and yields `Error` instances as a result.
"""
with csv_file.open(newline='') as f:
f = csv.reader(f)
next(f, None) # header
for line, tup in enumerate(f, start=2):
... | python | def parse_errors(csv_file):
"""
Parses the input CSV file with columns (name, error codes, description)
and yields `Error` instances as a result.
"""
with csv_file.open(newline='') as f:
f = csv.reader(f)
next(f, None) # header
for line, tup in enumerate(f, start=2):
... | [
"def",
"parse_errors",
"(",
"csv_file",
")",
":",
"with",
"csv_file",
".",
"open",
"(",
"newline",
"=",
"''",
")",
"as",
"f",
":",
"f",
"=",
"csv",
".",
"reader",
"(",
"f",
")",
"next",
"(",
"f",
",",
"None",
")",
"# header",
"for",
"line",
",",
... | Parses the input CSV file with columns (name, error codes, description)
and yields `Error` instances as a result. | [
"Parses",
"the",
"input",
"CSV",
"file",
"with",
"columns",
"(",
"name",
"error",
"codes",
"description",
")",
"and",
"yields",
"Error",
"instances",
"as",
"a",
"result",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_generator/parsers/errors.py#L55-L76 | train | Parses the input CSV file with columns name error codes description and yields Error instances as a result. | 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... |
LonamiWebs/Telethon | telethon/network/authenticator.py | do_authentication | async def do_authentication(sender):
"""
Executes the authentication process with the Telegram servers.
:param sender: a connected `MTProtoPlainSender`.
:return: returns a (authorization key, time offset) tuple.
"""
# Step 1 sending: PQ Request, endianness doesn't matter since it's random
n... | python | async def do_authentication(sender):
"""
Executes the authentication process with the Telegram servers.
:param sender: a connected `MTProtoPlainSender`.
:return: returns a (authorization key, time offset) tuple.
"""
# Step 1 sending: PQ Request, endianness doesn't matter since it's random
n... | [
"async",
"def",
"do_authentication",
"(",
"sender",
")",
":",
"# Step 1 sending: PQ Request, endianness doesn't matter since it's random",
"nonce",
"=",
"int",
".",
"from_bytes",
"(",
"os",
".",
"urandom",
"(",
"16",
")",
",",
"'big'",
",",
"signed",
"=",
"True",
... | Executes the authentication process with the Telegram servers.
:param sender: a connected `MTProtoPlainSender`.
:return: returns a (authorization key, time offset) tuple. | [
"Executes",
"the",
"authentication",
"process",
"with",
"the",
"Telegram",
"servers",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/network/authenticator.py#L22-L169 | train | Executes the authentication process with Telegram servers. | 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... |
LonamiWebs/Telethon | telethon/network/authenticator.py | get_int | def get_int(byte_array, signed=True):
"""
Gets the specified integer from its byte array.
This should be used by this module alone, as it works with big endian.
:param byte_array: the byte array representing th integer.
:param signed: whether the number is signed or not.
:return: the integer re... | python | def get_int(byte_array, signed=True):
"""
Gets the specified integer from its byte array.
This should be used by this module alone, as it works with big endian.
:param byte_array: the byte array representing th integer.
:param signed: whether the number is signed or not.
:return: the integer re... | [
"def",
"get_int",
"(",
"byte_array",
",",
"signed",
"=",
"True",
")",
":",
"return",
"int",
".",
"from_bytes",
"(",
"byte_array",
",",
"byteorder",
"=",
"'big'",
",",
"signed",
"=",
"signed",
")"
] | Gets the specified integer from its byte array.
This should be used by this module alone, as it works with big endian.
:param byte_array: the byte array representing th integer.
:param signed: whether the number is signed or not.
:return: the integer representing the given byte array. | [
"Gets",
"the",
"specified",
"integer",
"from",
"its",
"byte",
"array",
".",
"This",
"should",
"be",
"used",
"by",
"this",
"module",
"alone",
"as",
"it",
"works",
"with",
"big",
"endian",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/network/authenticator.py#L172-L181 | train | Gets the specified integer from its byte array. | 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... |
LonamiWebs/Telethon | telethon_examples/gui.py | callback | def callback(func):
"""
This decorator turns `func` into a callback for Tkinter
to be able to use, even if `func` is an awaitable coroutine.
"""
@functools.wraps(func)
def wrapped(*args, **kwargs):
result = func(*args, **kwargs)
if inspect.iscoroutine(result):
aio_loo... | python | def callback(func):
"""
This decorator turns `func` into a callback for Tkinter
to be able to use, even if `func` is an awaitable coroutine.
"""
@functools.wraps(func)
def wrapped(*args, **kwargs):
result = func(*args, **kwargs)
if inspect.iscoroutine(result):
aio_loo... | [
"def",
"callback",
"(",
"func",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"func",
")",
"def",
"wrapped",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"ins... | This decorator turns `func` into a callback for Tkinter
to be able to use, even if `func` is an awaitable coroutine. | [
"This",
"decorator",
"turns",
"func",
"into",
"a",
"callback",
"for",
"Tkinter",
"to",
"be",
"able",
"to",
"use",
"even",
"if",
"func",
"is",
"an",
"awaitable",
"coroutine",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/gui.py#L47-L58 | train | A decorator that turns a function into a callback for Tkinter
to be able to use. | 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... |
LonamiWebs/Telethon | telethon_examples/gui.py | App.post_init | async def post_init(self):
"""
Completes the initialization of our application.
Since `__init__` cannot be `async` we use this.
"""
if await self.cl.is_user_authorized():
self.set_signed_in(await self.cl.get_me())
else:
# User is not logged in, con... | python | async def post_init(self):
"""
Completes the initialization of our application.
Since `__init__` cannot be `async` we use this.
"""
if await self.cl.is_user_authorized():
self.set_signed_in(await self.cl.get_me())
else:
# User is not logged in, con... | [
"async",
"def",
"post_init",
"(",
"self",
")",
":",
"if",
"await",
"self",
".",
"cl",
".",
"is_user_authorized",
"(",
")",
":",
"self",
".",
"set_signed_in",
"(",
"await",
"self",
".",
"cl",
".",
"get_me",
"(",
")",
")",
"else",
":",
"# User is not log... | Completes the initialization of our application.
Since `__init__` cannot be `async` we use this. | [
"Completes",
"the",
"initialization",
"of",
"our",
"application",
".",
"Since",
"__init__",
"cannot",
"be",
"async",
"we",
"use",
"this",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/gui.py#L137-L148 | train | Complete the initialization of our application. | 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... |
LonamiWebs/Telethon | telethon_examples/gui.py | App.on_message | async def on_message(self, event):
"""
Event handler that will add new messages to the message log.
"""
# We want to show only messages sent to this chat
if event.chat_id != self.chat_id:
return
# Save the message ID so we know which to reply to
self.... | python | async def on_message(self, event):
"""
Event handler that will add new messages to the message log.
"""
# We want to show only messages sent to this chat
if event.chat_id != self.chat_id:
return
# Save the message ID so we know which to reply to
self.... | [
"async",
"def",
"on_message",
"(",
"self",
",",
"event",
")",
":",
"# We want to show only messages sent to this chat",
"if",
"event",
".",
"chat_id",
"!=",
"self",
".",
"chat_id",
":",
"return",
"# Save the message ID so we know which to reply to",
"self",
".",
"messag... | Event handler that will add new messages to the message log. | [
"Event",
"handler",
"that",
"will",
"add",
"new",
"messages",
"to",
"the",
"message",
"log",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/gui.py#L150-L178 | train | Event handler that will add new messages to the message log. | 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... |
LonamiWebs/Telethon | telethon_examples/gui.py | App.sign_in | async def sign_in(self, event=None):
"""
Note the `event` argument. This is required since this callback
may be called from a ``widget.bind`` (such as ``'<Return>'``),
which sends information about the event we don't care about.
This callback logs out if authorized, signs in if ... | python | async def sign_in(self, event=None):
"""
Note the `event` argument. This is required since this callback
may be called from a ``widget.bind`` (such as ``'<Return>'``),
which sends information about the event we don't care about.
This callback logs out if authorized, signs in if ... | [
"async",
"def",
"sign_in",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"self",
".",
"sign_in_label",
".",
"configure",
"(",
"text",
"=",
"'Working...'",
")",
"self",
".",
"sign_in_entry",
".",
"configure",
"(",
"state",
"=",
"tkinter",
".",
"DISABL... | Note the `event` argument. This is required since this callback
may be called from a ``widget.bind`` (such as ``'<Return>'``),
which sends information about the event we don't care about.
This callback logs out if authorized, signs in if a code was
sent or a bot token is input, or sends... | [
"Note",
"the",
"event",
"argument",
".",
"This",
"is",
"required",
"since",
"this",
"callback",
"may",
"be",
"called",
"from",
"a",
"widget",
".",
"bind",
"(",
"such",
"as",
"<Return",
">",
")",
"which",
"sends",
"information",
"about",
"the",
"event",
"... | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/gui.py#L182-L209 | train | Sign in 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... |
LonamiWebs/Telethon | telethon_examples/gui.py | App.set_signed_in | def set_signed_in(self, me):
"""
Configures the application as "signed in" (displays user's
name and disables the entry to input phone/bot token/code).
"""
self.me = me
self.sign_in_label.configure(text='Signed in')
self.sign_in_entry.configure(state=tkinter.NORMA... | python | def set_signed_in(self, me):
"""
Configures the application as "signed in" (displays user's
name and disables the entry to input phone/bot token/code).
"""
self.me = me
self.sign_in_label.configure(text='Signed in')
self.sign_in_entry.configure(state=tkinter.NORMA... | [
"def",
"set_signed_in",
"(",
"self",
",",
"me",
")",
":",
"self",
".",
"me",
"=",
"me",
"self",
".",
"sign_in_label",
".",
"configure",
"(",
"text",
"=",
"'Signed in'",
")",
"self",
".",
"sign_in_entry",
".",
"configure",
"(",
"state",
"=",
"tkinter",
... | Configures the application as "signed in" (displays user's
name and disables the entry to input phone/bot token/code). | [
"Configures",
"the",
"application",
"as",
"signed",
"in",
"(",
"displays",
"user",
"s",
"name",
"and",
"disables",
"the",
"entry",
"to",
"input",
"phone",
"/",
"bot",
"token",
"/",
"code",
")",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/gui.py#L211-L223 | train | Sets the application as signed in. | 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... |
LonamiWebs/Telethon | telethon_examples/gui.py | App.send_message | async def send_message(self, event=None):
"""
Sends a message. Does nothing if the client is not connected.
"""
if not self.cl.is_connected():
return
# The user needs to configure a chat where the message should be sent.
#
# If the chat ID does not ex... | python | async def send_message(self, event=None):
"""
Sends a message. Does nothing if the client is not connected.
"""
if not self.cl.is_connected():
return
# The user needs to configure a chat where the message should be sent.
#
# If the chat ID does not ex... | [
"async",
"def",
"send_message",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"cl",
".",
"is_connected",
"(",
")",
":",
"return",
"# The user needs to configure a chat where the message should be sent.",
"#",
"# If the chat ID does not ex... | Sends a message. Does nothing if the client is not connected. | [
"Sends",
"a",
"message",
".",
"Does",
"nothing",
"if",
"the",
"client",
"is",
"not",
"connected",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/gui.py#L227-L305 | train | Sends a message to the 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... |
LonamiWebs/Telethon | telethon_examples/gui.py | App.check_chat | async def check_chat(self, event=None):
"""
Checks the input chat where to send and listen messages from.
"""
if self.me is None:
return # Not logged in yet
chat = self.chat.get().strip()
try:
chat = int(chat)
except ValueError:
... | python | async def check_chat(self, event=None):
"""
Checks the input chat where to send and listen messages from.
"""
if self.me is None:
return # Not logged in yet
chat = self.chat.get().strip()
try:
chat = int(chat)
except ValueError:
... | [
"async",
"def",
"check_chat",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"self",
".",
"me",
"is",
"None",
":",
"return",
"# Not logged in yet",
"chat",
"=",
"self",
".",
"chat",
".",
"get",
"(",
")",
".",
"strip",
"(",
")",
"try",
":",... | Checks the input chat where to send and listen messages from. | [
"Checks",
"the",
"input",
"chat",
"where",
"to",
"send",
"and",
"listen",
"messages",
"from",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon_examples/gui.py#L309-L341 | train | Checks the input chat and if the user is logged in and if it has a message that we can send and listen them. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/adminlogevent.py | AdminLogEvent.old | def old(self):
"""
The old value from the event.
"""
ori = self.original.action
if isinstance(ori, (
types.ChannelAdminLogEventActionChangeAbout,
types.ChannelAdminLogEventActionChangeTitle,
types.ChannelAdminLogEventActionChangeUse... | python | def old(self):
"""
The old value from the event.
"""
ori = self.original.action
if isinstance(ori, (
types.ChannelAdminLogEventActionChangeAbout,
types.ChannelAdminLogEventActionChangeTitle,
types.ChannelAdminLogEventActionChangeUse... | [
"def",
"old",
"(",
"self",
")",
":",
"ori",
"=",
"self",
".",
"original",
".",
"action",
"if",
"isinstance",
"(",
"ori",
",",
"(",
"types",
".",
"ChannelAdminLogEventActionChangeAbout",
",",
"types",
".",
"ChannelAdminLogEventActionChangeTitle",
",",
"types",
... | The old value from the event. | [
"The",
"old",
"value",
"from",
"the",
"event",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/adminlogevent.py#L61-L92 | train | Returns the old value from the event. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/adminlogevent.py | AdminLogEvent.new | def new(self):
"""
The new value present in the event.
"""
ori = self.original.action
if isinstance(ori, (
types.ChannelAdminLogEventActionChangeAbout,
types.ChannelAdminLogEventActionChangeTitle,
types.ChannelAdminLogEventActionCha... | python | def new(self):
"""
The new value present in the event.
"""
ori = self.original.action
if isinstance(ori, (
types.ChannelAdminLogEventActionChangeAbout,
types.ChannelAdminLogEventActionChangeTitle,
types.ChannelAdminLogEventActionCha... | [
"def",
"new",
"(",
"self",
")",
":",
"ori",
"=",
"self",
".",
"original",
".",
"action",
"if",
"isinstance",
"(",
"ori",
",",
"(",
"types",
".",
"ChannelAdminLogEventActionChangeAbout",
",",
"types",
".",
"ChannelAdminLogEventActionChangeTitle",
",",
"types",
... | The new value present in the event. | [
"The",
"new",
"value",
"present",
"in",
"the",
"event",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/adminlogevent.py#L95-L125 | train | Returns the new value present in the event. | 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... |
LonamiWebs/Telethon | telethon/crypto/aes.py | AES.decrypt_ige | def decrypt_ige(cipher_text, key, iv):
"""
Decrypts the given text in 16-bytes blocks by using the
given key and 32-bytes initialization vector.
"""
if cryptg:
return cryptg.decrypt_ige(cipher_text, key, iv)
if libssl.decrypt_ige:
return libssl.dec... | python | def decrypt_ige(cipher_text, key, iv):
"""
Decrypts the given text in 16-bytes blocks by using the
given key and 32-bytes initialization vector.
"""
if cryptg:
return cryptg.decrypt_ige(cipher_text, key, iv)
if libssl.decrypt_ige:
return libssl.dec... | [
"def",
"decrypt_ige",
"(",
"cipher_text",
",",
"key",
",",
"iv",
")",
":",
"if",
"cryptg",
":",
"return",
"cryptg",
".",
"decrypt_ige",
"(",
"cipher_text",
",",
"key",
",",
"iv",
")",
"if",
"libssl",
".",
"decrypt_ige",
":",
"return",
"libssl",
".",
"d... | Decrypts the given text in 16-bytes blocks by using the
given key and 32-bytes initialization vector. | [
"Decrypts",
"the",
"given",
"text",
"in",
"16",
"-",
"bytes",
"blocks",
"by",
"using",
"the",
"given",
"key",
"and",
"32",
"-",
"bytes",
"initialization",
"vector",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/aes.py#L35-L69 | train | Decrypts the given text in 16 - byte blocks by using the given key and 32 - byte initialization vector. | 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... |
LonamiWebs/Telethon | telethon/crypto/aes.py | AES.encrypt_ige | def encrypt_ige(plain_text, key, iv):
"""
Encrypts the given text in 16-bytes blocks by using the
given key and 32-bytes initialization vector.
"""
padding = len(plain_text) % 16
if padding:
plain_text += os.urandom(16 - padding)
if cryptg:
... | python | def encrypt_ige(plain_text, key, iv):
"""
Encrypts the given text in 16-bytes blocks by using the
given key and 32-bytes initialization vector.
"""
padding = len(plain_text) % 16
if padding:
plain_text += os.urandom(16 - padding)
if cryptg:
... | [
"def",
"encrypt_ige",
"(",
"plain_text",
",",
"key",
",",
"iv",
")",
":",
"padding",
"=",
"len",
"(",
"plain_text",
")",
"%",
"16",
"if",
"padding",
":",
"plain_text",
"+=",
"os",
".",
"urandom",
"(",
"16",
"-",
"padding",
")",
"if",
"cryptg",
":",
... | Encrypts the given text in 16-bytes blocks by using the
given key and 32-bytes initialization vector. | [
"Encrypts",
"the",
"given",
"text",
"in",
"16",
"-",
"bytes",
"blocks",
"by",
"using",
"the",
"given",
"key",
"and",
"32",
"-",
"bytes",
"initialization",
"vector",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/crypto/aes.py#L72-L111 | train | Encrypts the given text in 16 - byte blocks by using the given key and 32 - byte initialization vector. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message._finish_init | def _finish_init(self, client, entities, input_chat):
"""
Finishes the initialization of this message by setting
the client that sent the message and making use of the
known entities.
"""
self._client = client
self._sender = entities.get(self._sender_id)
i... | python | def _finish_init(self, client, entities, input_chat):
"""
Finishes the initialization of this message by setting
the client that sent the message and making use of the
known entities.
"""
self._client = client
self._sender = entities.get(self._sender_id)
i... | [
"def",
"_finish_init",
"(",
"self",
",",
"client",
",",
"entities",
",",
"input_chat",
")",
":",
"self",
".",
"_client",
"=",
"client",
"self",
".",
"_sender",
"=",
"entities",
".",
"get",
"(",
"self",
".",
"_sender_id",
")",
"if",
"self",
".",
"_sende... | Finishes the initialization of this message by setting
the client that sent the message and making use of the
known entities. | [
"Finishes",
"the",
"initialization",
"of",
"this",
"message",
"by",
"setting",
"the",
"client",
"that",
"sent",
"the",
"message",
"and",
"making",
"use",
"of",
"the",
"known",
"entities",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L206-L253 | train | Finishes the initialization 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.text | def text(self):
"""
The message text, formatted using the client's default
parse mode. Will be ``None`` for :tl:`MessageService`.
"""
if self._text is None and self._client:
self._text = self._client.parse_mode.unparse(
self.message, self.entities)
... | python | def text(self):
"""
The message text, formatted using the client's default
parse mode. Will be ``None`` for :tl:`MessageService`.
"""
if self._text is None and self._client:
self._text = self._client.parse_mode.unparse(
self.message, self.entities)
... | [
"def",
"text",
"(",
"self",
")",
":",
"if",
"self",
".",
"_text",
"is",
"None",
"and",
"self",
".",
"_client",
":",
"self",
".",
"_text",
"=",
"self",
".",
"_client",
".",
"parse_mode",
".",
"unparse",
"(",
"self",
".",
"message",
",",
"self",
".",... | The message text, formatted using the client's default
parse mode. Will be ``None`` for :tl:`MessageService`. | [
"The",
"message",
"text",
"formatted",
"using",
"the",
"client",
"s",
"default",
"parse",
"mode",
".",
"Will",
"be",
"None",
"for",
":",
"tl",
":",
"MessageService",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L271-L280 | train | The message text formatted using the client s default
parse mode. Will be None for unknown types. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.buttons | def buttons(self):
"""
Returns a matrix (list of lists) containing all buttons of the message
as `MessageButton <telethon.tl.custom.messagebutton.MessageButton>`
instances.
"""
if self._buttons is None and self.reply_markup:
if not self.input_chat:
... | python | def buttons(self):
"""
Returns a matrix (list of lists) containing all buttons of the message
as `MessageButton <telethon.tl.custom.messagebutton.MessageButton>`
instances.
"""
if self._buttons is None and self.reply_markup:
if not self.input_chat:
... | [
"def",
"buttons",
"(",
"self",
")",
":",
"if",
"self",
".",
"_buttons",
"is",
"None",
"and",
"self",
".",
"reply_markup",
":",
"if",
"not",
"self",
".",
"input_chat",
":",
"return",
"try",
":",
"bot",
"=",
"self",
".",
"_needed_markup_bot",
"(",
")",
... | Returns a matrix (list of lists) containing all buttons of the message
as `MessageButton <telethon.tl.custom.messagebutton.MessageButton>`
instances. | [
"Returns",
"a",
"matrix",
"(",
"list",
"of",
"lists",
")",
"containing",
"all",
"buttons",
"of",
"the",
"message",
"as",
"MessageButton",
"<telethon",
".",
"tl",
".",
"custom",
".",
"messagebutton",
".",
"MessageButton",
">",
"instances",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L327-L343 | train | Returns a matrix containing all buttons of the message
as MessageButton instances. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.get_buttons | async def get_buttons(self):
"""
Returns `buttons`, but will make an API call to find the
input chat (needed for the buttons) unless it's already cached.
"""
if not self.buttons and self.reply_markup:
chat = await self.get_input_chat()
if not chat:
... | python | async def get_buttons(self):
"""
Returns `buttons`, but will make an API call to find the
input chat (needed for the buttons) unless it's already cached.
"""
if not self.buttons and self.reply_markup:
chat = await self.get_input_chat()
if not chat:
... | [
"async",
"def",
"get_buttons",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"buttons",
"and",
"self",
".",
"reply_markup",
":",
"chat",
"=",
"await",
"self",
".",
"get_input_chat",
"(",
")",
"if",
"not",
"chat",
":",
"return",
"try",
":",
"bot",
... | Returns `buttons`, but will make an API call to find the
input chat (needed for the buttons) unless it's already cached. | [
"Returns",
"buttons",
"but",
"will",
"make",
"an",
"API",
"call",
"to",
"find",
"the",
"input",
"chat",
"(",
"needed",
"for",
"the",
"buttons",
")",
"unless",
"it",
"s",
"already",
"cached",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L345-L362 | train | Returns the buttons 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.button_count | def button_count(self):
"""
Returns the total button count.
"""
if self._buttons_count is None:
if isinstance(self.reply_markup, (
types.ReplyInlineMarkup, types.ReplyKeyboardMarkup)):
self._buttons_count = sum(
len(row.... | python | def button_count(self):
"""
Returns the total button count.
"""
if self._buttons_count is None:
if isinstance(self.reply_markup, (
types.ReplyInlineMarkup, types.ReplyKeyboardMarkup)):
self._buttons_count = sum(
len(row.... | [
"def",
"button_count",
"(",
"self",
")",
":",
"if",
"self",
".",
"_buttons_count",
"is",
"None",
":",
"if",
"isinstance",
"(",
"self",
".",
"reply_markup",
",",
"(",
"types",
".",
"ReplyInlineMarkup",
",",
"types",
".",
"ReplyKeyboardMarkup",
")",
")",
":"... | Returns the total button count. | [
"Returns",
"the",
"total",
"button",
"count",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L365-L377 | train | Returns the total number of buttons in the reply markup. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.photo | def photo(self):
"""
If the message media is a photo, this returns the :tl:`Photo` object.
This will also return the photo for :tl:`MessageService` if their
action is :tl:`MessageActionChatEditPhoto`.
"""
if isinstance(self.media, types.MessageMediaPhoto):
if ... | python | def photo(self):
"""
If the message media is a photo, this returns the :tl:`Photo` object.
This will also return the photo for :tl:`MessageService` if their
action is :tl:`MessageActionChatEditPhoto`.
"""
if isinstance(self.media, types.MessageMediaPhoto):
if ... | [
"def",
"photo",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
",",
"types",
".",
"MessageMediaPhoto",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
".",
"photo",
",",
"types",
".",
"Photo",
")",
":",
"return",
"self... | If the message media is a photo, this returns the :tl:`Photo` object.
This will also return the photo for :tl:`MessageService` if their
action is :tl:`MessageActionChatEditPhoto`. | [
"If",
"the",
"message",
"media",
"is",
"a",
"photo",
"this",
"returns",
"the",
":",
"tl",
":",
"Photo",
"object",
".",
"This",
"will",
"also",
"return",
"the",
"photo",
"for",
":",
"tl",
":",
"MessageService",
"if",
"their",
"action",
"is",
":",
"tl",
... | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L380-L394 | train | Returns the photo object for this 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.document | def document(self):
"""
If the message media is a document,
this returns the :tl:`Document` object.
"""
if isinstance(self.media, types.MessageMediaDocument):
if isinstance(self.media.document, types.Document):
return self.media.document
else:
... | python | def document(self):
"""
If the message media is a document,
this returns the :tl:`Document` object.
"""
if isinstance(self.media, types.MessageMediaDocument):
if isinstance(self.media.document, types.Document):
return self.media.document
else:
... | [
"def",
"document",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
",",
"types",
".",
"MessageMediaDocument",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
".",
"document",
",",
"types",
".",
"Document",
")",
":",
"retu... | If the message media is a document,
this returns the :tl:`Document` object. | [
"If",
"the",
"message",
"media",
"is",
"a",
"document",
"this",
"returns",
"the",
":",
"tl",
":",
"Document",
"object",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L397-L408 | train | Returns the document 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.web_preview | def web_preview(self):
"""
If the message has a loaded web preview,
this returns the :tl:`WebPage` object.
"""
if isinstance(self.media, types.MessageMediaWebPage):
if isinstance(self.media.webpage, types.WebPage):
return self.media.webpage | python | def web_preview(self):
"""
If the message has a loaded web preview,
this returns the :tl:`WebPage` object.
"""
if isinstance(self.media, types.MessageMediaWebPage):
if isinstance(self.media.webpage, types.WebPage):
return self.media.webpage | [
"def",
"web_preview",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
",",
"types",
".",
"MessageMediaWebPage",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
".",
"webpage",
",",
"types",
".",
"WebPage",
")",
":",
"retu... | If the message has a loaded web preview,
this returns the :tl:`WebPage` object. | [
"If",
"the",
"message",
"has",
"a",
"loaded",
"web",
"preview",
"this",
"returns",
"the",
":",
"tl",
":",
"WebPage",
"object",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L411-L418 | train | Returns the WebPage object that represents the web preview of the 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.game | def game(self):
"""
If the message media is a game, this returns the :tl:`Game`.
"""
if isinstance(self.media, types.MessageMediaGame):
return self.media.game | python | def game(self):
"""
If the message media is a game, this returns the :tl:`Game`.
"""
if isinstance(self.media, types.MessageMediaGame):
return self.media.game | [
"def",
"game",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
",",
"types",
".",
"MessageMediaGame",
")",
":",
"return",
"self",
".",
"media",
".",
"game"
] | If the message media is a game, this returns the :tl:`Game`. | [
"If",
"the",
"message",
"media",
"is",
"a",
"game",
"this",
"returns",
"the",
":",
"tl",
":",
"Game",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L481-L486 | train | Returns the game id of the message media. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.geo | def geo(self):
"""
If the message media is geo, geo live or a venue,
this returns the :tl:`GeoPoint`.
"""
if isinstance(self.media, (types.MessageMediaGeo,
types.MessageMediaGeoLive,
types.MessageMediaVenue)):
... | python | def geo(self):
"""
If the message media is geo, geo live or a venue,
this returns the :tl:`GeoPoint`.
"""
if isinstance(self.media, (types.MessageMediaGeo,
types.MessageMediaGeoLive,
types.MessageMediaVenue)):
... | [
"def",
"geo",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"media",
",",
"(",
"types",
".",
"MessageMediaGeo",
",",
"types",
".",
"MessageMediaGeoLive",
",",
"types",
".",
"MessageMediaVenue",
")",
")",
":",
"return",
"self",
".",
"media"... | If the message media is geo, geo live or a venue,
this returns the :tl:`GeoPoint`. | [
"If",
"the",
"message",
"media",
"is",
"geo",
"geo",
"live",
"or",
"a",
"venue",
"this",
"returns",
"the",
":",
"tl",
":",
"GeoPoint",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L489-L497 | train | Returns the GeoPoint. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.get_entities_text | def get_entities_text(self, cls=None):
"""
Returns a list of tuples [(:tl:`MessageEntity`, `str`)], the string
being the inner text of the message entity (like bold, italics, etc).
Args:
cls (`type`):
Returns entities matching this type only. For example,
... | python | def get_entities_text(self, cls=None):
"""
Returns a list of tuples [(:tl:`MessageEntity`, `str`)], the string
being the inner text of the message entity (like bold, italics, etc).
Args:
cls (`type`):
Returns entities matching this type only. For example,
... | [
"def",
"get_entities_text",
"(",
"self",
",",
"cls",
"=",
"None",
")",
":",
"ent",
"=",
"self",
".",
"entities",
"if",
"not",
"ent",
":",
"return",
"[",
"]",
"if",
"cls",
":",
"ent",
"=",
"[",
"c",
"for",
"c",
"in",
"ent",
"if",
"isinstance",
"("... | Returns a list of tuples [(:tl:`MessageEntity`, `str`)], the string
being the inner text of the message entity (like bold, italics, etc).
Args:
cls (`type`):
Returns entities matching this type only. For example,
the following will print the text for all ``co... | [
"Returns",
"a",
"list",
"of",
"tuples",
"[",
"(",
":",
"tl",
":",
"MessageEntity",
"str",
")",
"]",
"the",
"string",
"being",
"the",
"inner",
"text",
"of",
"the",
"message",
"entity",
"(",
"like",
"bold",
"italics",
"etc",
")",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L564-L588 | train | Returns a list of tuples containing the inner text of the message entity. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.get_reply_message | async def get_reply_message(self):
"""
The `Message` that this message is replying to, or ``None``.
The result will be cached after its first use.
"""
if self._reply_message is None:
if not self.reply_to_msg_id:
return None
# Bots cannot ... | python | async def get_reply_message(self):
"""
The `Message` that this message is replying to, or ``None``.
The result will be cached after its first use.
"""
if self._reply_message is None:
if not self.reply_to_msg_id:
return None
# Bots cannot ... | [
"async",
"def",
"get_reply_message",
"(",
"self",
")",
":",
"if",
"self",
".",
"_reply_message",
"is",
"None",
":",
"if",
"not",
"self",
".",
"reply_to_msg_id",
":",
"return",
"None",
"# Bots cannot access other bots' messages by their ID.",
"# However they can access t... | The `Message` that this message is replying to, or ``None``.
The result will be cached after its first use. | [
"The",
"Message",
"that",
"this",
"message",
"is",
"replying",
"to",
"or",
"None",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L590-L616 | train | Gets the reply message for this 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.respond | async def respond(self, *args, **kwargs):
"""
Responds to the message (not as a reply). Shorthand for
`telethon.client.messages.MessageMethods.send_message`
with ``entity`` already set.
"""
return await self._client.send_message(
await self.get_input_chat(), *... | python | async def respond(self, *args, **kwargs):
"""
Responds to the message (not as a reply). Shorthand for
`telethon.client.messages.MessageMethods.send_message`
with ``entity`` already set.
"""
return await self._client.send_message(
await self.get_input_chat(), *... | [
"async",
"def",
"respond",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"await",
"self",
".",
"_client",
".",
"send_message",
"(",
"await",
"self",
".",
"get_input_chat",
"(",
")",
",",
"*",
"args",
",",
"*",
"*",
"kw... | Responds to the message (not as a reply). Shorthand for
`telethon.client.messages.MessageMethods.send_message`
with ``entity`` already set. | [
"Responds",
"to",
"the",
"message",
"(",
"not",
"as",
"a",
"reply",
")",
".",
"Shorthand",
"for",
"telethon",
".",
"client",
".",
"messages",
".",
"MessageMethods",
".",
"send_message",
"with",
"entity",
"already",
"set",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L618-L625 | train | Respond to the 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.reply | async def reply(self, *args, **kwargs):
"""
Replies to the message (as a reply). Shorthand for
`telethon.client.messages.MessageMethods.send_message`
with both ``entity`` and ``reply_to`` already set.
"""
kwargs['reply_to'] = self.id
return await self._client.send... | python | async def reply(self, *args, **kwargs):
"""
Replies to the message (as a reply). Shorthand for
`telethon.client.messages.MessageMethods.send_message`
with both ``entity`` and ``reply_to`` already set.
"""
kwargs['reply_to'] = self.id
return await self._client.send... | [
"async",
"def",
"reply",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'reply_to'",
"]",
"=",
"self",
".",
"id",
"return",
"await",
"self",
".",
"_client",
".",
"send_message",
"(",
"await",
"self",
".",
"get_input... | Replies to the message (as a reply). Shorthand for
`telethon.client.messages.MessageMethods.send_message`
with both ``entity`` and ``reply_to`` already set. | [
"Replies",
"to",
"the",
"message",
"(",
"as",
"a",
"reply",
")",
".",
"Shorthand",
"for",
"telethon",
".",
"client",
".",
"messages",
".",
"MessageMethods",
".",
"send_message",
"with",
"both",
"entity",
"and",
"reply_to",
"already",
"set",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L627-L635 | train | Reply to the 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.forward_to | async def forward_to(self, *args, **kwargs):
"""
Forwards the message. Shorthand for
`telethon.client.messages.MessageMethods.forward_messages`
with both ``messages`` and ``from_peer`` already set.
If you need to forward more than one message at once, don't use
this `for... | python | async def forward_to(self, *args, **kwargs):
"""
Forwards the message. Shorthand for
`telethon.client.messages.MessageMethods.forward_messages`
with both ``messages`` and ``from_peer`` already set.
If you need to forward more than one message at once, don't use
this `for... | [
"async",
"def",
"forward_to",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'messages'",
"]",
"=",
"self",
".",
"id",
"kwargs",
"[",
"'from_peer'",
"]",
"=",
"await",
"self",
".",
"get_input_chat",
"(",
")",
"retur... | Forwards the message. Shorthand for
`telethon.client.messages.MessageMethods.forward_messages`
with both ``messages`` and ``from_peer`` already set.
If you need to forward more than one message at once, don't use
this `forward_to` method. Use a
`telethon.client.telegramclient.Te... | [
"Forwards",
"the",
"message",
".",
"Shorthand",
"for",
"telethon",
".",
"client",
".",
"messages",
".",
"MessageMethods",
".",
"forward_messages",
"with",
"both",
"messages",
"and",
"from_peer",
"already",
"set",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L637-L649 | train | Forward the message to the input 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.edit | async def edit(self, *args, **kwargs):
"""
Edits the message iff it's outgoing. Shorthand for
`telethon.client.messages.MessageMethods.edit_message`
with both ``entity`` and ``message`` already set.
Returns ``None`` if the message was incoming,
or the edited `Message` ot... | python | async def edit(self, *args, **kwargs):
"""
Edits the message iff it's outgoing. Shorthand for
`telethon.client.messages.MessageMethods.edit_message`
with both ``entity`` and ``message`` already set.
Returns ``None`` if the message was incoming,
or the edited `Message` ot... | [
"async",
"def",
"edit",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"fwd_from",
"or",
"not",
"self",
".",
"out",
":",
"return",
"None",
"# We assume self.out was patched for our chat",
"if",
"'link_preview'",
"not",
... | Edits the message iff it's outgoing. Shorthand for
`telethon.client.messages.MessageMethods.edit_message`
with both ``entity`` and ``message`` already set.
Returns ``None`` if the message was incoming,
or the edited `Message` otherwise.
.. note::
This is different ... | [
"Edits",
"the",
"message",
"iff",
"it",
"s",
"outgoing",
".",
"Shorthand",
"for",
"telethon",
".",
"client",
".",
"messages",
".",
"MessageMethods",
".",
"edit_message",
"with",
"both",
"entity",
"and",
"message",
"already",
"set",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L651-L684 | train | Edits the message iff it s outgoing. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.delete | async def delete(self, *args, **kwargs):
"""
Deletes the message. You're responsible for checking whether you
have the permission to do so, or to except the error otherwise.
Shorthand for
`telethon.client.messages.MessageMethods.delete_messages` with
``entity`` and ``mess... | python | async def delete(self, *args, **kwargs):
"""
Deletes the message. You're responsible for checking whether you
have the permission to do so, or to except the error otherwise.
Shorthand for
`telethon.client.messages.MessageMethods.delete_messages` with
``entity`` and ``mess... | [
"async",
"def",
"delete",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"await",
"self",
".",
"_client",
".",
"delete_messages",
"(",
"await",
"self",
".",
"get_input_chat",
"(",
")",
",",
"[",
"self",
".",
"id",
"]",
... | Deletes the message. You're responsible for checking whether you
have the permission to do so, or to except the error otherwise.
Shorthand for
`telethon.client.messages.MessageMethods.delete_messages` with
``entity`` and ``message_ids`` already set.
If you need to delete more th... | [
"Deletes",
"the",
"message",
".",
"You",
"re",
"responsible",
"for",
"checking",
"whether",
"you",
"have",
"the",
"permission",
"to",
"do",
"so",
"or",
"to",
"except",
"the",
"error",
"otherwise",
".",
"Shorthand",
"for",
"telethon",
".",
"client",
".",
"m... | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L686-L701 | train | Deletes the 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.download_media | async def download_media(self, *args, **kwargs):
"""
Downloads the media contained in the message, if any. Shorthand
for `telethon.client.downloads.DownloadMethods.download_media`
with the ``message`` already set.
"""
return await self._client.download_media(self, *args, ... | python | async def download_media(self, *args, **kwargs):
"""
Downloads the media contained in the message, if any. Shorthand
for `telethon.client.downloads.DownloadMethods.download_media`
with the ``message`` already set.
"""
return await self._client.download_media(self, *args, ... | [
"async",
"def",
"download_media",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"await",
"self",
".",
"_client",
".",
"download_media",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | Downloads the media contained in the message, if any. Shorthand
for `telethon.client.downloads.DownloadMethods.download_media`
with the ``message`` already set. | [
"Downloads",
"the",
"media",
"contained",
"in",
"the",
"message",
"if",
"any",
".",
"Shorthand",
"for",
"telethon",
".",
"client",
".",
"downloads",
".",
"DownloadMethods",
".",
"download_media",
"with",
"the",
"message",
"already",
"set",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L703-L709 | train | Downloads the media contained in the 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message.click | async def click(self, i=None, j=None,
*, text=None, filter=None, data=None):
"""
Calls `telethon.tl.custom.messagebutton.MessageButton.click`
for the specified button.
Does nothing if the message has no buttons.
Args:
i (`int`):
C... | python | async def click(self, i=None, j=None,
*, text=None, filter=None, data=None):
"""
Calls `telethon.tl.custom.messagebutton.MessageButton.click`
for the specified button.
Does nothing if the message has no buttons.
Args:
i (`int`):
C... | [
"async",
"def",
"click",
"(",
"self",
",",
"i",
"=",
"None",
",",
"j",
"=",
"None",
",",
"*",
",",
"text",
"=",
"None",
",",
"filter",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"if",
"data",
":",
"if",
"not",
"await",
"self",
".",
"get... | Calls `telethon.tl.custom.messagebutton.MessageButton.click`
for the specified button.
Does nothing if the message has no buttons.
Args:
i (`int`):
Clicks the i'th button (starting from the index 0).
Will ``raise IndexError`` if out of bounds. Exampl... | [
"Calls",
"telethon",
".",
"tl",
".",
"custom",
".",
"messagebutton",
".",
"MessageButton",
".",
"click",
"for",
"the",
"specified",
"button",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L711-L803 | train | Clicks the specified button on the specified i th column and text. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message._reload_message | async def _reload_message(self):
"""
Re-fetches this message to reload the sender and chat entities,
along with their input versions.
"""
try:
chat = await self.get_input_chat() if self.is_channel else None
msg = await self._client.get_messages(chat, ids=s... | python | async def _reload_message(self):
"""
Re-fetches this message to reload the sender and chat entities,
along with their input versions.
"""
try:
chat = await self.get_input_chat() if self.is_channel else None
msg = await self._client.get_messages(chat, ids=s... | [
"async",
"def",
"_reload_message",
"(",
"self",
")",
":",
"try",
":",
"chat",
"=",
"await",
"self",
".",
"get_input_chat",
"(",
")",
"if",
"self",
".",
"is_channel",
"else",
"None",
"msg",
"=",
"await",
"self",
".",
"_client",
".",
"get_messages",
"(",
... | Re-fetches this message to reload the sender and chat entities,
along with their input versions. | [
"Re",
"-",
"fetches",
"this",
"message",
"to",
"reload",
"the",
"sender",
"and",
"chat",
"entities",
"along",
"with",
"their",
"input",
"versions",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L809-L829 | train | Re - fetches this message and re - saves the sender and chat entities along with their input versions. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message._set_buttons | def _set_buttons(self, chat, bot):
"""
Helper methods to set the buttons given the input sender and chat.
"""
if isinstance(self.reply_markup, (
types.ReplyInlineMarkup, types.ReplyKeyboardMarkup)):
self._buttons = [[
MessageButton(self._client... | python | def _set_buttons(self, chat, bot):
"""
Helper methods to set the buttons given the input sender and chat.
"""
if isinstance(self.reply_markup, (
types.ReplyInlineMarkup, types.ReplyKeyboardMarkup)):
self._buttons = [[
MessageButton(self._client... | [
"def",
"_set_buttons",
"(",
"self",
",",
"chat",
",",
"bot",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"reply_markup",
",",
"(",
"types",
".",
"ReplyInlineMarkup",
",",
"types",
".",
"ReplyKeyboardMarkup",
")",
")",
":",
"self",
".",
"_buttons",
"=... | Helper methods to set the buttons given the input sender and chat. | [
"Helper",
"methods",
"to",
"set",
"the",
"buttons",
"given",
"the",
"input",
"sender",
"and",
"chat",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L834-L844 | train | Sets the buttons for this 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message._needed_markup_bot | def _needed_markup_bot(self):
"""
Returns the input peer of the bot that's needed for the reply markup.
This is necessary for :tl:`KeyboardButtonSwitchInline` since we need
to know what bot we want to start. Raises ``ValueError`` if the bot
cannot be found but is needed. Returns... | python | def _needed_markup_bot(self):
"""
Returns the input peer of the bot that's needed for the reply markup.
This is necessary for :tl:`KeyboardButtonSwitchInline` since we need
to know what bot we want to start. Raises ``ValueError`` if the bot
cannot be found but is needed. Returns... | [
"def",
"_needed_markup_bot",
"(",
"self",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"reply_markup",
",",
"(",
"types",
".",
"ReplyInlineMarkup",
",",
"types",
".",
"ReplyKeyboardMarkup",
")",
")",
":",
"return",
"None",
"for",
"row",
"in",
"se... | Returns the input peer of the bot that's needed for the reply markup.
This is necessary for :tl:`KeyboardButtonSwitchInline` since we need
to know what bot we want to start. Raises ``ValueError`` if the bot
cannot be found but is needed. Returns ``None`` if it's not needed. | [
"Returns",
"the",
"input",
"peer",
"of",
"the",
"bot",
"that",
"s",
"needed",
"for",
"the",
"reply",
"markup",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L846-L869 | train | Returns the input peer of the bot that s needed for the reply markup. | 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... |
LonamiWebs/Telethon | telethon/tl/custom/message.py | Message._document_by_attribute | def _document_by_attribute(self, kind, condition=None):
"""
Helper method to return the document only if it has an attribute
that's an instance of the given kind, and passes the condition.
"""
doc = self.document
if doc:
for attr in doc.attributes:
... | python | def _document_by_attribute(self, kind, condition=None):
"""
Helper method to return the document only if it has an attribute
that's an instance of the given kind, and passes the condition.
"""
doc = self.document
if doc:
for attr in doc.attributes:
... | [
"def",
"_document_by_attribute",
"(",
"self",
",",
"kind",
",",
"condition",
"=",
"None",
")",
":",
"doc",
"=",
"self",
".",
"document",
"if",
"doc",
":",
"for",
"attr",
"in",
"doc",
".",
"attributes",
":",
"if",
"isinstance",
"(",
"attr",
",",
"kind",... | Helper method to return the document only if it has an attribute
that's an instance of the given kind, and passes the condition. | [
"Helper",
"method",
"to",
"return",
"the",
"document",
"only",
"if",
"it",
"has",
"an",
"attribute",
"that",
"s",
"an",
"instance",
"of",
"the",
"given",
"kind",
"and",
"passes",
"the",
"condition",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/tl/custom/message.py#L871-L882 | train | Helper method to return the document only if it has an attribute that is an instance of the given kind. | 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... |
LonamiWebs/Telethon | readthedocs/custom_roles.py | make_link_node | def make_link_node(rawtext, app, name, options):
"""
Create a link to the TL reference.
:param rawtext: Text being replaced with link node.
:param app: Sphinx application context
:param name: Name of the object to link to
:param options: Options dictionary passed to role func.
"""
try:
... | python | def make_link_node(rawtext, app, name, options):
"""
Create a link to the TL reference.
:param rawtext: Text being replaced with link node.
:param app: Sphinx application context
:param name: Name of the object to link to
:param options: Options dictionary passed to role func.
"""
try:
... | [
"def",
"make_link_node",
"(",
"rawtext",
",",
"app",
",",
"name",
",",
"options",
")",
":",
"try",
":",
"base",
"=",
"app",
".",
"config",
".",
"tl_ref_url",
"if",
"not",
"base",
":",
"raise",
"AttributeError",
"except",
"AttributeError",
"as",
"e",
":",... | Create a link to the TL reference.
:param rawtext: Text being replaced with link node.
:param app: Sphinx application context
:param name: Name of the object to link to
:param options: Options dictionary passed to role func. | [
"Create",
"a",
"link",
"to",
"the",
"TL",
"reference",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/readthedocs/custom_roles.py#L5-L28 | train | Create a link node to the TL reference. | 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... |
LonamiWebs/Telethon | readthedocs/custom_roles.py | tl_role | def tl_role(name, rawtext, text, lineno, inliner, options=None, content=None):
"""
Link to the TL reference.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be empty.
:param name: The role name used in the document.
:... | python | def tl_role(name, rawtext, text, lineno, inliner, options=None, content=None):
"""
Link to the TL reference.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be empty.
:param name: The role name used in the document.
:... | [
"def",
"tl_role",
"(",
"name",
",",
"rawtext",
",",
"text",
",",
"lineno",
",",
"inliner",
",",
"options",
"=",
"None",
",",
"content",
"=",
"None",
")",
":",
"if",
"options",
"is",
"None",
":",
"options",
"=",
"{",
"}",
"if",
"content",
"is",
"Non... | Link to the TL reference.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be empty.
:param name: The role name used in the document.
:param rawtext: The entire markup snippet, with role.
:param text: The text marked with ... | [
"Link",
"to",
"the",
"TL",
"reference",
"."
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/readthedocs/custom_roles.py#L31-L57 | train | Link to the TL reference. | 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... |
LonamiWebs/Telethon | telethon/client/bots.py | BotMethods.inline_query | async def inline_query(self, bot, query, *, offset=None, geo_point=None):
"""
Makes the given inline query to the specified bot
i.e. ``@vote My New Poll`` would be as follows:
>>> client = ...
>>> client.inline_query('vote', 'My New Poll')
Args:
bot (`entity... | python | async def inline_query(self, bot, query, *, offset=None, geo_point=None):
"""
Makes the given inline query to the specified bot
i.e. ``@vote My New Poll`` would be as follows:
>>> client = ...
>>> client.inline_query('vote', 'My New Poll')
Args:
bot (`entity... | [
"async",
"def",
"inline_query",
"(",
"self",
",",
"bot",
",",
"query",
",",
"*",
",",
"offset",
"=",
"None",
",",
"geo_point",
"=",
"None",
")",
":",
"bot",
"=",
"await",
"self",
".",
"get_input_entity",
"(",
"bot",
")",
"result",
"=",
"await",
"self... | Makes the given inline query to the specified bot
i.e. ``@vote My New Poll`` would be as follows:
>>> client = ...
>>> client.inline_query('vote', 'My New Poll')
Args:
bot (`entity`):
The bot entity to which the inline query should be made.
quer... | [
"Makes",
"the",
"given",
"inline",
"query",
"to",
"the",
"specified",
"bot",
"i",
".",
"e",
".",
"@vote",
"My",
"New",
"Poll",
"would",
"be",
"as",
"follows",
":"
] | 1ead9757d366b58c1e0567cddb0196e20f1a445f | https://github.com/LonamiWebs/Telethon/blob/1ead9757d366b58c1e0567cddb0196e20f1a445f/telethon/client/bots.py#L6-L41 | train | Makes a given inline query to the specified 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.