partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | Session.endpoint_from_production_variants | Create an SageMaker ``Endpoint`` from a list of production variants.
Args:
name (str): The name of the ``Endpoint`` to create.
production_variants (list[dict[str, str]]): The list of production variants to deploy.
tags (list[dict[str, str]]): A list of key-value pairs for ta... | src/sagemaker/session.py | def endpoint_from_production_variants(self, name, production_variants, tags=None, kms_key=None, wait=True):
"""Create an SageMaker ``Endpoint`` from a list of production variants.
Args:
name (str): The name of the ``Endpoint`` to create.
production_variants (list[dict[str, str]]... | def endpoint_from_production_variants(self, name, production_variants, tags=None, kms_key=None, wait=True):
"""Create an SageMaker ``Endpoint`` from a list of production variants.
Args:
name (str): The name of the ``Endpoint`` to create.
production_variants (list[dict[str, str]]... | [
"Create",
"an",
"SageMaker",
"Endpoint",
"from",
"a",
"list",
"of",
"production",
"variants",
"."
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/session.py#L1044-L1068 | [
"def",
"endpoint_from_production_variants",
"(",
"self",
",",
"name",
",",
"production_variants",
",",
"tags",
"=",
"None",
",",
"kms_key",
"=",
"None",
",",
"wait",
"=",
"True",
")",
":",
"if",
"not",
"_deployment_entity_exists",
"(",
"lambda",
":",
"self",
... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | Session.expand_role | Expand an IAM role name into an ARN.
If the role is already in the form of an ARN, then the role is simply returned. Otherwise we retrieve the full
ARN and return it.
Args:
role (str): An AWS IAM role (either name or full ARN).
Returns:
str: The corresponding A... | src/sagemaker/session.py | def expand_role(self, role):
"""Expand an IAM role name into an ARN.
If the role is already in the form of an ARN, then the role is simply returned. Otherwise we retrieve the full
ARN and return it.
Args:
role (str): An AWS IAM role (either name or full ARN).
Retur... | def expand_role(self, role):
"""Expand an IAM role name into an ARN.
If the role is already in the form of an ARN, then the role is simply returned. Otherwise we retrieve the full
ARN and return it.
Args:
role (str): An AWS IAM role (either name or full ARN).
Retur... | [
"Expand",
"an",
"IAM",
"role",
"name",
"into",
"an",
"ARN",
"."
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/session.py#L1070-L1085 | [
"def",
"expand_role",
"(",
"self",
",",
"role",
")",
":",
"if",
"'/'",
"in",
"role",
":",
"return",
"role",
"else",
":",
"return",
"self",
".",
"boto_session",
".",
"resource",
"(",
"'iam'",
")",
".",
"Role",
"(",
"role",
")",
".",
"arn"
] | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | Session.get_caller_identity_arn | Returns the ARN user or role whose credentials are used to call the API.
Returns:
(str): The ARN user or role | src/sagemaker/session.py | def get_caller_identity_arn(self):
"""Returns the ARN user or role whose credentials are used to call the API.
Returns:
(str): The ARN user or role
"""
assumed_role = self.boto_session.client('sts').get_caller_identity()['Arn']
if 'AmazonSageMaker-ExecutionRole' in a... | def get_caller_identity_arn(self):
"""Returns the ARN user or role whose credentials are used to call the API.
Returns:
(str): The ARN user or role
"""
assumed_role = self.boto_session.client('sts').get_caller_identity()['Arn']
if 'AmazonSageMaker-ExecutionRole' in a... | [
"Returns",
"the",
"ARN",
"user",
"or",
"role",
"whose",
"credentials",
"are",
"used",
"to",
"call",
"the",
"API",
".",
"Returns",
":",
"(",
"str",
")",
":",
"The",
"ARN",
"user",
"or",
"role"
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/session.py#L1087-L1108 | [
"def",
"get_caller_identity_arn",
"(",
"self",
")",
":",
"assumed_role",
"=",
"self",
".",
"boto_session",
".",
"client",
"(",
"'sts'",
")",
".",
"get_caller_identity",
"(",
")",
"[",
"'Arn'",
"]",
"if",
"'AmazonSageMaker-ExecutionRole'",
"in",
"assumed_role",
"... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | Session.logs_for_job | Display the logs for a given training job, optionally tailing them until the
job is complete. If the output is a tty or a Jupyter cell, it will be color-coded
based on which instance the log entry is from.
Args:
job_name (str): Name of the training job to display the logs for.
... | src/sagemaker/session.py | def logs_for_job(self, job_name, wait=False, poll=10): # noqa: C901 - suppress complexity warning for this method
"""Display the logs for a given training job, optionally tailing them until the
job is complete. If the output is a tty or a Jupyter cell, it will be color-coded
based on which inst... | def logs_for_job(self, job_name, wait=False, poll=10): # noqa: C901 - suppress complexity warning for this method
"""Display the logs for a given training job, optionally tailing them until the
job is complete. If the output is a tty or a Jupyter cell, it will be color-coded
based on which inst... | [
"Display",
"the",
"logs",
"for",
"a",
"given",
"training",
"job",
"optionally",
"tailing",
"them",
"until",
"the",
"job",
"is",
"complete",
".",
"If",
"the",
"output",
"is",
"a",
"tty",
"or",
"a",
"Jupyter",
"cell",
"it",
"will",
"be",
"color",
"-",
"c... | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/session.py#L1110-L1226 | [
"def",
"logs_for_job",
"(",
"self",
",",
"job_name",
",",
"wait",
"=",
"False",
",",
"poll",
"=",
"10",
")",
":",
"# noqa: C901 - suppress complexity warning for this method",
"description",
"=",
"self",
".",
"sagemaker_client",
".",
"describe_training_job",
"(",
"T... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | registry | Return docker registry for the given AWS region for the given framework.
This is only used for SparkML and Scikit-learn for now. | src/sagemaker/fw_registry.py | def registry(region_name, framework=None):
"""
Return docker registry for the given AWS region for the given framework.
This is only used for SparkML and Scikit-learn for now.
"""
try:
account_id = image_registry_map[region_name][framework]
return get_ecr_image_uri_prefix(account_id,... | def registry(region_name, framework=None):
"""
Return docker registry for the given AWS region for the given framework.
This is only used for SparkML and Scikit-learn for now.
"""
try:
account_id = image_registry_map[region_name][framework]
return get_ecr_image_uri_prefix(account_id,... | [
"Return",
"docker",
"registry",
"for",
"the",
"given",
"AWS",
"region",
"for",
"the",
"given",
"framework",
".",
"This",
"is",
"only",
"used",
"for",
"SparkML",
"and",
"Scikit",
"-",
"learn",
"for",
"now",
"."
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/fw_registry.py#L82-L92 | [
"def",
"registry",
"(",
"region_name",
",",
"framework",
"=",
"None",
")",
":",
"try",
":",
"account_id",
"=",
"image_registry_map",
"[",
"region_name",
"]",
"[",
"framework",
"]",
"return",
"get_ecr_image_uri_prefix",
"(",
"account_id",
",",
"region_name",
")",... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | KNN.create_model | Return a :class:`~sagemaker.amazon.KNNModel` referencing the latest
s3 model data produced by this Estimator.
Args:
vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on the model.
Default: use subnets and security groups from this Estimator.
... | src/sagemaker/amazon/knn.py | def create_model(self, vpc_config_override=VPC_CONFIG_DEFAULT):
"""Return a :class:`~sagemaker.amazon.KNNModel` referencing the latest
s3 model data produced by this Estimator.
Args:
vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on the model.
... | def create_model(self, vpc_config_override=VPC_CONFIG_DEFAULT):
"""Return a :class:`~sagemaker.amazon.KNNModel` referencing the latest
s3 model data produced by this Estimator.
Args:
vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on the model.
... | [
"Return",
"a",
":",
"class",
":",
"~sagemaker",
".",
"amazon",
".",
"KNNModel",
"referencing",
"the",
"latest",
"s3",
"model",
"data",
"produced",
"by",
"this",
"Estimator",
"."
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/amazon/knn.py#L102-L113 | [
"def",
"create_model",
"(",
"self",
",",
"vpc_config_override",
"=",
"VPC_CONFIG_DEFAULT",
")",
":",
"return",
"KNNModel",
"(",
"self",
".",
"model_data",
",",
"self",
".",
"role",
",",
"sagemaker_session",
"=",
"self",
".",
"sagemaker_session",
",",
"vpc_config... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | copy_directory_structure | Create all the intermediate directories required for relative_path to exist within destination_directory.
This assumes that relative_path is a directory located within root_dir.
Examples:
destination_directory: /tmp/destination
relative_path: test/unit/
will create: /tmp/destination/t... | src/sagemaker/local/utils.py | def copy_directory_structure(destination_directory, relative_path):
"""Create all the intermediate directories required for relative_path to exist within destination_directory.
This assumes that relative_path is a directory located within root_dir.
Examples:
destination_directory: /tmp/destination
... | def copy_directory_structure(destination_directory, relative_path):
"""Create all the intermediate directories required for relative_path to exist within destination_directory.
This assumes that relative_path is a directory located within root_dir.
Examples:
destination_directory: /tmp/destination
... | [
"Create",
"all",
"the",
"intermediate",
"directories",
"required",
"for",
"relative_path",
"to",
"exist",
"within",
"destination_directory",
".",
"This",
"assumes",
"that",
"relative_path",
"is",
"a",
"directory",
"located",
"within",
"root_dir",
"."
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/utils.py#L22-L40 | [
"def",
"copy_directory_structure",
"(",
"destination_directory",
",",
"relative_path",
")",
":",
"full_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"destination_directory",
",",
"relative_path",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"full_path",
... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | move_to_destination | move source to destination. Can handle uploading to S3
Args:
source (str): root directory to move
destination (str): file:// or s3:// URI that source will be moved to.
job_name (str): SageMaker job name.
sagemaker_session (sagemaker.Session): a sagemaker_session to interact with S3 ... | src/sagemaker/local/utils.py | def move_to_destination(source, destination, job_name, sagemaker_session):
"""move source to destination. Can handle uploading to S3
Args:
source (str): root directory to move
destination (str): file:// or s3:// URI that source will be moved to.
job_name (str): SageMaker job name.
... | def move_to_destination(source, destination, job_name, sagemaker_session):
"""move source to destination. Can handle uploading to S3
Args:
source (str): root directory to move
destination (str): file:// or s3:// URI that source will be moved to.
job_name (str): SageMaker job name.
... | [
"move",
"source",
"to",
"destination",
".",
"Can",
"handle",
"uploading",
"to",
"S3"
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/utils.py#L43-L68 | [
"def",
"move_to_destination",
"(",
"source",
",",
"destination",
",",
"job_name",
",",
"sagemaker_session",
")",
":",
"parsed_uri",
"=",
"urlparse",
"(",
"destination",
")",
"if",
"parsed_uri",
".",
"scheme",
"==",
"'file'",
":",
"recursive_copy",
"(",
"source",... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | recursive_copy | A wrapper around distutils.dir_util.copy_tree but won't throw any exception when the source
directory does not exist.
Args:
source (str): source path
destination (str): destination path | src/sagemaker/local/utils.py | def recursive_copy(source, destination):
"""A wrapper around distutils.dir_util.copy_tree but won't throw any exception when the source
directory does not exist.
Args:
source (str): source path
destination (str): destination path
"""
if os.path.isdir(source):
copy_tree(sourc... | def recursive_copy(source, destination):
"""A wrapper around distutils.dir_util.copy_tree but won't throw any exception when the source
directory does not exist.
Args:
source (str): source path
destination (str): destination path
"""
if os.path.isdir(source):
copy_tree(sourc... | [
"A",
"wrapper",
"around",
"distutils",
".",
"dir_util",
".",
"copy_tree",
"but",
"won",
"t",
"throw",
"any",
"exception",
"when",
"the",
"source",
"directory",
"does",
"not",
"exist",
"."
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/local/utils.py#L71-L80 | [
"def",
"recursive_copy",
"(",
"source",
",",
"destination",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"source",
")",
":",
"copy_tree",
"(",
"source",
",",
"destination",
")"
] | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | MXNet._prepare_init_params_from_job_description | Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_name (str): Name of the channel where pre-trained model data will be downloaded.
Returns:
... | src/sagemaker/mxnet/estimator.py | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_n... | def _prepare_init_params_from_job_description(cls, job_details, model_channel_name=None):
"""Convert the job description to init params that can be handled by the class constructor
Args:
job_details: the returned job details from a describe_training_job API call.
model_channel_n... | [
"Convert",
"the",
"job",
"description",
"to",
"init",
"params",
"that",
"can",
"be",
"handled",
"by",
"the",
"class",
"constructor"
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/mxnet/estimator.py#L123-L157 | [
"def",
"_prepare_init_params_from_job_description",
"(",
"cls",
",",
"job_details",
",",
"model_channel_name",
"=",
"None",
")",
":",
"init_params",
"=",
"super",
"(",
"MXNet",
",",
"cls",
")",
".",
"_prepare_init_params_from_job_description",
"(",
"job_details",
",",... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | Transformer.transform | Start a new transform job.
Args:
data (str): Input data location in S3.
data_type (str): What the S3 location defines (default: 'S3Prefix'). Valid values:
* 'S3Prefix' - the S3 URI defines a key name prefix. All objects with this prefix will be used as
... | src/sagemaker/transformer.py | def transform(self, data, data_type='S3Prefix', content_type=None, compression_type=None, split_type=None,
job_name=None):
"""Start a new transform job.
Args:
data (str): Input data location in S3.
data_type (str): What the S3 location defines (default: 'S3Pref... | def transform(self, data, data_type='S3Prefix', content_type=None, compression_type=None, split_type=None,
job_name=None):
"""Start a new transform job.
Args:
data (str): Input data location in S3.
data_type (str): What the S3 location defines (default: 'S3Pref... | [
"Start",
"a",
"new",
"transform",
"job",
"."
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/transformer.py#L81-L115 | [
"def",
"transform",
"(",
"self",
",",
"data",
",",
"data_type",
"=",
"'S3Prefix'",
",",
"content_type",
"=",
"None",
",",
"compression_type",
"=",
"None",
",",
"split_type",
"=",
"None",
",",
"job_name",
"=",
"None",
")",
":",
"local_mode",
"=",
"self",
... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | Transformer.attach | Attach an existing transform job to a new Transformer instance
Args:
transform_job_name (str): Name for the transform job to be attached.
sagemaker_session (sagemaker.session.Session): Session object which manages interactions with
Amazon SageMaker APIs and any other AWS... | src/sagemaker/transformer.py | def attach(cls, transform_job_name, sagemaker_session=None):
"""Attach an existing transform job to a new Transformer instance
Args:
transform_job_name (str): Name for the transform job to be attached.
sagemaker_session (sagemaker.session.Session): Session object which manages i... | def attach(cls, transform_job_name, sagemaker_session=None):
"""Attach an existing transform job to a new Transformer instance
Args:
transform_job_name (str): Name for the transform job to be attached.
sagemaker_session (sagemaker.session.Session): Session object which manages i... | [
"Attach",
"an",
"existing",
"transform",
"job",
"to",
"a",
"new",
"Transformer",
"instance"
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/transformer.py#L142-L163 | [
"def",
"attach",
"(",
"cls",
",",
"transform_job_name",
",",
"sagemaker_session",
"=",
"None",
")",
":",
"sagemaker_session",
"=",
"sagemaker_session",
"or",
"Session",
"(",
")",
"job_details",
"=",
"sagemaker_session",
".",
"sagemaker_client",
".",
"describe_transf... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | Transformer._prepare_init_params_from_job_description | Convert the transform job description to init params that can be handled by the class constructor
Args:
job_details (dict): the returned job details from a describe_transform_job API call.
Returns:
dict: The transformed init_params | src/sagemaker/transformer.py | def _prepare_init_params_from_job_description(cls, job_details):
"""Convert the transform job description to init params that can be handled by the class constructor
Args:
job_details (dict): the returned job details from a describe_transform_job API call.
Returns:
dict... | def _prepare_init_params_from_job_description(cls, job_details):
"""Convert the transform job description to init params that can be handled by the class constructor
Args:
job_details (dict): the returned job details from a describe_transform_job API call.
Returns:
dict... | [
"Convert",
"the",
"transform",
"job",
"description",
"to",
"init",
"params",
"that",
"can",
"be",
"handled",
"by",
"the",
"class",
"constructor"
] | aws/sagemaker-python-sdk | python | https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/transformer.py#L166-L190 | [
"def",
"_prepare_init_params_from_job_description",
"(",
"cls",
",",
"job_details",
")",
":",
"init_params",
"=",
"dict",
"(",
")",
"init_params",
"[",
"'model_name'",
"]",
"=",
"job_details",
"[",
"'ModelName'",
"]",
"init_params",
"[",
"'instance_count'",
"]",
"... | a9e724c7d3f5572b68c3903548c792a59d99799a |
train | piece_size | Returns the piece size (vocabulary size).
Args:
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argument that is passed to the op function.
Returns:
A scalar repre... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def piece_size(model_file=None, model_proto=None, name=None):
"""Returns the piece size (vocabulary size).
Args:
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argume... | def piece_size(model_file=None, model_proto=None, name=None):
"""Returns the piece size (vocabulary size).
Args:
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argume... | [
"Returns",
"the",
"piece",
"size",
"(",
"vocabulary",
"size",
")",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L46-L59 | [
"def",
"piece_size",
"(",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"_gen_sentencepiece_processor_op",
".",
"sentencepiece_get_piece_size",
"(",
"model_file",
"=",
"model_file",
",",
"model_proto",
"=... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | piece_to_id | Converts piece into vocabulary id.
Args:
input: An arbitrary tensor of string.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argument that is passed to the op func... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def piece_to_id(input, model_file=None, model_proto=None, name=None):
"""Converts piece into vocabulary id.
Args:
input: An arbitrary tensor of string.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_pr... | def piece_to_id(input, model_file=None, model_proto=None, name=None):
"""Converts piece into vocabulary id.
Args:
input: An arbitrary tensor of string.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_pr... | [
"Converts",
"piece",
"into",
"vocabulary",
"id",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L62-L76 | [
"def",
"piece_to_id",
"(",
"input",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"_gen_sentencepiece_processor_op",
".",
"sentencepiece_piece_to_id",
"(",
"input",
",",
"model_file",
"=",
"model_f... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | id_to_piece | Converts vocabulary id into piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argument that is passed to the op funct... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def id_to_piece(input, model_file=None, model_proto=None, name=None):
"""Converts vocabulary id into piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_pro... | def id_to_piece(input, model_file=None, model_proto=None, name=None):
"""Converts vocabulary id into piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_pro... | [
"Converts",
"vocabulary",
"id",
"into",
"piece",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L79-L93 | [
"def",
"id_to_piece",
"(",
"input",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"_gen_sentencepiece_processor_op",
".",
"sentencepiece_id_to_piece",
"(",
"input",
",",
"model_file",
"=",
"model_f... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | is_unknown | Returns true if input id is unknown piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argument that is passed to the ... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def is_unknown(input, model_file=None, model_proto=None, name=None):
"""Returns true if input id is unknown piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `mo... | def is_unknown(input, model_file=None, model_proto=None, name=None):
"""Returns true if input id is unknown piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `mo... | [
"Returns",
"true",
"if",
"input",
"id",
"is",
"unknown",
"piece",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L96-L111 | [
"def",
"is_unknown",
"(",
"input",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"_gen_sentencepiece_processor_op",
".",
"sentencepiece_get_piece_type",
"(",
"input",
",",
"model_file",
"=",
"model... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | is_control | Returns true if input id is control piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argument that is passed to the ... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def is_control(input, model_file=None, model_proto=None, name=None):
"""Returns true if input id is control piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `mo... | def is_control(input, model_file=None, model_proto=None, name=None):
"""Returns true if input id is control piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `mo... | [
"Returns",
"true",
"if",
"input",
"id",
"is",
"control",
"piece",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L114-L129 | [
"def",
"is_control",
"(",
"input",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"_gen_sentencepiece_processor_op",
".",
"sentencepiece_get_piece_type",
"(",
"input",
",",
"model_file",
"=",
"model... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | is_unused | Returns true if input id is unused piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `model_proto` must be set.
name: The name argument that is passed to the o... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def is_unused(input, model_file=None, model_proto=None, name=None):
"""Returns true if input id is unused piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `mode... | def is_unused(input, model_file=None, model_proto=None, name=None):
"""Returns true if input id is unused piece.
Args:
input: An arbitrary tensor of int32.
model_file: The sentencepiece model file path.
model_proto: The sentencepiece model serialized proto.
Either `model_file` or `mode... | [
"Returns",
"true",
"if",
"input",
"id",
"is",
"unused",
"piece",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L132-L147 | [
"def",
"is_unused",
"(",
"input",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"_gen_sentencepiece_processor_op",
".",
"sentencepiece_get_piece_type",
"(",
"input",
",",
"model_file",
"=",
"model_... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | encode_dense | Encodes sentences into pieces in dense tensor format.
Args:
input_sentences: A 1D string tensor of arbitrary size holding the raw
text of input sentences.
nbest_size: A scalar or 1D tensor for sampling.
nbest_size = {0,1}: No sampling is performed.
nbest_s... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def encode_dense(input_sentences, nbest_size=0, alpha=1.0,
model_file=None, model_proto=None,
reverse=False, add_bos=False, add_eos=False,
out_type=tf.int32, name=None):
"""Encodes sentences into pieces in dense tensor format.
Args:
input_sentences: A 1D strin... | def encode_dense(input_sentences, nbest_size=0, alpha=1.0,
model_file=None, model_proto=None,
reverse=False, add_bos=False, add_eos=False,
out_type=tf.int32, name=None):
"""Encodes sentences into pieces in dense tensor format.
Args:
input_sentences: A 1D strin... | [
"Encodes",
"sentences",
"into",
"pieces",
"in",
"dense",
"tensor",
"format",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L150-L186 | [
"def",
"encode_dense",
"(",
"input_sentences",
",",
"nbest_size",
"=",
"0",
",",
"alpha",
"=",
"1.0",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"reverse",
"=",
"False",
",",
"add_bos",
"=",
"False",
",",
"add_eos",
"=",
"False... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | encode_sparse | Encodes sentences into pieces in sparse tensor format.
Args:
input_sentences: A 1D string tensor of arbitrary size holding the raw
text of input sentences.
nbest_size: A scalar or 1D tensor for sampling.
nbest_size = {0,1}: No sampling is performed.
nbest_... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def encode_sparse(input_sentences, nbest_size=0, alpha=1.0,
model_file=None, model_proto=None,
reverse=False, add_bos=False, add_eos=False,
out_type=tf.int32, name=None):
"""Encodes sentences into pieces in sparse tensor format.
Args:
input_sentences: A 1D ... | def encode_sparse(input_sentences, nbest_size=0, alpha=1.0,
model_file=None, model_proto=None,
reverse=False, add_bos=False, add_eos=False,
out_type=tf.int32, name=None):
"""Encodes sentences into pieces in sparse tensor format.
Args:
input_sentences: A 1D ... | [
"Encodes",
"sentences",
"into",
"pieces",
"in",
"sparse",
"tensor",
"format",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L189-L227 | [
"def",
"encode_sparse",
"(",
"input_sentences",
",",
"nbest_size",
"=",
"0",
",",
"alpha",
"=",
"1.0",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"reverse",
"=",
"False",
",",
"add_bos",
"=",
"False",
",",
"add_eos",
"=",
"Fals... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | decode | Decode pieces into postprocessed text.
Args:
pieces: A 2D int32 or string tensor [batch_size x max_length] of
encoded sequences.
sequence_length: A 1D int32 tensor [batch_size] representing the
length of pieces.
model_file: The sentencepiece model file path.
model_proto... | tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py | def decode(pieces, sequence_length, model_file=None, model_proto=None,
reverse=False, name=None):
"""Decode pieces into postprocessed text.
Args:
pieces: A 2D int32 or string tensor [batch_size x max_length] of
encoded sequences.
sequence_length: A 1D int32 tensor [batch_size] repres... | def decode(pieces, sequence_length, model_file=None, model_proto=None,
reverse=False, name=None):
"""Decode pieces into postprocessed text.
Args:
pieces: A 2D int32 or string tensor [batch_size x max_length] of
encoded sequences.
sequence_length: A 1D int32 tensor [batch_size] repres... | [
"Decode",
"pieces",
"into",
"postprocessed",
"text",
"."
] | google/sentencepiece | python | https://github.com/google/sentencepiece/blob/ffa2c8218f7afbb06d0c1bb87c82efb6867db41a/tensorflow/tf_sentencepiece/sentencepiece_processor_ops.py#L230-L251 | [
"def",
"decode",
"(",
"pieces",
",",
"sequence_length",
",",
"model_file",
"=",
"None",
",",
"model_proto",
"=",
"None",
",",
"reverse",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"return",
"_gen_sentencepiece_processor_op",
".",
"sentencepiece_decode",
... | ffa2c8218f7afbb06d0c1bb87c82efb6867db41a |
train | split_string | Splits one string into multiple strings, with a maximum amount of `chars_per_string` characters per string.
This is very useful for splitting one giant message into multiples.
:param text: The text to split
:param chars_per_string: The number of characters per line the text is split into.
:return: The ... | telebot/util.py | def split_string(text, chars_per_string):
"""
Splits one string into multiple strings, with a maximum amount of `chars_per_string` characters per string.
This is very useful for splitting one giant message into multiples.
:param text: The text to split
:param chars_per_string: The number of charact... | def split_string(text, chars_per_string):
"""
Splits one string into multiple strings, with a maximum amount of `chars_per_string` characters per string.
This is very useful for splitting one giant message into multiples.
:param text: The text to split
:param chars_per_string: The number of charact... | [
"Splits",
"one",
"string",
"into",
"multiple",
"strings",
"with",
"a",
"maximum",
"amount",
"of",
"chars_per_string",
"characters",
"per",
"string",
".",
"This",
"is",
"very",
"useful",
"for",
"splitting",
"one",
"giant",
"message",
"into",
"multiples",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/util.py#L186-L195 | [
"def",
"split_string",
"(",
"text",
",",
"chars_per_string",
")",
":",
"return",
"[",
"text",
"[",
"i",
":",
"i",
"+",
"chars_per_string",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"text",
")",
",",
"chars_per_string",
")",
"]"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | extract_arguments | Returns the argument after the command.
Examples:
extract_arguments("/get name"): 'name'
extract_arguments("/get"): ''
extract_arguments("/get@botName name"): 'name'
:param text: String to extract the arguments from a command
:return: the arguments if `text` is a command (according to ... | telebot/util.py | def extract_arguments(text):
"""
Returns the argument after the command.
Examples:
extract_arguments("/get name"): 'name'
extract_arguments("/get"): ''
extract_arguments("/get@botName name"): 'name'
:param text: String to extract the arguments from a command
:return: the argume... | def extract_arguments(text):
"""
Returns the argument after the command.
Examples:
extract_arguments("/get name"): 'name'
extract_arguments("/get"): ''
extract_arguments("/get@botName name"): 'name'
:param text: String to extract the arguments from a command
:return: the argume... | [
"Returns",
"the",
"argument",
"after",
"the",
"command",
".",
"Examples",
":",
"extract_arguments",
"(",
"/",
"get",
"name",
")",
":",
"name",
"extract_arguments",
"(",
"/",
"get",
")",
":",
"extract_arguments",
"(",
"/",
"get"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/util.py#L235-L249 | [
"def",
"extract_arguments",
"(",
"text",
")",
":",
"regexp",
"=",
"re",
".",
"compile",
"(",
"\"/\\w*(@\\w*)*\\s*([\\s\\S]*)\"",
",",
"re",
".",
"IGNORECASE",
")",
"result",
"=",
"regexp",
".",
"match",
"(",
"text",
")",
"return",
"result",
".",
"group",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | listener | When new messages arrive TeleBot will call this function. | examples/detailed_example/detailed_example.py | def listener(messages):
"""
When new messages arrive TeleBot will call this function.
"""
for m in messages:
if m.content_type == 'text':
# print the sent message to the console
print(str(m.chat.first_name) + " [" + str(m.chat.id) + "]: " + m.text) | def listener(messages):
"""
When new messages arrive TeleBot will call this function.
"""
for m in messages:
if m.content_type == 'text':
# print the sent message to the console
print(str(m.chat.first_name) + " [" + str(m.chat.id) + "]: " + m.text) | [
"When",
"new",
"messages",
"arrive",
"TeleBot",
"will",
"call",
"this",
"function",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/examples/detailed_example/detailed_example.py#L42-L49 | [
"def",
"listener",
"(",
"messages",
")",
":",
"for",
"m",
"in",
"messages",
":",
"if",
"m",
".",
"content_type",
"==",
"'text'",
":",
"# print the sent message to the console",
"print",
"(",
"str",
"(",
"m",
".",
"chat",
".",
"first_name",
")",
"+",
"\" [\... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | JsonDeserializable.check_json | Checks whether json_type is a dict or a string. If it is already a dict, it is returned as-is.
If it is not, it is converted to a dict by means of json.loads(json_type)
:param json_type:
:return: | telebot/types.py | def check_json(json_type):
"""
Checks whether json_type is a dict or a string. If it is already a dict, it is returned as-is.
If it is not, it is converted to a dict by means of json.loads(json_type)
:param json_type:
:return:
"""
try:
str_types = (str... | def check_json(json_type):
"""
Checks whether json_type is a dict or a string. If it is already a dict, it is returned as-is.
If it is not, it is converted to a dict by means of json.loads(json_type)
:param json_type:
:return:
"""
try:
str_types = (str... | [
"Checks",
"whether",
"json_type",
"is",
"a",
"dict",
"or",
"a",
"string",
".",
"If",
"it",
"is",
"already",
"a",
"dict",
"it",
"is",
"returned",
"as",
"-",
"is",
".",
"If",
"it",
"is",
"not",
"it",
"is",
"converted",
"to",
"a",
"dict",
"by",
"means... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L62-L79 | [
"def",
"check_json",
"(",
"json_type",
")",
":",
"try",
":",
"str_types",
"=",
"(",
"str",
",",
"unicode",
")",
"except",
"NameError",
":",
"str_types",
"=",
"(",
"str",
",",
")",
"if",
"type",
"(",
"json_type",
")",
"==",
"dict",
":",
"return",
"jso... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | Message.__html_text | Author: @sviat9440
Message: "*Test* parse _formatting_, [url](https://example.com), [text_mention](tg://user?id=123456) and mention @username"
Example:
message.html_text
>> "<b>Test</b> parse <i>formatting</i>, <a href=\"https://example.com\">url</a>, <a href=\"tg://user?id=1234... | telebot/types.py | def __html_text(self, text, entities):
"""
Author: @sviat9440
Message: "*Test* parse _formatting_, [url](https://example.com), [text_mention](tg://user?id=123456) and mention @username"
Example:
message.html_text
>> "<b>Test</b> parse <i>formatting</i>, <a href=\... | def __html_text(self, text, entities):
"""
Author: @sviat9440
Message: "*Test* parse _formatting_, [url](https://example.com), [text_mention](tg://user?id=123456) and mention @username"
Example:
message.html_text
>> "<b>Test</b> parse <i>formatting</i>, <a href=\... | [
"Author",
":",
"@sviat9440",
"Message",
":",
"*",
"Test",
"*",
"parse",
"_formatting_",
"[",
"url",
"]",
"(",
"https",
":",
"//",
"example",
".",
"com",
")",
"[",
"text_mention",
"]",
"(",
"tg",
":",
"//",
"user?id",
"=",
"123456",
")",
"and",
"menti... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L440-L495 | [
"def",
"__html_text",
"(",
"self",
",",
"text",
",",
"entities",
")",
":",
"if",
"not",
"entities",
":",
"return",
"text",
"_subs",
"=",
"{",
"\"bold\"",
":",
"\"<b>{text}</b>\"",
",",
"\"italic\"",
":",
"\"<i>{text}</i>\"",
",",
"\"pre\"",
":",
"\"<pre>{tex... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | ReplyKeyboardMarkup.add | This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", ... | telebot/types.py | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | [
"This",
"function",
"adds",
"strings",
"to",
"the",
"keyboard",
"while",
"not",
"exceeding",
"row_width",
".",
"E",
".",
"g",
".",
"ReplyKeyboardMarkup#add",
"(",
"A",
"B",
"C",
")",
"yields",
"the",
"json",
"result",
"{",
"keyboard",
":",
"[[",
"A",
"]"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L755-L778 | [
"def",
"add",
"(",
"self",
",",
"*",
"args",
")",
":",
"i",
"=",
"1",
"row",
"=",
"[",
"]",
"for",
"button",
"in",
"args",
":",
"if",
"util",
".",
"is_string",
"(",
"button",
")",
":",
"row",
".",
"append",
"(",
"{",
"'text'",
":",
"button",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | ReplyKeyboardMarkup.to_json | Converts this object to its json representation following the Telegram API guidelines described here:
https://core.telegram.org/bots/api#replykeyboardmarkup
:return: | telebot/types.py | def to_json(self):
"""
Converts this object to its json representation following the Telegram API guidelines described here:
https://core.telegram.org/bots/api#replykeyboardmarkup
:return:
"""
json_dict = {'keyboard': self.keyboard}
if self.one_time_keyboard:
... | def to_json(self):
"""
Converts this object to its json representation following the Telegram API guidelines described here:
https://core.telegram.org/bots/api#replykeyboardmarkup
:return:
"""
json_dict = {'keyboard': self.keyboard}
if self.one_time_keyboard:
... | [
"Converts",
"this",
"object",
"to",
"its",
"json",
"representation",
"following",
"the",
"Telegram",
"API",
"guidelines",
"described",
"here",
":",
"https",
":",
"//",
"core",
".",
"telegram",
".",
"org",
"/",
"bots",
"/",
"api#replykeyboardmarkup",
":",
"retu... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L797-L813 | [
"def",
"to_json",
"(",
"self",
")",
":",
"json_dict",
"=",
"{",
"'keyboard'",
":",
"self",
".",
"keyboard",
"}",
"if",
"self",
".",
"one_time_keyboard",
":",
"json_dict",
"[",
"'one_time_keyboard'",
"]",
"=",
"True",
"if",
"self",
".",
"resize_keyboard",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | InlineKeyboardMarkup.add | This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the result of this function: {keyboard: [["A", ... | telebot/types.py | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | def add(self, *args):
"""
This function adds strings to the keyboard, while not exceeding row_width.
E.g. ReplyKeyboardMarkup#add("A", "B", "C") yields the json result {keyboard: [["A"], ["B"], ["C"]]}
when row_width is set to 1.
When row_width is set to 2, the following is the r... | [
"This",
"function",
"adds",
"strings",
"to",
"the",
"keyboard",
"while",
"not",
"exceeding",
"row_width",
".",
"E",
".",
"g",
".",
"ReplyKeyboardMarkup#add",
"(",
"A",
"B",
"C",
")",
"yields",
"the",
"json",
"result",
"{",
"keyboard",
":",
"[[",
"A",
"]"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L840-L858 | [
"def",
"add",
"(",
"self",
",",
"*",
"args",
")",
":",
"i",
"=",
"1",
"row",
"=",
"[",
"]",
"for",
"button",
"in",
"args",
":",
"row",
".",
"append",
"(",
"button",
".",
"to_dic",
"(",
")",
")",
"if",
"i",
"%",
"self",
".",
"row_width",
"==",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | InlineKeyboardMarkup.row | Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param args: strings
:return: self, to allo... | telebot/types.py | def row(self, *args):
"""
Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param ar... | def row(self, *args):
"""
Adds a list of KeyboardButton to the keyboard. This function does not consider row_width.
ReplyKeyboardMarkup#row("A")#row("B", "C")#to_json() outputs '{keyboard: [["A"], ["B", "C"]]}'
See https://core.telegram.org/bots/api#inlinekeyboardmarkup
:param ar... | [
"Adds",
"a",
"list",
"of",
"KeyboardButton",
"to",
"the",
"keyboard",
".",
"This",
"function",
"does",
"not",
"consider",
"row_width",
".",
"ReplyKeyboardMarkup#row",
"(",
"A",
")",
"#row",
"(",
"B",
"C",
")",
"#to_json",
"()",
"outputs",
"{",
"keyboard",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/types.py#L860-L872 | [
"def",
"row",
"(",
"self",
",",
"*",
"args",
")",
":",
"btn_array",
"=",
"[",
"]",
"for",
"button",
"in",
"args",
":",
"btn_array",
".",
"append",
"(",
"button",
".",
"to_dic",
"(",
")",
")",
"self",
".",
"keyboard",
".",
"append",
"(",
"btn_array"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | _make_request | Makes a request to the Telegram API.
:param token: The bot's API token. (Created with @BotFather)
:param method_name: Name of the API method to be called. (E.g. 'getUpdates')
:param method: HTTP method to be used. Defaults to 'get'.
:param params: Optional parameters. Should be a dictionary with key-val... | telebot/apihelper.py | def _make_request(token, method_name, method='get', params=None, files=None, base_url=API_URL):
"""
Makes a request to the Telegram API.
:param token: The bot's API token. (Created with @BotFather)
:param method_name: Name of the API method to be called. (E.g. 'getUpdates')
:param method: HTTP metho... | def _make_request(token, method_name, method='get', params=None, files=None, base_url=API_URL):
"""
Makes a request to the Telegram API.
:param token: The bot's API token. (Created with @BotFather)
:param method_name: Name of the API method to be called. (E.g. 'getUpdates')
:param method: HTTP metho... | [
"Makes",
"a",
"request",
"to",
"the",
"Telegram",
"API",
".",
":",
"param",
"token",
":",
"The",
"bot",
"s",
"API",
"token",
".",
"(",
"Created",
"with"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L34-L56 | [
"def",
"_make_request",
"(",
"token",
",",
"method_name",
",",
"method",
"=",
"'get'",
",",
"params",
"=",
"None",
",",
"files",
"=",
"None",
",",
"base_url",
"=",
"API_URL",
")",
":",
"request_url",
"=",
"base_url",
".",
"format",
"(",
"token",
",",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | _check_result | Checks whether `result` is a valid API response.
A result is considered invalid if:
- The server returned an HTTP response code other than 200
- The content of the result is invalid JSON.
- The method call was unsuccessful (The JSON 'ok' field equals False)
:raises ApiException: if one ... | telebot/apihelper.py | def _check_result(method_name, result):
"""
Checks whether `result` is a valid API response.
A result is considered invalid if:
- The server returned an HTTP response code other than 200
- The content of the result is invalid JSON.
- The method call was unsuccessful (The JSON 'ok' fi... | def _check_result(method_name, result):
"""
Checks whether `result` is a valid API response.
A result is considered invalid if:
- The server returned an HTTP response code other than 200
- The content of the result is invalid JSON.
- The method call was unsuccessful (The JSON 'ok' fi... | [
"Checks",
"whether",
"result",
"is",
"a",
"valid",
"API",
"response",
".",
"A",
"result",
"is",
"considered",
"invalid",
"if",
":",
"-",
"The",
"server",
"returned",
"an",
"HTTP",
"response",
"code",
"other",
"than",
"200",
"-",
"The",
"content",
"of",
"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L59-L88 | [
"def",
"_check_result",
"(",
"method_name",
",",
"result",
")",
":",
"if",
"result",
".",
"status_code",
"!=",
"200",
":",
"msg",
"=",
"'The server returned HTTP {0} {1}. Response body:\\n[{2}]'",
".",
"format",
"(",
"result",
".",
"status_code",
",",
"result",
".... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | send_message | Use this method to send text messages. On success, the sent Message is returned.
:param token:
:param chat_id:
:param text:
:param disable_web_page_preview:
:param reply_to_message_id:
:param reply_markup:
:param parse_mode:
:param disable_notification:
:return: | telebot/apihelper.py | def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages. On success, the sent Message is returned.
:param token:
:param chat_id:
:param t... | def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages. On success, the sent Message is returned.
:param token:
:param chat_id:
:param t... | [
"Use",
"this",
"method",
"to",
"send",
"text",
"messages",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
".",
":",
"param",
"token",
":",
":",
"param",
"chat_id",
":",
":",
"param",
"text",
":",
":",
"param",
"disable_web_page_preview",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L115-L141 | [
"def",
"send_message",
"(",
"token",
",",
"chat_id",
",",
"text",
",",
"disable_web_page_preview",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | set_game_score | Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat.
:param token: Bot's token (you don't need to fill this)
... | telebot/apihelper.py | def set_game_score(token, user_id, score, force=None, disable_edit_message=None, chat_id=None, message_id=None,
inline_message_id=None):
"""
Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise ... | def set_game_score(token, user_id, score, force=None, disable_edit_message=None, chat_id=None, message_id=None,
inline_message_id=None):
"""
Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise ... | [
"Use",
"this",
"method",
"to",
"set",
"the",
"score",
"of",
"the",
"specified",
"user",
"in",
"a",
"game",
".",
"On",
"success",
"if",
"the",
"message",
"was",
"sent",
"by",
"the",
"bot",
"returns",
"the",
"edited",
"Message",
"otherwise",
"returns",
"Tr... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L692-L718 | [
"def",
"set_game_score",
"(",
"token",
",",
"user_id",
",",
"score",
",",
"force",
"=",
"None",
",",
"disable_edit_message",
"=",
"None",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
")",
":",
"method_... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | get_game_high_scores | Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will currently return scores for the target user, plus two of his closest neighbors on each side. Will also return... | telebot/apihelper.py | def get_game_high_scores(token, user_id, chat_id=None, message_id=None, inline_message_id=None):
"""
Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will ... | def get_game_high_scores(token, user_id, chat_id=None, message_id=None, inline_message_id=None):
"""
Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will ... | [
"Use",
"this",
"method",
"to",
"get",
"data",
"for",
"high",
"score",
"tables",
".",
"Will",
"return",
"the",
"score",
"of",
"the",
"specified",
"user",
"and",
"several",
"of",
"his",
"neighbors",
"in",
"a",
"game",
".",
"On",
"success",
"returns",
"an",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L722-L741 | [
"def",
"get_game_high_scores",
"(",
"token",
",",
"user_id",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
")",
":",
"method_url",
"=",
"r'getGameHighScores'",
"payload",
"=",
"{",
"'user_id'",
":",
"user_i... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | send_invoice | Use this method to send invoices. On success, the sent Message is returned.
:param token: Bot's token (you don't need to fill this)
:param chat_id: Unique identifier for the target private chat
:param title: Product name
:param description: Product description
:param invoice_payload: Bot-defined inv... | telebot/apihelper.py | def send_invoice(token, chat_id, title, description, invoice_payload, provider_token, currency, prices,
start_parameter, photo_url=None, photo_size=None, photo_width=None, photo_height=None,
need_name=None, need_phone_number=None, need_email=None, need_shipping_address=None, is_flexibl... | def send_invoice(token, chat_id, title, description, invoice_payload, provider_token, currency, prices,
start_parameter, photo_url=None, photo_size=None, photo_width=None, photo_height=None,
need_name=None, need_phone_number=None, need_email=None, need_shipping_address=None, is_flexibl... | [
"Use",
"this",
"method",
"to",
"send",
"invoices",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
".",
":",
"param",
"token",
":",
"Bot",
"s",
"token",
"(",
"you",
"don",
"t",
"need",
"to",
"fill",
"this",
")",
":",
"param",
"chat_... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L746-L806 | [
"def",
"send_invoice",
"(",
"token",
",",
"chat_id",
",",
"title",
",",
"description",
",",
"invoice_payload",
",",
"provider_token",
",",
"currency",
",",
"prices",
",",
"start_parameter",
",",
"photo_url",
"=",
"None",
",",
"photo_size",
"=",
"None",
",",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | answer_shipping_query | If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
:param token: Bot's token (you don't need to fill this)
:param shi... | telebot/apihelper.py | def answer_shipping_query(token, shipping_query_id, ok, shipping_options=None, error_message=None):
"""
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping q... | def answer_shipping_query(token, shipping_query_id, ok, shipping_options=None, error_message=None):
"""
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping q... | [
"If",
"you",
"sent",
"an",
"invoice",
"requesting",
"a",
"shipping",
"address",
"and",
"the",
"parameter",
"is_flexible",
"was",
"specified",
"the",
"Bot",
"API",
"will",
"send",
"an",
"Update",
"with",
"a",
"shipping_query",
"field",
"to",
"the",
"bot",
"."... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L809-L825 | [
"def",
"answer_shipping_query",
"(",
"token",
",",
"shipping_query_id",
",",
"ok",
",",
"shipping_options",
"=",
"None",
",",
"error_message",
"=",
"None",
")",
":",
"method_url",
"=",
"'answerShippingQuery'",
"payload",
"=",
"{",
"'shipping_query_id'",
":",
"ship... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | answer_pre_checkout_query | Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the... | telebot/apihelper.py | def answer_pre_checkout_query(token, pre_checkout_query_id, ok, error_message=None):
"""
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. O... | def answer_pre_checkout_query(token, pre_checkout_query_id, ok, error_message=None):
"""
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. O... | [
"Once",
"the",
"user",
"has",
"confirmed",
"their",
"payment",
"and",
"shipping",
"details",
"the",
"Bot",
"API",
"sends",
"the",
"final",
"confirmation",
"in",
"the",
"form",
"of",
"an",
"Update",
"with",
"the",
"field",
"pre_checkout_query",
".",
"Use",
"t... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L828-L841 | [
"def",
"answer_pre_checkout_query",
"(",
"token",
",",
"pre_checkout_query_id",
",",
"ok",
",",
"error_message",
"=",
"None",
")",
":",
"method_url",
"=",
"'answerPreCheckoutQuery'",
"payload",
"=",
"{",
"'pre_checkout_query_id'",
":",
"pre_checkout_query_id",
",",
"'... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | answer_callback_query | Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you mus... | telebot/apihelper.py | def answer_callback_query(token, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, Tru... | def answer_callback_query(token, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, Tru... | [
"Use",
"this",
"method",
"to",
"send",
"answers",
"to",
"callback",
"queries",
"sent",
"from",
"inline",
"keyboards",
".",
"The",
"answer",
"will",
"be",
"displayed",
"to",
"the",
"user",
"as",
"a",
"notification",
"at",
"the",
"top",
"of",
"the",
"chat",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/apihelper.py#L846-L869 | [
"def",
"answer_callback_query",
"(",
"token",
",",
"callback_query_id",
",",
"text",
"=",
"None",
",",
"show_alert",
"=",
"None",
",",
"url",
"=",
"None",
",",
"cache_time",
"=",
"None",
")",
":",
"method_url",
"=",
"'answerCallbackQuery'",
"payload",
"=",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.enable_save_next_step_handlers | Enable saving next step handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file | telebot/__init__.py | def enable_save_next_step_handlers(self, delay=120, filename="./.handler-saves/step.save"):
"""
Enable saving next step handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.next_st... | def enable_save_next_step_handlers(self, delay=120, filename="./.handler-saves/step.save"):
"""
Enable saving next step handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.next_st... | [
"Enable",
"saving",
"next",
"step",
"handlers",
"(",
"by",
"default",
"saving",
"disable",
")"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L173-L180 | [
"def",
"enable_save_next_step_handlers",
"(",
"self",
",",
"delay",
"=",
"120",
",",
"filename",
"=",
"\"./.handler-saves/step.save\"",
")",
":",
"self",
".",
"next_step_saver",
"=",
"Saver",
"(",
"self",
".",
"next_step_handlers",
",",
"filename",
",",
"delay",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.enable_save_reply_handlers | Enable saving reply handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file | telebot/__init__.py | def enable_save_reply_handlers(self, delay=120, filename="./.handler-saves/reply.save"):
"""
Enable saving reply handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.reply_saver = ... | def enable_save_reply_handlers(self, delay=120, filename="./.handler-saves/reply.save"):
"""
Enable saving reply handlers (by default saving disable)
:param delay: Delay between changes in handlers and saving
:param filename: Filename of save file
"""
self.reply_saver = ... | [
"Enable",
"saving",
"reply",
"handlers",
"(",
"by",
"default",
"saving",
"disable",
")"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L182-L189 | [
"def",
"enable_save_reply_handlers",
"(",
"self",
",",
"delay",
"=",
"120",
",",
"filename",
"=",
"\"./.handler-saves/reply.save\"",
")",
":",
"self",
".",
"reply_saver",
"=",
"Saver",
"(",
"self",
".",
"reply_handlers",
",",
"filename",
",",
"delay",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.load_next_step_handlers | Load next step handlers from save file
:param filename: Filename of the file where handlers was saved
:param del_file_after_loading: Is passed True, after loading save file will be deleted | telebot/__init__.py | def load_next_step_handlers(self, filename="./.handler-saves/step.save", del_file_after_loading=True):
"""
Load next step handlers from save file
:param filename: Filename of the file where handlers was saved
:param del_file_after_loading: Is passed True, after loading save file will be... | def load_next_step_handlers(self, filename="./.handler-saves/step.save", del_file_after_loading=True):
"""
Load next step handlers from save file
:param filename: Filename of the file where handlers was saved
:param del_file_after_loading: Is passed True, after loading save file will be... | [
"Load",
"next",
"step",
"handlers",
"from",
"save",
"file"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L203-L210 | [
"def",
"load_next_step_handlers",
"(",
"self",
",",
"filename",
"=",
"\"./.handler-saves/step.save\"",
",",
"del_file_after_loading",
"=",
"True",
")",
":",
"self",
".",
"next_step_saver",
".",
"load_handlers",
"(",
"filename",
",",
"del_file_after_loading",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.get_updates | Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
:param allowed_updates: Array of string. List the types of updates you want your bot to receive.
:param offset: Integer. Identifier of the first update to be returned.
:param limit: Int... | telebot/__init__.py | def get_updates(self, offset=None, limit=None, timeout=20, allowed_updates=None):
"""
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
:param allowed_updates: Array of string. List the types of updates you want your bot to receive.
... | def get_updates(self, offset=None, limit=None, timeout=20, allowed_updates=None):
"""
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
:param allowed_updates: Array of string. List the types of updates you want your bot to receive.
... | [
"Use",
"this",
"method",
"to",
"receive",
"incoming",
"updates",
"using",
"long",
"polling",
"(",
"wiki",
")",
".",
"An",
"Array",
"of",
"Update",
"objects",
"is",
"returned",
".",
":",
"param",
"allowed_updates",
":",
"Array",
"of",
"string",
".",
"List",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L238-L251 | [
"def",
"get_updates",
"(",
"self",
",",
"offset",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"timeout",
"=",
"20",
",",
"allowed_updates",
"=",
"None",
")",
":",
"json_updates",
"=",
"apihelper",
".",
"get_updates",
"(",
"self",
".",
"token",
",",
"o... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.__skip_updates | Get and discard all pending updates before first poll of the bot
:return: total updates skipped | telebot/__init__.py | def __skip_updates(self):
"""
Get and discard all pending updates before first poll of the bot
:return: total updates skipped
"""
total = 0
updates = self.get_updates(offset=self.last_update_id, timeout=1)
while updates:
total += len(updates)
... | def __skip_updates(self):
"""
Get and discard all pending updates before first poll of the bot
:return: total updates skipped
"""
total = 0
updates = self.get_updates(offset=self.last_update_id, timeout=1)
while updates:
total += len(updates)
... | [
"Get",
"and",
"discard",
"all",
"pending",
"updates",
"before",
"first",
"poll",
"of",
"the",
"bot",
":",
"return",
":",
"total",
"updates",
"skipped"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L253-L266 | [
"def",
"__skip_updates",
"(",
"self",
")",
":",
"total",
"=",
"0",
"updates",
"=",
"self",
".",
"get_updates",
"(",
"offset",
"=",
"self",
".",
"last_update_id",
",",
"timeout",
"=",
"1",
")",
"while",
"updates",
":",
"total",
"+=",
"len",
"(",
"update... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.__retrieve_updates | Retrieves any updates from the Telegram API.
Registered listeners and applicable message handlers will be notified when a new message arrives.
:raises ApiException when a call has failed. | telebot/__init__.py | def __retrieve_updates(self, timeout=20):
"""
Retrieves any updates from the Telegram API.
Registered listeners and applicable message handlers will be notified when a new message arrives.
:raises ApiException when a call has failed.
"""
if self.skip_pending:
... | def __retrieve_updates(self, timeout=20):
"""
Retrieves any updates from the Telegram API.
Registered listeners and applicable message handlers will be notified when a new message arrives.
:raises ApiException when a call has failed.
"""
if self.skip_pending:
... | [
"Retrieves",
"any",
"updates",
"from",
"the",
"Telegram",
"API",
".",
"Registered",
"listeners",
"and",
"applicable",
"message",
"handlers",
"will",
"be",
"notified",
"when",
"a",
"new",
"message",
"arrives",
".",
":",
"raises",
"ApiException",
"when",
"a",
"c... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L268-L278 | [
"def",
"__retrieve_updates",
"(",
"self",
",",
"timeout",
"=",
"20",
")",
":",
"if",
"self",
".",
"skip_pending",
":",
"logger",
".",
"debug",
"(",
"'Skipped {0} pending messages'",
".",
"format",
"(",
"self",
".",
"__skip_updates",
"(",
")",
")",
")",
"se... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.polling | This function creates a new Thread that calls an internal __retrieve_updates function.
This allows the bot to retrieve Updates automagically and notify listeners and message handlers accordingly.
Warning: Do not call this function more than once!
Always get updates.
:param interval:
... | telebot/__init__.py | def polling(self, none_stop=False, interval=0, timeout=20):
"""
This function creates a new Thread that calls an internal __retrieve_updates function.
This allows the bot to retrieve Updates automagically and notify listeners and message handlers accordingly.
Warning: Do not call this f... | def polling(self, none_stop=False, interval=0, timeout=20):
"""
This function creates a new Thread that calls an internal __retrieve_updates function.
This allows the bot to retrieve Updates automagically and notify listeners and message handlers accordingly.
Warning: Do not call this f... | [
"This",
"function",
"creates",
"a",
"new",
"Thread",
"that",
"calls",
"an",
"internal",
"__retrieve_updates",
"function",
".",
"This",
"allows",
"the",
"bot",
"to",
"retrieve",
"Updates",
"automagically",
"and",
"notify",
"listeners",
"and",
"message",
"handlers",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L376-L392 | [
"def",
"polling",
"(",
"self",
",",
"none_stop",
"=",
"False",
",",
"interval",
"=",
"0",
",",
"timeout",
"=",
"20",
")",
":",
"if",
"self",
".",
"threaded",
":",
"self",
".",
"__threaded_polling",
"(",
"none_stop",
",",
"interval",
",",
"timeout",
")"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.get_user_profile_photos | Retrieves the user profile photos of the person with 'user_id'
See https://core.telegram.org/bots/api#getuserprofilephotos
:param user_id:
:param offset:
:param limit:
:return: API reply. | telebot/__init__.py | def get_user_profile_photos(self, user_id, offset=None, limit=None):
"""
Retrieves the user profile photos of the person with 'user_id'
See https://core.telegram.org/bots/api#getuserprofilephotos
:param user_id:
:param offset:
:param limit:
:return: API reply.
... | def get_user_profile_photos(self, user_id, offset=None, limit=None):
"""
Retrieves the user profile photos of the person with 'user_id'
See https://core.telegram.org/bots/api#getuserprofilephotos
:param user_id:
:param offset:
:param limit:
:return: API reply.
... | [
"Retrieves",
"the",
"user",
"profile",
"photos",
"of",
"the",
"person",
"with",
"user_id",
"See",
"https",
":",
"//",
"core",
".",
"telegram",
".",
"org",
"/",
"bots",
"/",
"api#getuserprofilephotos",
":",
"param",
"user_id",
":",
":",
"param",
"offset",
"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L491-L501 | [
"def",
"get_user_profile_photos",
"(",
"self",
",",
"user_id",
",",
"offset",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"result",
"=",
"apihelper",
".",
"get_user_profile_photos",
"(",
"self",
".",
"token",
",",
"user_id",
",",
"offset",
",",
"limi... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.get_chat | Use this method to get up to date information about the chat (current name of the user for one-on-one
conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
:param chat_id:
:return: | telebot/__init__.py | def get_chat(self, chat_id):
"""
Use this method to get up to date information about the chat (current name of the user for one-on-one
conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
:param chat_id:
:return:
"""
... | def get_chat(self, chat_id):
"""
Use this method to get up to date information about the chat (current name of the user for one-on-one
conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
:param chat_id:
:return:
"""
... | [
"Use",
"this",
"method",
"to",
"get",
"up",
"to",
"date",
"information",
"about",
"the",
"chat",
"(",
"current",
"name",
"of",
"the",
"user",
"for",
"one",
"-",
"on",
"-",
"one",
"conversations",
"current",
"username",
"of",
"a",
"user",
"group",
"or",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L503-L511 | [
"def",
"get_chat",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"types",
".",
"Chat",
".",
"de_json",
"(",
"result",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.leave_chat | Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
:param chat_id:
:return: | telebot/__init__.py | def leave_chat(self, chat_id):
"""
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
:param chat_id:
:return:
"""
result = apihelper.leave_chat(self.token, chat_id)
return result | def leave_chat(self, chat_id):
"""
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
:param chat_id:
:return:
"""
result = apihelper.leave_chat(self.token, chat_id)
return result | [
"Use",
"this",
"method",
"for",
"your",
"bot",
"to",
"leave",
"a",
"group",
"supergroup",
"or",
"channel",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
":",
"return",
":"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L513-L520 | [
"def",
"leave_chat",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"leave_chat",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"result"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.get_chat_administrators | Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects
that contains information about all chat administrators except other bots.
:param chat_id:
:return: | telebot/__init__.py | def get_chat_administrators(self, chat_id):
"""
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects
that contains information about all chat administrators except other bots.
:param chat_id:
:return:
"""
re... | def get_chat_administrators(self, chat_id):
"""
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects
that contains information about all chat administrators except other bots.
:param chat_id:
:return:
"""
re... | [
"Use",
"this",
"method",
"to",
"get",
"a",
"list",
"of",
"administrators",
"in",
"a",
"chat",
".",
"On",
"success",
"returns",
"an",
"Array",
"of",
"ChatMember",
"objects",
"that",
"contains",
"information",
"about",
"all",
"chat",
"administrators",
"except",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L522-L533 | [
"def",
"get_chat_administrators",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat_administrators",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"ret",
"=",
"[",
"]",
"for",
"r",
"in",
"result",
":",
"ret",
".",
"appen... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.get_chat_members_count | Use this method to get the number of members in a chat. Returns Int on success.
:param chat_id:
:return: | telebot/__init__.py | def get_chat_members_count(self, chat_id):
"""
Use this method to get the number of members in a chat. Returns Int on success.
:param chat_id:
:return:
"""
result = apihelper.get_chat_members_count(self.token, chat_id)
return result | def get_chat_members_count(self, chat_id):
"""
Use this method to get the number of members in a chat. Returns Int on success.
:param chat_id:
:return:
"""
result = apihelper.get_chat_members_count(self.token, chat_id)
return result | [
"Use",
"this",
"method",
"to",
"get",
"the",
"number",
"of",
"members",
"in",
"a",
"chat",
".",
"Returns",
"Int",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
":",
"return",
":"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L535-L542 | [
"def",
"get_chat_members_count",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat_members_count",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"result"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.set_chat_sticker_set | Use this method to set a new group sticker set for a supergroup. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Use the field can_set_sticker_set optionally returned in getChat requests to check
if the bot can use this method. Returns Tr... | telebot/__init__.py | def set_chat_sticker_set(self, chat_id, sticker_set_name):
"""
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Use the field can_set_sticker_set optionally returned ... | def set_chat_sticker_set(self, chat_id, sticker_set_name):
"""
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Use the field can_set_sticker_set optionally returned ... | [
"Use",
"this",
"method",
"to",
"set",
"a",
"new",
"group",
"sticker",
"set",
"for",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L544-L556 | [
"def",
"set_chat_sticker_set",
"(",
"self",
",",
"chat_id",
",",
"sticker_set_name",
")",
":",
"result",
"=",
"apihelper",
".",
"set_chat_sticker_set",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"sticker_set_name",
")",
"return",
"result"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.delete_chat_sticker_set | Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat
for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set
optionally returned in getChat requests to check if the bot can use this method. Returns True on su... | telebot/__init__.py | def delete_chat_sticker_set(self, chat_id):
"""
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat
for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set
optionally returned in getChat requ... | def delete_chat_sticker_set(self, chat_id):
"""
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat
for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set
optionally returned in getChat requ... | [
"Use",
"this",
"method",
"to",
"delete",
"a",
"group",
"sticker",
"set",
"from",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
"ad... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L558-L568 | [
"def",
"delete_chat_sticker_set",
"(",
"self",
",",
"chat_id",
")",
":",
"result",
"=",
"apihelper",
".",
"delete_chat_sticker_set",
"(",
"self",
".",
"token",
",",
"chat_id",
")",
"return",
"result"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.get_chat_member | Use this method to get information about a member of a chat. Returns a ChatMember object on success.
:param chat_id:
:param user_id:
:return: | telebot/__init__.py | def get_chat_member(self, chat_id, user_id):
"""
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
:param chat_id:
:param user_id:
:return:
"""
result = apihelper.get_chat_member(self.token, chat_id, user_id)
... | def get_chat_member(self, chat_id, user_id):
"""
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
:param chat_id:
:param user_id:
:return:
"""
result = apihelper.get_chat_member(self.token, chat_id, user_id)
... | [
"Use",
"this",
"method",
"to",
"get",
"information",
"about",
"a",
"member",
"of",
"a",
"chat",
".",
"Returns",
"a",
"ChatMember",
"object",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"user_id",
":",
":",
"return",
":"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L570-L578 | [
"def",
"get_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
")",
":",
"result",
"=",
"apihelper",
".",
"get_chat_member",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"user_id",
")",
"return",
"types",
".",
"ChatMember",
".",
"de_json",
"(",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_message | Use this method to send text messages.
Warning: Do not send more than about 5000 characters each message, otherwise you'll risk an HTTP 414 error.
If you must send more than 5000 characters, use the split_string function in apihelper.py.
:param chat_id:
:param text:
:param disa... | telebot/__init__.py | def send_message(self, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages.
Warning: Do not send more than about 5000 characters each message, other... | def send_message(self, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send text messages.
Warning: Do not send more than about 5000 characters each message, other... | [
"Use",
"this",
"method",
"to",
"send",
"text",
"messages",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L580-L599 | [
"def",
"send_message",
"(",
"self",
",",
"chat_id",
",",
"text",
",",
"disable_web_page_preview",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.forward_message | Use this method to forward messages of any kind.
:param disable_notification:
:param chat_id: which chat to forward
:param from_chat_id: which chat message from
:param message_id: message id
:return: API reply. | telebot/__init__.py | def forward_message(self, chat_id, from_chat_id, message_id, disable_notification=None):
"""
Use this method to forward messages of any kind.
:param disable_notification:
:param chat_id: which chat to forward
:param from_chat_id: which chat message from
:param message_id:... | def forward_message(self, chat_id, from_chat_id, message_id, disable_notification=None):
"""
Use this method to forward messages of any kind.
:param disable_notification:
:param chat_id: which chat to forward
:param from_chat_id: which chat message from
:param message_id:... | [
"Use",
"this",
"method",
"to",
"forward",
"messages",
"of",
"any",
"kind",
".",
":",
"param",
"disable_notification",
":",
":",
"param",
"chat_id",
":",
"which",
"chat",
"to",
"forward",
":",
"param",
"from_chat_id",
":",
"which",
"chat",
"message",
"from",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L601-L611 | [
"def",
"forward_message",
"(",
"self",
",",
"chat_id",
",",
"from_chat_id",
",",
"message_id",
",",
"disable_notification",
"=",
"None",
")",
":",
"return",
"types",
".",
"Message",
".",
"de_json",
"(",
"apihelper",
".",
"forward_message",
"(",
"self",
".",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.delete_message | Use this method to delete message. Returns True on success.
:param chat_id: in which chat to delete
:param message_id: which message to delete
:return: API reply. | telebot/__init__.py | def delete_message(self, chat_id, message_id):
"""
Use this method to delete message. Returns True on success.
:param chat_id: in which chat to delete
:param message_id: which message to delete
:return: API reply.
"""
return apihelper.delete_message(self.token, ch... | def delete_message(self, chat_id, message_id):
"""
Use this method to delete message. Returns True on success.
:param chat_id: in which chat to delete
:param message_id: which message to delete
:return: API reply.
"""
return apihelper.delete_message(self.token, ch... | [
"Use",
"this",
"method",
"to",
"delete",
"message",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"chat_id",
":",
"in",
"which",
"chat",
"to",
"delete",
":",
"param",
"message_id",
":",
"which",
"message",
"to",
"delete",
":",
"return",
":"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L613-L620 | [
"def",
"delete_message",
"(",
"self",
",",
"chat_id",
",",
"message_id",
")",
":",
"return",
"apihelper",
".",
"delete_message",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"message_id",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_photo | Use this method to send photos.
:param disable_notification:
:param chat_id:
:param photo:
:param caption:
:param parse_mode
:param reply_to_message_id:
:param reply_markup:
:return: API reply. | telebot/__init__.py | def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send photos.
:param disable_notification:
:param chat_id:
:param photo:
:param caption:
... | def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
"""
Use this method to send photos.
:param disable_notification:
:param chat_id:
:param photo:
:param caption:
... | [
"Use",
"this",
"method",
"to",
"send",
"photos",
".",
":",
"param",
"disable_notification",
":",
":",
"param",
"chat_id",
":",
":",
"param",
"photo",
":",
":",
"param",
"caption",
":",
":",
"param",
"parse_mode",
":",
"param",
"reply_to_message_id",
":",
"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L622-L637 | [
"def",
"send_photo",
"(",
"self",
",",
"chat_id",
",",
"photo",
",",
"caption",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
")",
":",
"ret... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_audio | Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format.
:param chat_id:Unique identifier for the message recipient
:param audio:Audio file to send.
:param duration:Duration of the audio in seconds
:para... | telebot/__init__.py | def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None,
reply_to_message_id=None, reply_markup=None, parse_mode=None, disable_notification=None,
timeout=None):
"""
Use this method to send audio files, if you want Telegram client... | def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None,
reply_to_message_id=None, reply_markup=None, parse_mode=None, disable_notification=None,
timeout=None):
"""
Use this method to send audio files, if you want Telegram client... | [
"Use",
"this",
"method",
"to",
"send",
"audio",
"files",
"if",
"you",
"want",
"Telegram",
"clients",
"to",
"display",
"them",
"in",
"the",
"music",
"player",
".",
"Your",
"audio",
"must",
"be",
"in",
"the",
".",
"mp3",
"format",
".",
":",
"param",
"cha... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L639-L656 | [
"def",
"send_audio",
"(",
"self",
",",
"chat_id",
",",
"audio",
",",
"caption",
"=",
"None",
",",
"duration",
"=",
"None",
",",
"performer",
"=",
"None",
",",
"title",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_voice | Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
:param chat_id:Unique identifier for the message recipient.
:param voice:
:param duration:Duration of sent audio in seconds
:param reply_to_message_id:
:param reply_... | telebot/__init__.py | def send_voice(self, chat_id, voice, caption=None, duration=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None, timeout=None):
"""
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice messa... | def send_voice(self, chat_id, voice, caption=None, duration=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None, timeout=None):
"""
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice messa... | [
"Use",
"this",
"method",
"to",
"send",
"audio",
"files",
"if",
"you",
"want",
"Telegram",
"clients",
"to",
"display",
"the",
"file",
"as",
"a",
"playable",
"voice",
"message",
".",
":",
"param",
"chat_id",
":",
"Unique",
"identifier",
"for",
"the",
"messag... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L658-L672 | [
"def",
"send_voice",
"(",
"self",
",",
"chat_id",
",",
"voice",
",",
"caption",
"=",
"None",
",",
"duration",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_document | Use this method to send general files.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
:param parse_mode:
:param disable_notification:
:return: API reply. | telebot/__init__.py | def send_document(self, chat_id, data, reply_to_message_id=None, caption=None, reply_markup=None,
parse_mode=None, disable_notification=None, timeout=None):
"""
Use this method to send general files.
:param chat_id:
:param data:
:param reply_to_message_id:
... | def send_document(self, chat_id, data, reply_to_message_id=None, caption=None, reply_markup=None,
parse_mode=None, disable_notification=None, timeout=None):
"""
Use this method to send general files.
:param chat_id:
:param data:
:param reply_to_message_id:
... | [
"Use",
"this",
"method",
"to",
"send",
"general",
"files",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"data",
":",
":",
"param",
"reply_to_message_id",
":",
":",
"param",
"reply_markup",
":",
":",
"param",
"parse_mode",
":",
":",
"param",
"disable_no... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L674-L688 | [
"def",
"send_document",
"(",
"self",
",",
"chat_id",
",",
"data",
",",
"reply_to_message_id",
"=",
"None",
",",
"caption",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"timeout"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_sticker | Use this method to send .webp stickers.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
:return: API reply. | telebot/__init__.py | def send_sticker(self, chat_id, data, reply_to_message_id=None, reply_markup=None, disable_notification=None,
timeout=None):
"""
Use this method to send .webp stickers.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
... | def send_sticker(self, chat_id, data, reply_to_message_id=None, reply_markup=None, disable_notification=None,
timeout=None):
"""
Use this method to send .webp stickers.
:param chat_id:
:param data:
:param reply_to_message_id:
:param reply_markup:
... | [
"Use",
"this",
"method",
"to",
"send",
".",
"webp",
"stickers",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"data",
":",
":",
"param",
"reply_to_message_id",
":",
":",
"param",
"reply_markup",
":",
":",
"return",
":",
"API",
"reply",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L690-L702 | [
"def",
"send_sticker",
"(",
"self",
",",
"chat_id",
",",
"data",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"return",
"types",
".",
"Message",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_video | Use this method to send video files, Telegram clients support mp4 videos.
:param chat_id: Integer : Unique identifier for the message recipient — User or GroupChat id
:param data: InputFile or String : Video to send. You can either pass a file_id as String to resend a video that is already on the Telegr... | telebot/__init__.py | def send_video(self, chat_id, data, duration=None, caption=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None):
"""
Use this method to send video files, Telegram clients support mp4 videos.
:para... | def send_video(self, chat_id, data, duration=None, caption=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None):
"""
Use this method to send video files, Telegram clients support mp4 videos.
:para... | [
"Use",
"this",
"method",
"to",
"send",
"video",
"files",
"Telegram",
"clients",
"support",
"mp4",
"videos",
".",
":",
"param",
"chat_id",
":",
"Integer",
":",
"Unique",
"identifier",
"for",
"the",
"message",
"recipient",
"—",
"User",
"or",
"GroupChat",
"id",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L704-L720 | [
"def",
"send_video",
"(",
"self",
",",
"chat_id",
",",
"data",
",",
"duration",
"=",
"None",
",",
"caption",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"parse_mode",
"=",
"None",
",",
"supports_streaming",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_video_note | Use this method to send video files, Telegram clients support mp4 videos.
:param chat_id: Integer : Unique identifier for the message recipient — User or GroupChat id
:param data: InputFile or String : Video note to send. You can either pass a file_id as String to resend a video that is already on the T... | telebot/__init__.py | def send_video_note(self, chat_id, data, duration=None, length=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None, timeout=None):
"""
Use this method to send video files, Telegram clients support mp4 videos.
:param chat_id: Integer : Unique ident... | def send_video_note(self, chat_id, data, duration=None, length=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None, timeout=None):
"""
Use this method to send video files, Telegram clients support mp4 videos.
:param chat_id: Integer : Unique ident... | [
"Use",
"this",
"method",
"to",
"send",
"video",
"files",
"Telegram",
"clients",
"support",
"mp4",
"videos",
".",
":",
"param",
"chat_id",
":",
"Integer",
":",
"Unique",
"identifier",
"for",
"the",
"message",
"recipient",
"—",
"User",
"or",
"GroupChat",
"id",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L722-L736 | [
"def",
"send_video_note",
"(",
"self",
",",
"chat_id",
",",
"data",
",",
"duration",
"=",
"None",
",",
"length",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"timeout",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_media_group | send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
:param chat_id:
:param media:
:param disable_notification:
:param reply_to_message_id:
:return: | telebot/__init__.py | def send_media_group(self, chat_id, media, disable_notification=None, reply_to_message_id=None):
"""
send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
:param chat_id:
:param media:
:param disable_notification:
:param repl... | def send_media_group(self, chat_id, media, disable_notification=None, reply_to_message_id=None):
"""
send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
:param chat_id:
:param media:
:param disable_notification:
:param repl... | [
"send",
"a",
"group",
"of",
"photos",
"or",
"videos",
"as",
"an",
"album",
".",
"On",
"success",
"an",
"array",
"of",
"the",
"sent",
"Messages",
"is",
"returned",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"media",
":",
":",
"param",
"disable_not... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L738-L751 | [
"def",
"send_media_group",
"(",
"self",
",",
"chat_id",
",",
"media",
",",
"disable_notification",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
")",
":",
"result",
"=",
"apihelper",
".",
"send_media_group",
"(",
"self",
".",
"token",
",",
"chat_id",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_location | Use this method to send point on the map.
:param chat_id:
:param latitude:
:param longitude:
:param live_period
:param reply_to_message_id:
:param reply_markup:
:return: API reply. | telebot/__init__.py | def send_location(self, chat_id, latitude, longitude, live_period=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None):
"""
Use this method to send point on the map.
:param chat_id:
:param latitude:
:param longitude:
:param l... | def send_location(self, chat_id, latitude, longitude, live_period=None, reply_to_message_id=None, reply_markup=None,
disable_notification=None):
"""
Use this method to send point on the map.
:param chat_id:
:param latitude:
:param longitude:
:param l... | [
"Use",
"this",
"method",
"to",
"send",
"point",
"on",
"the",
"map",
".",
":",
"param",
"chat_id",
":",
":",
"param",
"latitude",
":",
":",
"param",
"longitude",
":",
":",
"param",
"live_period",
":",
"param",
"reply_to_message_id",
":",
":",
"param",
"re... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L753-L768 | [
"def",
"send_location",
"(",
"self",
",",
"chat_id",
",",
"latitude",
",",
"longitude",
",",
"live_period",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
",",
"disable_notification",
"=",
"None",
")",
":",
"return",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.edit_message_live_location | Use this method to edit live location
:param latitude:
:param longitude:
:param chat_id:
:param message_id:
:param inline_message_id:
:param reply_markup:
:return: | telebot/__init__.py | def edit_message_live_location(self, latitude, longitude, chat_id=None, message_id=None,
inline_message_id=None, reply_markup=None):
"""
Use this method to edit live location
:param latitude:
:param longitude:
:param chat_id:
:param mess... | def edit_message_live_location(self, latitude, longitude, chat_id=None, message_id=None,
inline_message_id=None, reply_markup=None):
"""
Use this method to edit live location
:param latitude:
:param longitude:
:param chat_id:
:param mess... | [
"Use",
"this",
"method",
"to",
"edit",
"live",
"location",
":",
"param",
"latitude",
":",
":",
"param",
"longitude",
":",
":",
"param",
"chat_id",
":",
":",
"param",
"message_id",
":",
":",
"param",
"inline_message_id",
":",
":",
"param",
"reply_markup",
"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L770-L784 | [
"def",
"edit_message_live_location",
"(",
"self",
",",
"latitude",
",",
"longitude",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"return",
"types",
".",
"Mess... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.stop_message_live_location | Use this method to stop updating a live location message sent by the bot
or via the bot (for inline bots) before live_period expires
:param chat_id:
:param message_id:
:param inline_message_id:
:param reply_markup:
:return: | telebot/__init__.py | def stop_message_live_location(self, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
"""
Use this method to stop updating a live location message sent by the bot
or via the bot (for inline bots) before live_period expires
:param chat_id:
:param message_... | def stop_message_live_location(self, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
"""
Use this method to stop updating a live location message sent by the bot
or via the bot (for inline bots) before live_period expires
:param chat_id:
:param message_... | [
"Use",
"this",
"method",
"to",
"stop",
"updating",
"a",
"live",
"location",
"message",
"sent",
"by",
"the",
"bot",
"or",
"via",
"the",
"bot",
"(",
"for",
"inline",
"bots",
")",
"before",
"live_period",
"expires",
":",
"param",
"chat_id",
":",
":",
"param... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L786-L797 | [
"def",
"stop_message_live_location",
"(",
"self",
",",
"chat_id",
"=",
"None",
",",
"message_id",
"=",
"None",
",",
"inline_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"return",
"types",
".",
"Message",
".",
"de_json",
"(",
"apihelp... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_venue | Use this method to send information about a venue.
:param chat_id: Integer or String : Unique identifier for the target chat or username of the target channel
:param latitude: Float : Latitude of the venue
:param longitude: Float : Longitude of the venue
:param title: String : Name of th... | telebot/__init__.py | def send_venue(self, chat_id, latitude, longitude, title, address, foursquare_id=None, disable_notification=None,
reply_to_message_id=None, reply_markup=None):
"""
Use this method to send information about a venue.
:param chat_id: Integer or String : Unique identifier for the ... | def send_venue(self, chat_id, latitude, longitude, title, address, foursquare_id=None, disable_notification=None,
reply_to_message_id=None, reply_markup=None):
"""
Use this method to send information about a venue.
:param chat_id: Integer or String : Unique identifier for the ... | [
"Use",
"this",
"method",
"to",
"send",
"information",
"about",
"a",
"venue",
".",
":",
"param",
"chat_id",
":",
"Integer",
"or",
"String",
":",
"Unique",
"identifier",
"for",
"the",
"target",
"chat",
"or",
"username",
"of",
"the",
"target",
"channel",
":",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L799-L817 | [
"def",
"send_venue",
"(",
"self",
",",
"chat_id",
",",
"latitude",
",",
"longitude",
",",
"title",
",",
"address",
",",
"foursquare_id",
"=",
"None",
",",
"disable_notification",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.send_chat_action | Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear
its typing status).
:param chat_id:
:param action: One of the following strings: 'typing', ... | telebot/__init__.py | def send_chat_action(self, chat_id, action):
"""
Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear
its typing status).
:param chat_id:... | def send_chat_action(self, chat_id, action):
"""
Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear
its typing status).
:param chat_id:... | [
"Use",
"this",
"method",
"when",
"you",
"need",
"to",
"tell",
"the",
"user",
"that",
"something",
"is",
"happening",
"on",
"the",
"bot",
"s",
"side",
".",
"The",
"status",
"is",
"set",
"for",
"5",
"seconds",
"or",
"less",
"(",
"when",
"a",
"message",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L826-L836 | [
"def",
"send_chat_action",
"(",
"self",
",",
"chat_id",
",",
"action",
")",
":",
"return",
"apihelper",
".",
"send_chat_action",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"action",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.kick_chat_member | Use this method to kick a user from a group or a supergroup.
:param chat_id: Int or string : Unique identifier for the target group or username of the target supergroup
:param user_id: Int : Unique identifier of the target user
:param until_date: Date when the user will be unbanned, unix time. I... | telebot/__init__.py | def kick_chat_member(self, chat_id, user_id, until_date=None):
"""
Use this method to kick a user from a group or a supergroup.
:param chat_id: Int or string : Unique identifier for the target group or username of the target supergroup
:param user_id: Int : Unique identifier of the targe... | def kick_chat_member(self, chat_id, user_id, until_date=None):
"""
Use this method to kick a user from a group or a supergroup.
:param chat_id: Int or string : Unique identifier for the target group or username of the target supergroup
:param user_id: Int : Unique identifier of the targe... | [
"Use",
"this",
"method",
"to",
"kick",
"a",
"user",
"from",
"a",
"group",
"or",
"a",
"supergroup",
".",
":",
"param",
"chat_id",
":",
"Int",
"or",
"string",
":",
"Unique",
"identifier",
"for",
"the",
"target",
"group",
"or",
"username",
"of",
"the",
"t... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L838-L847 | [
"def",
"kick_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
",",
"until_date",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"kick_chat_member",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"user_id",
",",
"until_date",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.restrict_chat_member | Use this method to restrict a user in a supergroup.
The bot must be an administrator in the supergroup for this to work and must have
the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.
Returns True on success.
:param chat_id: Int or Strin... | telebot/__init__.py | def restrict_chat_member(self, chat_id, user_id, until_date=None, can_send_messages=None,
can_send_media_messages=None, can_send_other_messages=None,
can_add_web_page_previews=None):
"""
Use this method to restrict a user in a supergroup.
... | def restrict_chat_member(self, chat_id, user_id, until_date=None, can_send_messages=None,
can_send_media_messages=None, can_send_other_messages=None,
can_add_web_page_previews=None):
"""
Use this method to restrict a user in a supergroup.
... | [
"Use",
"this",
"method",
"to",
"restrict",
"a",
"user",
"in",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"supergroup",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
"admin",
"rights",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L852-L877 | [
"def",
"restrict_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
",",
"until_date",
"=",
"None",
",",
"can_send_messages",
"=",
"None",
",",
"can_send_media_messages",
"=",
"None",
",",
"can_send_other_messages",
"=",
"None",
",",
"can_add_web_page_previe... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.promote_chat_member | Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator
in the chat for this to work and must have the appropriate admin rights.
Pass False for all boolean parameters to demote a user. Returns True on success.
:param chat_id: Unique identifier f... | telebot/__init__.py | def promote_chat_member(self, chat_id, user_id, can_change_info=None, can_post_messages=None,
can_edit_messages=None, can_delete_messages=None, can_invite_users=None,
can_restrict_members=None, can_pin_messages=None, can_promote_members=None):
"""
... | def promote_chat_member(self, chat_id, user_id, can_change_info=None, can_post_messages=None,
can_edit_messages=None, can_delete_messages=None, can_invite_users=None,
can_restrict_members=None, can_pin_messages=None, can_promote_members=None):
"""
... | [
"Use",
"this",
"method",
"to",
"promote",
"or",
"demote",
"a",
"user",
"in",
"a",
"supergroup",
"or",
"a",
"channel",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L879-L903 | [
"def",
"promote_chat_member",
"(",
"self",
",",
"chat_id",
",",
"user_id",
",",
"can_change_info",
"=",
"None",
",",
"can_post_messages",
"=",
"None",
",",
"can_edit_messages",
"=",
"None",
",",
"can_delete_messages",
"=",
"None",
",",
"can_invite_users",
"=",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.set_chat_photo | Use this method to set a new profile photo for the chat. Photos can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regular groups (non-supergroups), this method will only ... | telebot/__init__.py | def set_chat_photo(self, chat_id, photo):
"""
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Not... | def set_chat_photo(self, chat_id, photo):
"""
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Not... | [
"Use",
"this",
"method",
"to",
"set",
"a",
"new",
"profile",
"photo",
"for",
"the",
"chat",
".",
"Photos",
"can",
"t",
"be",
"changed",
"for",
"private",
"chats",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L916-L928 | [
"def",
"set_chat_photo",
"(",
"self",
",",
"chat_id",
",",
"photo",
")",
":",
"return",
"apihelper",
".",
"set_chat_photo",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"photo",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.set_chat_title | Use this method to change the title of a chat. Titles can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regular groups (non-supergroups), this method will only work if th... | telebot/__init__.py | def set_chat_title(self, chat_id, title):
"""
Use this method to change the title of a chat. Titles can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regu... | def set_chat_title(self, chat_id, title):
"""
Use this method to change the title of a chat. Titles can't be changed for private chats.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
Note: In regu... | [
"Use",
"this",
"method",
"to",
"change",
"the",
"title",
"of",
"a",
"chat",
".",
"Titles",
"can",
"t",
"be",
"changed",
"for",
"private",
"chats",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L943-L955 | [
"def",
"set_chat_title",
"(",
"self",
",",
"chat_id",
",",
"title",
")",
":",
"return",
"apihelper",
".",
"set_chat_title",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"title",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.set_chat_description | Use this method to change the description of a supergroup or a channel.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int or Str: Unique identifier for the target chat or username of the target c... | telebot/__init__.py | def set_chat_description(self, chat_id, description):
"""
Use this method to change the description of a supergroup or a channel.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int... | def set_chat_description(self, chat_id, description):
"""
Use this method to change the description of a supergroup or a channel.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int... | [
"Use",
"this",
"method",
"to",
"change",
"the",
"description",
"of",
"a",
"supergroup",
"or",
"a",
"channel",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropr... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L957-L967 | [
"def",
"set_chat_description",
"(",
"self",
",",
"chat_id",
",",
"description",
")",
":",
"return",
"apihelper",
".",
"set_chat_description",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"description",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.pin_chat_message | Use this method to pin a message in a supergroup.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: Int or Str: Unique identifier for the target chat or username of the target channel
(in... | telebot/__init__.py | def pin_chat_message(self, chat_id, message_id, disable_notification=False):
"""
Use this method to pin a message in a supergroup.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: In... | def pin_chat_message(self, chat_id, message_id, disable_notification=False):
"""
Use this method to pin a message in a supergroup.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Returns True on success.
:param chat_id: In... | [
"Use",
"this",
"method",
"to",
"pin",
"a",
"message",
"in",
"a",
"supergroup",
".",
"The",
"bot",
"must",
"be",
"an",
"administrator",
"in",
"the",
"chat",
"for",
"this",
"to",
"work",
"and",
"must",
"have",
"the",
"appropriate",
"admin",
"rights",
".",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L969-L981 | [
"def",
"pin_chat_message",
"(",
"self",
",",
"chat_id",
",",
"message_id",
",",
"disable_notification",
"=",
"False",
")",
":",
"return",
"apihelper",
".",
"pin_chat_message",
"(",
"self",
".",
"token",
",",
"chat_id",
",",
"message_id",
",",
"disable_notificati... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.reply_to | Convenience function for `send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs)` | telebot/__init__.py | def reply_to(self, message, text, **kwargs):
"""
Convenience function for `send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs)`
"""
return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) | def reply_to(self, message, text, **kwargs):
"""
Convenience function for `send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs)`
"""
return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) | [
"Convenience",
"function",
"for",
"send_message",
"(",
"message",
".",
"chat",
".",
"id",
"text",
"reply_to_message_id",
"=",
"message",
".",
"message_id",
"**",
"kwargs",
")"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1061-L1065 | [
"def",
"reply_to",
"(",
"self",
",",
"message",
",",
"text",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"send_message",
"(",
"message",
".",
"chat",
".",
"id",
",",
"text",
",",
"reply_to_message_id",
"=",
"message",
".",
"message_id",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.answer_inline_query | Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.
:param inline_query_id: Unique identifier for the answered query
:param results: Array of results for the inline query
:param cache_time: The maximum amount of... | telebot/__init__.py | def answer_inline_query(self, inline_query_id, results, cache_time=None, is_personal=None, next_offset=None,
switch_pm_text=None, switch_pm_parameter=None):
"""
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results p... | def answer_inline_query(self, inline_query_id, results, cache_time=None, is_personal=None, next_offset=None,
switch_pm_text=None, switch_pm_parameter=None):
"""
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results p... | [
"Use",
"this",
"method",
"to",
"send",
"answers",
"to",
"an",
"inline",
"query",
".",
"On",
"success",
"True",
"is",
"returned",
".",
"No",
"more",
"than",
"50",
"results",
"per",
"query",
"are",
"allowed",
".",
":",
"param",
"inline_query_id",
":",
"Uni... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1067-L1083 | [
"def",
"answer_inline_query",
"(",
"self",
",",
"inline_query_id",
",",
"results",
",",
"cache_time",
"=",
"None",
",",
"is_personal",
"=",
"None",
",",
"next_offset",
"=",
"None",
",",
"switch_pm_text",
"=",
"None",
",",
"switch_pm_parameter",
"=",
"None",
")... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.answer_callback_query | Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to
the user as a notification at the top of the chat screen or as an alert.
:param callback_query_id:
:param text:
:param show_alert:
:return: | telebot/__init__.py | def answer_callback_query(self, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to
the user as a notification at the top of the chat screen or as an alert.
... | def answer_callback_query(self, callback_query_id, text=None, show_alert=None, url=None, cache_time=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to
the user as a notification at the top of the chat screen or as an alert.
... | [
"Use",
"this",
"method",
"to",
"send",
"answers",
"to",
"callback",
"queries",
"sent",
"from",
"inline",
"keyboards",
".",
"The",
"answer",
"will",
"be",
"displayed",
"to",
"the",
"user",
"as",
"a",
"notification",
"at",
"the",
"top",
"of",
"the",
"chat",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1085-L1094 | [
"def",
"answer_callback_query",
"(",
"self",
",",
"callback_query_id",
",",
"text",
"=",
"None",
",",
"show_alert",
"=",
"None",
",",
"url",
"=",
"None",
",",
"cache_time",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"answer_callback_query",
"(",
"sel... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.get_sticker_set | Use this method to get a sticker set. On success, a StickerSet object is returned.
:param name:
:return: | telebot/__init__.py | def get_sticker_set(self, name):
"""
Use this method to get a sticker set. On success, a StickerSet object is returned.
:param name:
:return:
"""
result = apihelper.get_sticker_set(self.token, name)
return types.StickerSet.de_json(result) | def get_sticker_set(self, name):
"""
Use this method to get a sticker set. On success, a StickerSet object is returned.
:param name:
:return:
"""
result = apihelper.get_sticker_set(self.token, name)
return types.StickerSet.de_json(result) | [
"Use",
"this",
"method",
"to",
"get",
"a",
"sticker",
"set",
".",
"On",
"success",
"a",
"StickerSet",
"object",
"is",
"returned",
".",
":",
"param",
"name",
":",
":",
"return",
":"
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1109-L1116 | [
"def",
"get_sticker_set",
"(",
"self",
",",
"name",
")",
":",
"result",
"=",
"apihelper",
".",
"get_sticker_set",
"(",
"self",
".",
"token",
",",
"name",
")",
"return",
"types",
".",
"StickerSet",
".",
"de_json",
"(",
"result",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.upload_sticker_file | Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet
methods (can be used multiple times). Returns the uploaded File on success.
:param user_id:
:param png_sticker:
:return: | telebot/__init__.py | def upload_sticker_file(self, user_id, png_sticker):
"""
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet
methods (can be used multiple times). Returns the uploaded File on success.
:param user_id:
:param png_sticker:
... | def upload_sticker_file(self, user_id, png_sticker):
"""
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet
methods (can be used multiple times). Returns the uploaded File on success.
:param user_id:
:param png_sticker:
... | [
"Use",
"this",
"method",
"to",
"upload",
"a",
".",
"png",
"file",
"with",
"a",
"sticker",
"for",
"later",
"use",
"in",
"createNewStickerSet",
"and",
"addStickerToSet",
"methods",
"(",
"can",
"be",
"used",
"multiple",
"times",
")",
".",
"Returns",
"the",
"u... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1118-L1127 | [
"def",
"upload_sticker_file",
"(",
"self",
",",
"user_id",
",",
"png_sticker",
")",
":",
"result",
"=",
"apihelper",
".",
"upload_sticker_file",
"(",
"self",
".",
"token",
",",
"user_id",
",",
"png_sticker",
")",
"return",
"types",
".",
"File",
".",
"de_json... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.create_new_sticker_set | Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
Returns True on success.
:param user_id:
:param name:
:param title:
:param png_sticker:
:param emojis:
:param contains_masks:
:param mask_posit... | telebot/__init__.py | def create_new_sticker_set(self, user_id, name, title, png_sticker, emojis, contains_masks=None,
mask_position=None):
"""
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
Returns True on success.
... | def create_new_sticker_set(self, user_id, name, title, png_sticker, emojis, contains_masks=None,
mask_position=None):
"""
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
Returns True on success.
... | [
"Use",
"this",
"method",
"to",
"create",
"new",
"sticker",
"set",
"owned",
"by",
"a",
"user",
".",
"The",
"bot",
"will",
"be",
"able",
"to",
"edit",
"the",
"created",
"sticker",
"set",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"user_i... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1129-L1144 | [
"def",
"create_new_sticker_set",
"(",
"self",
",",
"user_id",
",",
"name",
",",
"title",
",",
"png_sticker",
",",
"emojis",
",",
"contains_masks",
"=",
"None",
",",
"mask_position",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"create_new_sticker_set",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.add_sticker_to_set | Use this method to add a new sticker to a set created by the bot. Returns True on success.
:param user_id:
:param name:
:param png_sticker:
:param emojis:
:param mask_position:
:return: | telebot/__init__.py | def add_sticker_to_set(self, user_id, name, png_sticker, emojis, mask_position=None):
"""
Use this method to add a new sticker to a set created by the bot. Returns True on success.
:param user_id:
:param name:
:param png_sticker:
:param emojis:
:param mask_positio... | def add_sticker_to_set(self, user_id, name, png_sticker, emojis, mask_position=None):
"""
Use this method to add a new sticker to a set created by the bot. Returns True on success.
:param user_id:
:param name:
:param png_sticker:
:param emojis:
:param mask_positio... | [
"Use",
"this",
"method",
"to",
"add",
"a",
"new",
"sticker",
"to",
"a",
"set",
"created",
"by",
"the",
"bot",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"user_id",
":",
":",
"param",
"name",
":",
":",
"param",
"png_sticker",
":",
":"... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1146-L1156 | [
"def",
"add_sticker_to_set",
"(",
"self",
",",
"user_id",
",",
"name",
",",
"png_sticker",
",",
"emojis",
",",
"mask_position",
"=",
"None",
")",
":",
"return",
"apihelper",
".",
"add_sticker_to_set",
"(",
"self",
".",
"token",
",",
"user_id",
",",
"name",
... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.set_sticker_position_in_set | Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
:param sticker:
:param position:
:return: | telebot/__init__.py | def set_sticker_position_in_set(self, sticker, position):
"""
Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
:param sticker:
:param position:
:return:
"""
return apihelper.set_sticker_position_in_set... | def set_sticker_position_in_set(self, sticker, position):
"""
Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
:param sticker:
:param position:
:return:
"""
return apihelper.set_sticker_position_in_set... | [
"Use",
"this",
"method",
"to",
"move",
"a",
"sticker",
"in",
"a",
"set",
"created",
"by",
"the",
"bot",
"to",
"a",
"specific",
"position",
".",
"Returns",
"True",
"on",
"success",
".",
":",
"param",
"sticker",
":",
":",
"param",
"position",
":",
":",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1158-L1165 | [
"def",
"set_sticker_position_in_set",
"(",
"self",
",",
"sticker",
",",
"position",
")",
":",
"return",
"apihelper",
".",
"set_sticker_position_in_set",
"(",
"self",
".",
"token",
",",
"sticker",
",",
"position",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.register_for_reply | Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message: The message for which we are awaiting a reply.
:param callback: The callback function to be called when a ... | telebot/__init__.py | def register_for_reply(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message: The message for which we are aw... | def register_for_reply(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message: The message for which we are aw... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"a",
"reply",
"to",
"message",
"arrives",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1175-L1186 | [
"def",
"register_for_reply",
"(",
"self",
",",
"message",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"message_id",
"=",
"message",
".",
"message_id",
"self",
".",
"register_for_reply_by_message_id",
"(",
"message_id",
",",
"callback"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.register_for_reply_by_message_id | Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message_id: The id of the message for which we are awaiting a reply.
:param callback: The callback function to be call... | telebot/__init__.py | def register_for_reply_by_message_id(self, message_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message_id: The id of the ... | def register_for_reply_by_message_id(self, message_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when a reply to `message` arrives.
Warning: In case `callback` as lambda function, saving reply handlers will not work.
:param message_id: The id of the ... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"a",
"reply",
"to",
"message",
"arrives",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1188-L1203 | [
"def",
"register_for_reply_by_message_id",
"(",
"self",
",",
"message_id",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"message_id",
"in",
"self",
".",
"reply_handlers",
".",
"keys",
"(",
")",
":",
"self",
".",
"reply_handle... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.register_next_step_handler | Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param message: The message for which we want to handle new message in the same chat.
:param callback: The call... | telebot/__init__.py | def register_next_step_handler(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param message: The message ... | def register_next_step_handler(self, message, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param message: The message ... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"new",
"message",
"arrives",
"after",
"message",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1217-L1229 | [
"def",
"register_next_step_handler",
"(",
"self",
",",
"message",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"chat_id",
"=",
"message",
".",
"chat",
".",
"id",
"self",
".",
"register_next_step_handler_by_chat_id",
"(",
"chat_id",
"... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.register_next_step_handler_by_chat_id | Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param chat_id: The chat for which we want to handle new message.
:param callback: The callback function which ... | telebot/__init__.py | def register_next_step_handler_by_chat_id(self, chat_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param chat_id: T... | def register_next_step_handler_by_chat_id(self, chat_id, callback, *args, **kwargs):
"""
Registers a callback function to be notified when new message arrives after `message`.
Warning: In case `callback` as lambda function, saving next step handlers will not work.
:param chat_id: T... | [
"Registers",
"a",
"callback",
"function",
"to",
"be",
"notified",
"when",
"new",
"message",
"arrives",
"after",
"message",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1231-L1248 | [
"def",
"register_next_step_handler_by_chat_id",
"(",
"self",
",",
"chat_id",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"chat_id",
"in",
"self",
".",
"next_step_handlers",
".",
"keys",
"(",
")",
":",
"self",
".",
"next_step... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.clear_step_handler | Clears all callback functions registered by register_next_step_handler().
:param message: The message for which we want to handle new message after that in same chat. | telebot/__init__.py | def clear_step_handler(self, message):
"""
Clears all callback functions registered by register_next_step_handler().
:param message: The message for which we want to handle new message after that in same chat.
"""
chat_id = message.chat.id
self.clear_step_handler_by_... | def clear_step_handler(self, message):
"""
Clears all callback functions registered by register_next_step_handler().
:param message: The message for which we want to handle new message after that in same chat.
"""
chat_id = message.chat.id
self.clear_step_handler_by_... | [
"Clears",
"all",
"callback",
"functions",
"registered",
"by",
"register_next_step_handler",
"()",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1250-L1257 | [
"def",
"clear_step_handler",
"(",
"self",
",",
"message",
")",
":",
"chat_id",
"=",
"message",
".",
"chat",
".",
"id",
"self",
".",
"clear_step_handler_by_chat_id",
"(",
"chat_id",
")"
] | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.clear_step_handler_by_chat_id | Clears all callback functions registered by register_next_step_handler().
:param chat_id: The chat for which we want to clear next step handlers | telebot/__init__.py | def clear_step_handler_by_chat_id(self, chat_id):
"""
Clears all callback functions registered by register_next_step_handler().
:param chat_id: The chat for which we want to clear next step handlers
"""
self.next_step_handlers[chat_id] = []
if self.next_step_saver is no... | def clear_step_handler_by_chat_id(self, chat_id):
"""
Clears all callback functions registered by register_next_step_handler().
:param chat_id: The chat for which we want to clear next step handlers
"""
self.next_step_handlers[chat_id] = []
if self.next_step_saver is no... | [
"Clears",
"all",
"callback",
"functions",
"registered",
"by",
"register_next_step_handler",
"()",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1259-L1268 | [
"def",
"clear_step_handler_by_chat_id",
"(",
"self",
",",
"chat_id",
")",
":",
"self",
".",
"next_step_handlers",
"[",
"chat_id",
"]",
"=",
"[",
"]",
"if",
"self",
".",
"next_step_saver",
"is",
"not",
"None",
":",
"self",
".",
"next_step_saver",
".",
"start_... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.clear_reply_handlers_by_message_id | Clears all callback functions registered by register_for_reply() and register_for_reply_by_message_id().
:param message_id: The message id for which we want to clear reply handlers | telebot/__init__.py | def clear_reply_handlers_by_message_id(self, message_id):
"""
Clears all callback functions registered by register_for_reply() and register_for_reply_by_message_id().
:param message_id: The message id for which we want to clear reply handlers
"""
self.reply_handlers[message_id] ... | def clear_reply_handlers_by_message_id(self, message_id):
"""
Clears all callback functions registered by register_for_reply() and register_for_reply_by_message_id().
:param message_id: The message id for which we want to clear reply handlers
"""
self.reply_handlers[message_id] ... | [
"Clears",
"all",
"callback",
"functions",
"registered",
"by",
"register_for_reply",
"()",
"and",
"register_for_reply_by_message_id",
"()",
"."
] | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1279-L1288 | [
"def",
"clear_reply_handlers_by_message_id",
"(",
"self",
",",
"message_id",
")",
":",
"self",
".",
"reply_handlers",
"[",
"message_id",
"]",
"=",
"[",
"]",
"if",
"self",
".",
"reply_saver",
"is",
"not",
"None",
":",
"self",
".",
"reply_saver",
".",
"start_s... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | TeleBot.message_handler | Message handler decorator.
This decorator can be used to decorate functions that must handle certain types of messages.
All message handlers are tested in the order they were added.
Example:
bot = TeleBot('TOKEN')
# Handles all messages which text matches regexp.
@bot.... | telebot/__init__.py | def message_handler(self, commands=None, regexp=None, func=None, content_types=['text'], **kwargs):
"""
Message handler decorator.
This decorator can be used to decorate functions that must handle certain types of messages.
All message handlers are tested in the order they were added.
... | def message_handler(self, commands=None, regexp=None, func=None, content_types=['text'], **kwargs):
"""
Message handler decorator.
This decorator can be used to decorate functions that must handle certain types of messages.
All message handlers are tested in the order they were added.
... | [
"Message",
"handler",
"decorator",
".",
"This",
"decorator",
"can",
"be",
"used",
"to",
"decorate",
"functions",
"that",
"must",
"handle",
"certain",
"types",
"of",
"messages",
".",
"All",
"message",
"handlers",
"are",
"tested",
"in",
"the",
"order",
"they",
... | eternnoir/pyTelegramBotAPI | python | https://github.com/eternnoir/pyTelegramBotAPI/blob/47b53b88123097f1b9562a6cd5d4e080b86185d1/telebot/__init__.py#L1315-L1357 | [
"def",
"message_handler",
"(",
"self",
",",
"commands",
"=",
"None",
",",
"regexp",
"=",
"None",
",",
"func",
"=",
"None",
",",
"content_types",
"=",
"[",
"'text'",
"]",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"decorator",
"(",
"handler",
")",
":",... | 47b53b88123097f1b9562a6cd5d4e080b86185d1 |
train | generate_code | Generates code samples.
Args:
max_length: int. max literal length.
max_nest: int. max nesting level.
ops: CodeOp. set of allowable operations.
Returns:
1. (str) output value.
2. (str) Code operation. | sonnet/examples/learn_to_execute.py | def generate_code(max_length, max_nest, ops):
"""Generates code samples.
Args:
max_length: int. max literal length.
max_nest: int. max nesting level.
ops: CodeOp. set of allowable operations.
Returns:
1. (str) output value.
2. (str) Code operation.
"""
stack = []
def fetch_one():
... | def generate_code(max_length, max_nest, ops):
"""Generates code samples.
Args:
max_length: int. max literal length.
max_nest: int. max nesting level.
ops: CodeOp. set of allowable operations.
Returns:
1. (str) output value.
2. (str) Code operation.
"""
stack = []
def fetch_one():
... | [
"Generates",
"code",
"samples",
"."
] | deepmind/sonnet | python | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L539-L577 | [
"def",
"generate_code",
"(",
"max_length",
",",
"max_nest",
",",
"ops",
")",
":",
"stack",
"=",
"[",
"]",
"def",
"fetch_one",
"(",
")",
":",
"# Always use an existing nested value for one of the operands.",
"if",
"stack",
":",
"return",
"stack",
".",
"pop",
"(",... | 00612ca3178964d86b556e062694d808ff81fcca |
train | get_tokens | Defines tokens.
Args:
max_value: the maximum numeric range for the token.
Returns:
list of string tokens in vocabulary. | sonnet/examples/learn_to_execute.py | def get_tokens(max_value):
"""Defines tokens.
Args:
max_value: the maximum numeric range for the token.
Returns:
list of string tokens in vocabulary.
"""
vocab = [str(i) for i in range(max_value)]
vocab = set(vocab)
vocab.update(CodeOp.LITERALS)
vocab.update(CodeOp.KEYWORDS)
vocab |= set("".... | def get_tokens(max_value):
"""Defines tokens.
Args:
max_value: the maximum numeric range for the token.
Returns:
list of string tokens in vocabulary.
"""
vocab = [str(i) for i in range(max_value)]
vocab = set(vocab)
vocab.update(CodeOp.LITERALS)
vocab.update(CodeOp.KEYWORDS)
vocab |= set("".... | [
"Defines",
"tokens",
"."
] | deepmind/sonnet | python | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L580-L594 | [
"def",
"get_tokens",
"(",
"max_value",
")",
":",
"vocab",
"=",
"[",
"str",
"(",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"max_value",
")",
"]",
"vocab",
"=",
"set",
"(",
"vocab",
")",
"vocab",
".",
"update",
"(",
"CodeOp",
".",
"LITERALS",
")",
... | 00612ca3178964d86b556e062694d808ff81fcca |
train | LearnToExecute | Factory method for LearnToExecute Dataset module.
Args:
batch_size: (int). The number of elements in a mini-batch.
max_length: (int). Maximum character length.
max_nesting: (int). Maximum level of statement nesting.
token_by_char: (bool). Tokenize by character or words?
mode: (string). Either 'tr... | sonnet/examples/learn_to_execute.py | def LearnToExecute( # pylint: disable=invalid-name
batch_size, max_length=1, max_nesting=1, token_by_char=True,
mode=Mode.TRAIN_COMBINE, loss_threshold=0.1,
min_tries=DEFAULT_MIN_CURRICULUM_EVAL_TRIES, task_type=TaskType.ALG_CTRL):
"""Factory method for LearnToExecute Dataset module.
Args:
batch_... | def LearnToExecute( # pylint: disable=invalid-name
batch_size, max_length=1, max_nesting=1, token_by_char=True,
mode=Mode.TRAIN_COMBINE, loss_threshold=0.1,
min_tries=DEFAULT_MIN_CURRICULUM_EVAL_TRIES, task_type=TaskType.ALG_CTRL):
"""Factory method for LearnToExecute Dataset module.
Args:
batch_... | [
"Factory",
"method",
"for",
"LearnToExecute",
"Dataset",
"module",
"."
] | deepmind/sonnet | python | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L994-L1043 | [
"def",
"LearnToExecute",
"(",
"# pylint: disable=invalid-name",
"batch_size",
",",
"max_length",
"=",
"1",
",",
"max_nesting",
"=",
"1",
",",
"token_by_char",
"=",
"True",
",",
"mode",
"=",
"Mode",
".",
"TRAIN_COMBINE",
",",
"loss_threshold",
"=",
"0.1",
",",
... | 00612ca3178964d86b556e062694d808ff81fcca |
train | MixCurriculum.fetch | Samples up to maximum difficulty. | sonnet/examples/learn_to_execute.py | def fetch(self):
"""Samples up to maximum difficulty."""
length = np.random.randint(1, self._max_length + 1)
nesting = np.random.randint(1, self._max_length + 1)
return length, nesting | def fetch(self):
"""Samples up to maximum difficulty."""
length = np.random.randint(1, self._max_length + 1)
nesting = np.random.randint(1, self._max_length + 1)
return length, nesting | [
"Samples",
"up",
"to",
"maximum",
"difficulty",
"."
] | deepmind/sonnet | python | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L234-L238 | [
"def",
"fetch",
"(",
"self",
")",
":",
"length",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_max_length",
"+",
"1",
")",
"nesting",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_max_length",
"... | 00612ca3178964d86b556e062694d808ff81fcca |
train | CombineCurriculum.update | Increments level difficulty (length and nesting) by 1 until maximum. | sonnet/examples/learn_to_execute.py | def update(self, loss, force=False):
"""Increments level difficulty (length and nesting) by 1 until maximum."""
do_update = super(CombineCurriculum, self).update(loss, force)
if not do_update:
return False
if self._curr_length < self._max_length:
self._curr_length += 1
elif self._curr_n... | def update(self, loss, force=False):
"""Increments level difficulty (length and nesting) by 1 until maximum."""
do_update = super(CombineCurriculum, self).update(loss, force)
if not do_update:
return False
if self._curr_length < self._max_length:
self._curr_length += 1
elif self._curr_n... | [
"Increments",
"level",
"difficulty",
"(",
"length",
"and",
"nesting",
")",
"by",
"1",
"until",
"maximum",
"."
] | deepmind/sonnet | python | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L255-L271 | [
"def",
"update",
"(",
"self",
",",
"loss",
",",
"force",
"=",
"False",
")",
":",
"do_update",
"=",
"super",
"(",
"CombineCurriculum",
",",
"self",
")",
".",
"update",
"(",
"loss",
",",
"force",
")",
"if",
"not",
"do_update",
":",
"return",
"False",
"... | 00612ca3178964d86b556e062694d808ff81fcca |
train | CombineCurriculum.fetch | Samples up to current difficulty. | sonnet/examples/learn_to_execute.py | def fetch(self):
"""Samples up to current difficulty."""
length = np.random.randint(1, self._curr_length + 1)
nesting = np.random.randint(1, self._curr_nesting + 1)
return length, nesting | def fetch(self):
"""Samples up to current difficulty."""
length = np.random.randint(1, self._curr_length + 1)
nesting = np.random.randint(1, self._curr_nesting + 1)
return length, nesting | [
"Samples",
"up",
"to",
"current",
"difficulty",
"."
] | deepmind/sonnet | python | https://github.com/deepmind/sonnet/blob/00612ca3178964d86b556e062694d808ff81fcca/sonnet/examples/learn_to_execute.py#L273-L277 | [
"def",
"fetch",
"(",
"self",
")",
":",
"length",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_curr_length",
"+",
"1",
")",
"nesting",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"self",
".",
"_curr_nesting",
... | 00612ca3178964d86b556e062694d808ff81fcca |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.