repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RomelTorres/alpha_vantage | alpha_vantage/techindicators.py | TechIndicators.get_stochrsi | def get_stochrsi(self, symbol, interval='daily', time_period=20,
series_type='close', fastkperiod=None, fastdperiod=None, fastdmatype=None):
""" Return the stochatic relative strength index in two
json objects as data and meta_data. It raises ValueError when problems
arise
... | python | def get_stochrsi(self, symbol, interval='daily', time_period=20,
series_type='close', fastkperiod=None, fastdperiod=None, fastdmatype=None):
""" Return the stochatic relative strength index in two
json objects as data and meta_data. It raises ValueError when problems
arise
... | [
"def",
"get_stochrsi",
"(",
"self",
",",
"symbol",
",",
"interval",
"=",
"'daily'",
",",
"time_period",
"=",
"20",
",",
"series_type",
"=",
"'close'",
",",
"fastkperiod",
"=",
"None",
",",
"fastdperiod",
"=",
"None",
",",
"fastdmatype",
"=",
"None",
")",
... | Return the stochatic relative strength index in two
json objects as data and meta_data. It raises ValueError when problems
arise
Keyword Arguments:
symbol: the symbol for the equity we want to get its data
interval: time interval between two conscutive values,
... | [
"Return",
"the",
"stochatic",
"relative",
"strength",
"index",
"in",
"two",
"json",
"objects",
"as",
"data",
"and",
"meta_data",
".",
"It",
"raises",
"ValueError",
"when",
"problems",
"arise"
] | 4e0b5057e520e3e3de69cf947301765817290121 | https://github.com/RomelTorres/alpha_vantage/blob/4e0b5057e520e3e3de69cf947301765817290121/alpha_vantage/techindicators.py#L347-L381 | train | Return the stochatic relative strength index in json objects as data and meta_data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
RomelTorres/alpha_vantage | alpha_vantage/techindicators.py | TechIndicators.get_apo | def get_apo(self, symbol, interval='daily', series_type='close',
fastperiod=None, slowperiod=None, matype=None):
""" Return the absolute price oscillator values in two
json objects as data and meta_data. It raises ValueError when problems
arise
Keyword Arguments:
... | python | def get_apo(self, symbol, interval='daily', series_type='close',
fastperiod=None, slowperiod=None, matype=None):
""" Return the absolute price oscillator values in two
json objects as data and meta_data. It raises ValueError when problems
arise
Keyword Arguments:
... | [
"def",
"get_apo",
"(",
"self",
",",
"symbol",
",",
"interval",
"=",
"'daily'",
",",
"series_type",
"=",
"'close'",
",",
"fastperiod",
"=",
"None",
",",
"slowperiod",
"=",
"None",
",",
"matype",
"=",
"None",
")",
":",
"_FUNCTION_KEY",
"=",
"\"APO\"",
"ret... | Return the absolute price oscillator values in two
json objects as data and meta_data. It raises ValueError when problems
arise
Keyword Arguments:
symbol: the symbol for the equity we want to get its data
interval: time interval between two conscutive values,
... | [
"Return",
"the",
"absolute",
"price",
"oscillator",
"values",
"in",
"two",
"json",
"objects",
"as",
"data",
"and",
"meta_data",
".",
"It",
"raises",
"ValueError",
"when",
"problems",
"arise"
] | 4e0b5057e520e3e3de69cf947301765817290121 | https://github.com/RomelTorres/alpha_vantage/blob/4e0b5057e520e3e3de69cf947301765817290121/alpha_vantage/techindicators.py#L433-L463 | train | Return the absolute price oscillator values in two - item json objects as data and meta_data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
RomelTorres/alpha_vantage | alpha_vantage/techindicators.py | TechIndicators.get_bbands | def get_bbands(self, symbol, interval='daily', time_period=20, series_type='close',
nbdevup=None, nbdevdn=None, matype=None):
""" Return the bollinger bands values in two
json objects as data and meta_data. It raises ValueError when problems
arise
Keyword Arguments:
... | python | def get_bbands(self, symbol, interval='daily', time_period=20, series_type='close',
nbdevup=None, nbdevdn=None, matype=None):
""" Return the bollinger bands values in two
json objects as data and meta_data. It raises ValueError when problems
arise
Keyword Arguments:
... | [
"def",
"get_bbands",
"(",
"self",
",",
"symbol",
",",
"interval",
"=",
"'daily'",
",",
"time_period",
"=",
"20",
",",
"series_type",
"=",
"'close'",
",",
"nbdevup",
"=",
"None",
",",
"nbdevdn",
"=",
"None",
",",
"matype",
"=",
"None",
")",
":",
"_FUNCT... | Return the bollinger bands values in two
json objects as data and meta_data. It raises ValueError when problems
arise
Keyword Arguments:
symbol: the symbol for the equity we want to get its data
interval: time interval between two conscutive values,
sup... | [
"Return",
"the",
"bollinger",
"bands",
"values",
"in",
"two",
"json",
"objects",
"as",
"data",
"and",
"meta_data",
".",
"It",
"raises",
"ValueError",
"when",
"problems",
"arise"
] | 4e0b5057e520e3e3de69cf947301765817290121 | https://github.com/RomelTorres/alpha_vantage/blob/4e0b5057e520e3e3de69cf947301765817290121/alpha_vantage/techindicators.py#L780-L812 | train | Return the bollinger bands values in two - band format as data and meta_data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/utils/__init__.py | unpack | def unpack(value):
"""Return a three tuple of data, code, and headers"""
if not isinstance(value, tuple):
return value, 200, {}
try:
data, code, headers = value
return data, code, headers
except ValueError:
pass
try:
data, code = value
return data, c... | python | def unpack(value):
"""Return a three tuple of data, code, and headers"""
if not isinstance(value, tuple):
return value, 200, {}
try:
data, code, headers = value
return data, code, headers
except ValueError:
pass
try:
data, code = value
return data, c... | [
"def",
"unpack",
"(",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"tuple",
")",
":",
"return",
"value",
",",
"200",
",",
"{",
"}",
"try",
":",
"data",
",",
"code",
",",
"headers",
"=",
"value",
"return",
"data",
",",
"code",
... | Return a three tuple of data, code, and headers | [
"Return",
"a",
"three",
"tuple",
"of",
"data",
"code",
"and",
"headers"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/utils/__init__.py#L18-L35 | train | Return a three tuple of data code and headers | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | examples/xml_representation.py | output_xml | def output_xml(data, code, headers=None):
"""Makes a Flask response with a XML encoded body"""
resp = make_response(dumps({'response' :data}), code)
resp.headers.extend(headers or {})
return resp | python | def output_xml(data, code, headers=None):
"""Makes a Flask response with a XML encoded body"""
resp = make_response(dumps({'response' :data}), code)
resp.headers.extend(headers or {})
return resp | [
"def",
"output_xml",
"(",
"data",
",",
"code",
",",
"headers",
"=",
"None",
")",
":",
"resp",
"=",
"make_response",
"(",
"dumps",
"(",
"{",
"'response'",
":",
"data",
"}",
")",
",",
"code",
")",
"resp",
".",
"headers",
".",
"extend",
"(",
"headers",
... | Makes a Flask response with a XML encoded body | [
"Makes",
"a",
"Flask",
"response",
"with",
"a",
"XML",
"encoded",
"body"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/examples/xml_representation.py#L6-L10 | train | Makes a Flask response with a XML encoded body | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/representations/json.py | output_json | def output_json(data, code, headers=None):
"""Makes a Flask response with a JSON encoded body"""
settings = current_app.config.get('RESTFUL_JSON', {})
# If we're in debug mode, and the indent is not set, we set it to a
# reasonable value here. Note that this won't override any existing value
# th... | python | def output_json(data, code, headers=None):
"""Makes a Flask response with a JSON encoded body"""
settings = current_app.config.get('RESTFUL_JSON', {})
# If we're in debug mode, and the indent is not set, we set it to a
# reasonable value here. Note that this won't override any existing value
# th... | [
"def",
"output_json",
"(",
"data",
",",
"code",
",",
"headers",
"=",
"None",
")",
":",
"settings",
"=",
"current_app",
".",
"config",
".",
"get",
"(",
"'RESTFUL_JSON'",
",",
"{",
"}",
")",
"# If we're in debug mode, and the indent is not set, we set it to a",
"# r... | Makes a Flask response with a JSON encoded body | [
"Makes",
"a",
"Flask",
"response",
"with",
"a",
"JSON",
"encoded",
"body"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/representations/json.py#L7-L25 | train | Makes a Flask response with a JSON encoded body | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | abort | def abort(http_status_code, **kwargs):
"""Raise a HTTPException for the given http_status_code. Attach any keyword
arguments to the exception for later processing.
"""
#noinspection PyUnresolvedReferences
try:
original_flask_abort(http_status_code)
except HTTPException as e:
if l... | python | def abort(http_status_code, **kwargs):
"""Raise a HTTPException for the given http_status_code. Attach any keyword
arguments to the exception for later processing.
"""
#noinspection PyUnresolvedReferences
try:
original_flask_abort(http_status_code)
except HTTPException as e:
if l... | [
"def",
"abort",
"(",
"http_status_code",
",",
"*",
"*",
"kwargs",
")",
":",
"#noinspection PyUnresolvedReferences",
"try",
":",
"original_flask_abort",
"(",
"http_status_code",
")",
"except",
"HTTPException",
"as",
"e",
":",
"if",
"len",
"(",
"kwargs",
")",
":",... | Raise a HTTPException for the given http_status_code. Attach any keyword
arguments to the exception for later processing. | [
"Raise",
"a",
"HTTPException",
"for",
"the",
"given",
"http_status_code",
".",
"Attach",
"any",
"keyword",
"arguments",
"to",
"the",
"exception",
"for",
"later",
"processing",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L23-L33 | train | Raise a HTTPException for the given http_status_code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | marshal | def marshal(data, fields, envelope=None):
"""Takes raw data (in the form of a dict, list, object) and a dict of
fields to output and filters the data based on those fields.
:param data: the actual object(s) from which the fields are taken from
:param fields: a dict of whose keys will make up the final ... | python | def marshal(data, fields, envelope=None):
"""Takes raw data (in the form of a dict, list, object) and a dict of
fields to output and filters the data based on those fields.
:param data: the actual object(s) from which the fields are taken from
:param fields: a dict of whose keys will make up the final ... | [
"def",
"marshal",
"(",
"data",
",",
"fields",
",",
"envelope",
"=",
"None",
")",
":",
"def",
"make",
"(",
"cls",
")",
":",
"if",
"isinstance",
"(",
"cls",
",",
"type",
")",
":",
"return",
"cls",
"(",
")",
"return",
"cls",
"if",
"isinstance",
"(",
... | Takes raw data (in the form of a dict, list, object) and a dict of
fields to output and filters the data based on those fields.
:param data: the actual object(s) from which the fields are taken from
:param fields: a dict of whose keys will make up the final serialized
response output
... | [
"Takes",
"raw",
"data",
"(",
"in",
"the",
"form",
"of",
"a",
"dict",
"list",
"object",
")",
"and",
"a",
"dict",
"of",
"fields",
"to",
"output",
"and",
"filters",
"the",
"data",
"based",
"on",
"those",
"fields",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L591-L626 | train | Takes raw data and a dict of fields to output and filters the data based on those fields. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.init_app | def init_app(self, app):
"""Initialize this class with the given :class:`flask.Flask`
application or :class:`flask.Blueprint` object.
:param app: the Flask application or blueprint object
:type app: flask.Flask
:type app: flask.Blueprint
Examples::
api = Ap... | python | def init_app(self, app):
"""Initialize this class with the given :class:`flask.Flask`
application or :class:`flask.Blueprint` object.
:param app: the Flask application or blueprint object
:type app: flask.Flask
:type app: flask.Blueprint
Examples::
api = Ap... | [
"def",
"init_app",
"(",
"self",
",",
"app",
")",
":",
"# If app is a blueprint, defer the initialization",
"try",
":",
"app",
".",
"record",
"(",
"self",
".",
"_deferred_blueprint_init",
")",
"# Flask.Blueprint has a 'record' attribute, Flask.Api does not",
"except",
"Attri... | Initialize this class with the given :class:`flask.Flask`
application or :class:`flask.Blueprint` object.
:param app: the Flask application or blueprint object
:type app: flask.Flask
:type app: flask.Blueprint
Examples::
api = Api()
api.add_resource(...... | [
"Initialize",
"this",
"class",
"with",
"the",
"given",
":",
"class",
":",
"flask",
".",
"Flask",
"application",
"or",
":",
"class",
":",
"flask",
".",
"Blueprint",
"object",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L96-L118 | train | Initialize this class with the given Flask application or blueprint object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api._complete_url | def _complete_url(self, url_part, registration_prefix):
"""This method is used to defer the construction of the final url in
the case that the Api is created with a Blueprint.
:param url_part: The part of the url the endpoint is registered with
:param registration_prefix: The part of th... | python | def _complete_url(self, url_part, registration_prefix):
"""This method is used to defer the construction of the final url in
the case that the Api is created with a Blueprint.
:param url_part: The part of the url the endpoint is registered with
:param registration_prefix: The part of th... | [
"def",
"_complete_url",
"(",
"self",
",",
"url_part",
",",
"registration_prefix",
")",
":",
"parts",
"=",
"{",
"'b'",
":",
"registration_prefix",
",",
"'a'",
":",
"self",
".",
"prefix",
",",
"'e'",
":",
"url_part",
"}",
"return",
"''",
".",
"join",
"(",
... | This method is used to defer the construction of the final url in
the case that the Api is created with a Blueprint.
:param url_part: The part of the url the endpoint is registered with
:param registration_prefix: The part of the url contributed by the
blueprint. Generally speaking... | [
"This",
"method",
"is",
"used",
"to",
"defer",
"the",
"construction",
"of",
"the",
"final",
"url",
"in",
"the",
"case",
"that",
"the",
"Api",
"is",
"created",
"with",
"a",
"Blueprint",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L120-L133 | train | This method is used to complete the url for the Blueprint. It is used to complete the url for the Blueprint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api._init_app | def _init_app(self, app):
"""Perform initialization actions with the given :class:`flask.Flask`
object.
:param app: The flask application object
:type app: flask.Flask
"""
app.handle_exception = partial(self.error_router, app.handle_exception)
app.handle_user_exc... | python | def _init_app(self, app):
"""Perform initialization actions with the given :class:`flask.Flask`
object.
:param app: The flask application object
:type app: flask.Flask
"""
app.handle_exception = partial(self.error_router, app.handle_exception)
app.handle_user_exc... | [
"def",
"_init_app",
"(",
"self",
",",
"app",
")",
":",
"app",
".",
"handle_exception",
"=",
"partial",
"(",
"self",
".",
"error_router",
",",
"app",
".",
"handle_exception",
")",
"app",
".",
"handle_user_exception",
"=",
"partial",
"(",
"self",
".",
"error... | Perform initialization actions with the given :class:`flask.Flask`
object.
:param app: The flask application object
:type app: flask.Flask | [
"Perform",
"initialization",
"actions",
"with",
"the",
"given",
":",
"class",
":",
"flask",
".",
"Flask",
"object",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L186-L198 | train | Perform initialization actions with the given flask. Flask object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.owns_endpoint | def owns_endpoint(self, endpoint):
"""Tests if an endpoint name (not path) belongs to this Api. Takes
in to account the Blueprint name part of the endpoint name.
:param endpoint: The name of the endpoint being checked
:return: bool
"""
if self.blueprint:
if... | python | def owns_endpoint(self, endpoint):
"""Tests if an endpoint name (not path) belongs to this Api. Takes
in to account the Blueprint name part of the endpoint name.
:param endpoint: The name of the endpoint being checked
:return: bool
"""
if self.blueprint:
if... | [
"def",
"owns_endpoint",
"(",
"self",
",",
"endpoint",
")",
":",
"if",
"self",
".",
"blueprint",
":",
"if",
"endpoint",
".",
"startswith",
"(",
"self",
".",
"blueprint",
".",
"name",
")",
":",
"endpoint",
"=",
"endpoint",
".",
"split",
"(",
"self",
".",... | Tests if an endpoint name (not path) belongs to this Api. Takes
in to account the Blueprint name part of the endpoint name.
:param endpoint: The name of the endpoint being checked
:return: bool | [
"Tests",
"if",
"an",
"endpoint",
"name",
"(",
"not",
"path",
")",
"belongs",
"to",
"this",
"Api",
".",
"Takes",
"in",
"to",
"account",
"the",
"Blueprint",
"name",
"part",
"of",
"the",
"endpoint",
"name",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L200-L213 | train | Tests if an endpoint name belongs to this Api. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api._should_use_fr_error_handler | def _should_use_fr_error_handler(self):
""" Determine if error should be handled with FR or default Flask
The goal is to return Flask error handlers for non-FR-related routes,
and FR errors (with the correct media type) for FR endpoints. This
method currently handles 404 and 405 errors.... | python | def _should_use_fr_error_handler(self):
""" Determine if error should be handled with FR or default Flask
The goal is to return Flask error handlers for non-FR-related routes,
and FR errors (with the correct media type) for FR endpoints. This
method currently handles 404 and 405 errors.... | [
"def",
"_should_use_fr_error_handler",
"(",
"self",
")",
":",
"adapter",
"=",
"current_app",
".",
"create_url_adapter",
"(",
"request",
")",
"try",
":",
"adapter",
".",
"match",
"(",
")",
"except",
"MethodNotAllowed",
"as",
"e",
":",
"# Check if the other HTTP met... | Determine if error should be handled with FR or default Flask
The goal is to return Flask error handlers for non-FR-related routes,
and FR errors (with the correct media type) for FR endpoints. This
method currently handles 404 and 405 errors.
:return: bool | [
"Determine",
"if",
"error",
"should",
"be",
"handled",
"with",
"FR",
"or",
"default",
"Flask"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L215-L237 | train | Determine if error should be handled with FR or default Flask
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api._has_fr_route | def _has_fr_route(self):
"""Encapsulating the rules for whether the request was to a Flask endpoint"""
# 404's, 405's, which might not have a url_rule
if self._should_use_fr_error_handler():
return True
# for all other errors, just check if FR dispatched the route
if ... | python | def _has_fr_route(self):
"""Encapsulating the rules for whether the request was to a Flask endpoint"""
# 404's, 405's, which might not have a url_rule
if self._should_use_fr_error_handler():
return True
# for all other errors, just check if FR dispatched the route
if ... | [
"def",
"_has_fr_route",
"(",
"self",
")",
":",
"# 404's, 405's, which might not have a url_rule",
"if",
"self",
".",
"_should_use_fr_error_handler",
"(",
")",
":",
"return",
"True",
"# for all other errors, just check if FR dispatched the route",
"if",
"not",
"request",
".",
... | Encapsulating the rules for whether the request was to a Flask endpoint | [
"Encapsulating",
"the",
"rules",
"for",
"whether",
"the",
"request",
"was",
"to",
"a",
"Flask",
"endpoint"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L239-L247 | train | Returns True if the request was to a Flask endpoint False otherwise. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.error_router | def error_router(self, original_handler, e):
"""This function decides whether the error occured in a flask-restful
endpoint or not. If it happened in a flask-restful endpoint, our
handler will be dispatched. If it happened in an unrelated view, the
app's original error handler will be di... | python | def error_router(self, original_handler, e):
"""This function decides whether the error occured in a flask-restful
endpoint or not. If it happened in a flask-restful endpoint, our
handler will be dispatched. If it happened in an unrelated view, the
app's original error handler will be di... | [
"def",
"error_router",
"(",
"self",
",",
"original_handler",
",",
"e",
")",
":",
"if",
"self",
".",
"_has_fr_route",
"(",
")",
":",
"try",
":",
"return",
"self",
".",
"handle_error",
"(",
"e",
")",
"except",
"Exception",
":",
"pass",
"# Fall through to ori... | This function decides whether the error occured in a flask-restful
endpoint or not. If it happened in a flask-restful endpoint, our
handler will be dispatched. If it happened in an unrelated view, the
app's original error handler will be dispatched.
In the event that the error occurred i... | [
"This",
"function",
"decides",
"whether",
"the",
"error",
"occured",
"in",
"a",
"flask",
"-",
"restful",
"endpoint",
"or",
"not",
".",
"If",
"it",
"happened",
"in",
"a",
"flask",
"-",
"restful",
"endpoint",
"our",
"handler",
"will",
"be",
"dispatched",
"."... | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L249-L269 | train | This function decides whether the error occured in a flask - restful endpoint or not. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.handle_error | def handle_error(self, e):
"""Error handler for the API transforms a raised exception into a Flask
response, with the appropriate HTTP status code and body.
:param e: the raised Exception object
:type e: Exception
"""
got_request_exception.send(current_app._get_current_... | python | def handle_error(self, e):
"""Error handler for the API transforms a raised exception into a Flask
response, with the appropriate HTTP status code and body.
:param e: the raised Exception object
:type e: Exception
"""
got_request_exception.send(current_app._get_current_... | [
"def",
"handle_error",
"(",
"self",
",",
"e",
")",
":",
"got_request_exception",
".",
"send",
"(",
"current_app",
".",
"_get_current_object",
"(",
")",
",",
"exception",
"=",
"e",
")",
"if",
"not",
"isinstance",
"(",
"e",
",",
"HTTPException",
")",
"and",
... | Error handler for the API transforms a raised exception into a Flask
response, with the appropriate HTTP status code and body.
:param e: the raised Exception object
:type e: Exception | [
"Error",
"handler",
"for",
"the",
"API",
"transforms",
"a",
"raised",
"exception",
"into",
"a",
"Flask",
"response",
"with",
"the",
"appropriate",
"HTTP",
"status",
"code",
"and",
"body",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L271-L341 | train | This method handles an error raised by the API. It handles the exception and returns a Flask
instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.add_resource | def add_resource(self, resource, *urls, **kwargs):
"""Adds a resource to the api.
:param resource: the class name of your resource
:type resource: :class:`Type[Resource]`
:param urls: one or more url routes to match for the resource, standard
flask routing rules ap... | python | def add_resource(self, resource, *urls, **kwargs):
"""Adds a resource to the api.
:param resource: the class name of your resource
:type resource: :class:`Type[Resource]`
:param urls: one or more url routes to match for the resource, standard
flask routing rules ap... | [
"def",
"add_resource",
"(",
"self",
",",
"resource",
",",
"*",
"urls",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"app",
"is",
"not",
"None",
":",
"self",
".",
"_register_view",
"(",
"self",
".",
"app",
",",
"resource",
",",
"*",
"urls",... | Adds a resource to the api.
:param resource: the class name of your resource
:type resource: :class:`Type[Resource]`
:param urls: one or more url routes to match for the resource, standard
flask routing rules apply. Any url variables will be
passed to... | [
"Adds",
"a",
"resource",
"to",
"the",
"api",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L348-L384 | train | Adds a resource to the api. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.resource | def resource(self, *urls, **kwargs):
"""Wraps a :class:`~flask_restful.Resource` class, adding it to the
api. Parameters are the same as :meth:`~flask_restful.Api.add_resource`.
Example::
app = Flask(__name__)
api = restful.Api(app)
@api.resource('/foo')
... | python | def resource(self, *urls, **kwargs):
"""Wraps a :class:`~flask_restful.Resource` class, adding it to the
api. Parameters are the same as :meth:`~flask_restful.Api.add_resource`.
Example::
app = Flask(__name__)
api = restful.Api(app)
@api.resource('/foo')
... | [
"def",
"resource",
"(",
"self",
",",
"*",
"urls",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"decorator",
"(",
"cls",
")",
":",
"self",
".",
"add_resource",
"(",
"cls",
",",
"*",
"urls",
",",
"*",
"*",
"kwargs",
")",
"return",
"cls",
"return",
"de... | Wraps a :class:`~flask_restful.Resource` class, adding it to the
api. Parameters are the same as :meth:`~flask_restful.Api.add_resource`.
Example::
app = Flask(__name__)
api = restful.Api(app)
@api.resource('/foo')
class Foo(Resource):
d... | [
"Wraps",
"a",
":",
"class",
":",
"~flask_restful",
".",
"Resource",
"class",
"adding",
"it",
"to",
"the",
"api",
".",
"Parameters",
"are",
"the",
"same",
"as",
":",
"meth",
":",
"~flask_restful",
".",
"Api",
".",
"add_resource",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L386-L404 | train | A decorator that creates a class that adds it to the the
api. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.output | def output(self, resource):
"""Wraps a resource (as a flask view function), for cases where the
resource does not directly return a response object
:param resource: The resource as a flask view function
"""
@wraps(resource)
def wrapper(*args, **kwargs):
resp ... | python | def output(self, resource):
"""Wraps a resource (as a flask view function), for cases where the
resource does not directly return a response object
:param resource: The resource as a flask view function
"""
@wraps(resource)
def wrapper(*args, **kwargs):
resp ... | [
"def",
"output",
"(",
"self",
",",
"resource",
")",
":",
"@",
"wraps",
"(",
"resource",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"resp",
"=",
"resource",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"... | Wraps a resource (as a flask view function), for cases where the
resource does not directly return a response object
:param resource: The resource as a flask view function | [
"Wraps",
"a",
"resource",
"(",
"as",
"a",
"flask",
"view",
"function",
")",
"for",
"cases",
"where",
"the",
"resource",
"does",
"not",
"directly",
"return",
"a",
"response",
"object"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L450-L463 | train | Wraps a resource function to return a response object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.url_for | def url_for(self, resource, **values):
"""Generates a URL to the given resource.
Works like :func:`flask.url_for`."""
endpoint = resource.endpoint
if self.blueprint:
endpoint = '{0}.{1}'.format(self.blueprint.name, endpoint)
return url_for(endpoint, **values) | python | def url_for(self, resource, **values):
"""Generates a URL to the given resource.
Works like :func:`flask.url_for`."""
endpoint = resource.endpoint
if self.blueprint:
endpoint = '{0}.{1}'.format(self.blueprint.name, endpoint)
return url_for(endpoint, **values) | [
"def",
"url_for",
"(",
"self",
",",
"resource",
",",
"*",
"*",
"values",
")",
":",
"endpoint",
"=",
"resource",
".",
"endpoint",
"if",
"self",
".",
"blueprint",
":",
"endpoint",
"=",
"'{0}.{1}'",
".",
"format",
"(",
"self",
".",
"blueprint",
".",
"name... | Generates a URL to the given resource.
Works like :func:`flask.url_for`. | [
"Generates",
"a",
"URL",
"to",
"the",
"given",
"resource",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L465-L472 | train | Generates a URL to the given resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.make_response | def make_response(self, data, *args, **kwargs):
"""Looks up the representation transformer for the requested media
type, invoking the transformer to create a response object. This
defaults to default_mediatype if no transformer is found for the
requested mediatype. If default_mediatype i... | python | def make_response(self, data, *args, **kwargs):
"""Looks up the representation transformer for the requested media
type, invoking the transformer to create a response object. This
defaults to default_mediatype if no transformer is found for the
requested mediatype. If default_mediatype i... | [
"def",
"make_response",
"(",
"self",
",",
"data",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"default_mediatype",
"=",
"kwargs",
".",
"pop",
"(",
"'fallback_mediatype'",
",",
"None",
")",
"or",
"self",
".",
"default_mediatype",
"mediatype",
"=",
... | Looks up the representation transformer for the requested media
type, invoking the transformer to create a response object. This
defaults to default_mediatype if no transformer is found for the
requested mediatype. If default_mediatype is None, a 406 Not
Acceptable response will be sent ... | [
"Looks",
"up",
"the",
"representation",
"transformer",
"for",
"the",
"requested",
"media",
"type",
"invoking",
"the",
"transformer",
"to",
"create",
"a",
"response",
"object",
".",
"This",
"defaults",
"to",
"default_mediatype",
"if",
"no",
"transformer",
"is",
"... | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L474-L499 | train | Creates a response object for the requested media - level - related resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.mediatypes | def mediatypes(self):
"""Returns a list of requested mediatypes sent in the Accept header"""
return [h for h, q in sorted(request.accept_mimetypes,
key=operator.itemgetter(1), reverse=True)] | python | def mediatypes(self):
"""Returns a list of requested mediatypes sent in the Accept header"""
return [h for h, q in sorted(request.accept_mimetypes,
key=operator.itemgetter(1), reverse=True)] | [
"def",
"mediatypes",
"(",
"self",
")",
":",
"return",
"[",
"h",
"for",
"h",
",",
"q",
"in",
"sorted",
"(",
"request",
".",
"accept_mimetypes",
",",
"key",
"=",
"operator",
".",
"itemgetter",
"(",
"1",
")",
",",
"reverse",
"=",
"True",
")",
"]"
] | Returns a list of requested mediatypes sent in the Accept header | [
"Returns",
"a",
"list",
"of",
"requested",
"mediatypes",
"sent",
"in",
"the",
"Accept",
"header"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L501-L504 | train | Returns a list of requested mediatypes sent in the Accept header | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/__init__.py | Api.representation | def representation(self, mediatype):
"""Allows additional representation transformers to be declared for the
api. Transformers are functions that must be decorated with this
method, passing the mediatype the transformer represents. Three
arguments are passed to the transformer:
... | python | def representation(self, mediatype):
"""Allows additional representation transformers to be declared for the
api. Transformers are functions that must be decorated with this
method, passing the mediatype the transformer represents. Three
arguments are passed to the transformer:
... | [
"def",
"representation",
"(",
"self",
",",
"mediatype",
")",
":",
"def",
"wrapper",
"(",
"func",
")",
":",
"self",
".",
"representations",
"[",
"mediatype",
"]",
"=",
"func",
"return",
"func",
"return",
"wrapper"
] | Allows additional representation transformers to be declared for the
api. Transformers are functions that must be decorated with this
method, passing the mediatype the transformer represents. Three
arguments are passed to the transformer:
* The data to be represented in the response bod... | [
"Allows",
"additional",
"representation",
"transformers",
"to",
"be",
"declared",
"for",
"the",
"api",
".",
"Transformers",
"are",
"functions",
"that",
"must",
"be",
"decorated",
"with",
"this",
"method",
"passing",
"the",
"mediatype",
"the",
"transformer",
"repre... | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/__init__.py#L506-L530 | train | Decorator for the API representation | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | Argument.source | def source(self, request):
"""Pulls values off the request in the provided location
:param request: The flask request object to parse arguments from
"""
if isinstance(self.location, six.string_types):
value = getattr(request, self.location, MultiDict())
if callabl... | python | def source(self, request):
"""Pulls values off the request in the provided location
:param request: The flask request object to parse arguments from
"""
if isinstance(self.location, six.string_types):
value = getattr(request, self.location, MultiDict())
if callabl... | [
"def",
"source",
"(",
"self",
",",
"request",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"location",
",",
"six",
".",
"string_types",
")",
":",
"value",
"=",
"getattr",
"(",
"request",
",",
"self",
".",
"location",
",",
"MultiDict",
"(",
")",
")... | Pulls values off the request in the provided location
:param request: The flask request object to parse arguments from | [
"Pulls",
"values",
"off",
"the",
"request",
"in",
"the",
"provided",
"location",
":",
"param",
"request",
":",
"The",
"flask",
"request",
"object",
"to",
"parse",
"arguments",
"from"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L109-L129 | train | Pulls values off the request in the provided location
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | Argument.handle_validation_error | def handle_validation_error(self, error, bundle_errors):
"""Called when an error is raised while parsing. Aborts the request
with a 400 status and an error message
:param error: the error that was raised
:param bundle_errors: do not abort when first error occurs, return a
di... | python | def handle_validation_error(self, error, bundle_errors):
"""Called when an error is raised while parsing. Aborts the request
with a 400 status and an error message
:param error: the error that was raised
:param bundle_errors: do not abort when first error occurs, return a
di... | [
"def",
"handle_validation_error",
"(",
"self",
",",
"error",
",",
"bundle_errors",
")",
":",
"error_str",
"=",
"six",
".",
"text_type",
"(",
"error",
")",
"error_msg",
"=",
"self",
".",
"help",
".",
"format",
"(",
"error_msg",
"=",
"error_str",
")",
"if",
... | Called when an error is raised while parsing. Aborts the request
with a 400 status and an error message
:param error: the error that was raised
:param bundle_errors: do not abort when first error occurs, return a
dict with the name of the argument and the error message to be
... | [
"Called",
"when",
"an",
"error",
"is",
"raised",
"while",
"parsing",
".",
"Aborts",
"the",
"request",
"with",
"a",
"400",
"status",
"and",
"an",
"error",
"message"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L155-L170 | train | Called when an error occurs while parsing the a
dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | Argument.parse | def parse(self, request, bundle_errors=False):
"""Parses argument value(s) from the request, converting according to
the argument's type.
:param request: The flask request object to parse arguments from
:param bundle_errors: Do not abort when first error occurs, return a
dic... | python | def parse(self, request, bundle_errors=False):
"""Parses argument value(s) from the request, converting according to
the argument's type.
:param request: The flask request object to parse arguments from
:param bundle_errors: Do not abort when first error occurs, return a
dic... | [
"def",
"parse",
"(",
"self",
",",
"request",
",",
"bundle_errors",
"=",
"False",
")",
":",
"source",
"=",
"self",
".",
"source",
"(",
"request",
")",
"results",
"=",
"[",
"]",
"# Sentinels",
"_not_found",
"=",
"False",
"_found",
"=",
"True",
"for",
"op... | Parses argument value(s) from the request, converting according to
the argument's type.
:param request: The flask request object to parse arguments from
:param bundle_errors: Do not abort when first error occurs, return a
dict with the name of the argument and the error message to b... | [
"Parses",
"argument",
"value",
"(",
"s",
")",
"from",
"the",
"request",
"converting",
"according",
"to",
"the",
"argument",
"s",
"type",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L172-L256 | train | Parses the argument value from the request and returns a list of a
objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | RequestParser.add_argument | def add_argument(self, *args, **kwargs):
"""Adds an argument to be parsed.
Accepts either a single instance of Argument or arguments to be passed
into :class:`Argument`'s constructor.
See :class:`Argument`'s constructor for documentation on the
available options.
"""
... | python | def add_argument(self, *args, **kwargs):
"""Adds an argument to be parsed.
Accepts either a single instance of Argument or arguments to be passed
into :class:`Argument`'s constructor.
See :class:`Argument`'s constructor for documentation on the
available options.
"""
... | [
"def",
"add_argument",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"args",
")",
"==",
"1",
"and",
"isinstance",
"(",
"args",
"[",
"0",
"]",
",",
"self",
".",
"argument_class",
")",
":",
"self",
".",
"args",... | Adds an argument to be parsed.
Accepts either a single instance of Argument or arguments to be passed
into :class:`Argument`'s constructor.
See :class:`Argument`'s constructor for documentation on the
available options. | [
"Adds",
"an",
"argument",
"to",
"be",
"parsed",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L285-L305 | train | Adds an argument to be parsed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | RequestParser.parse_args | def parse_args(self, req=None, strict=False, http_error_code=400):
"""Parse all arguments from the provided request and return the results
as a Namespace
:param req: Can be used to overwrite request from Flask
:param strict: if req includes args not in parser, throw 400 BadRequest excep... | python | def parse_args(self, req=None, strict=False, http_error_code=400):
"""Parse all arguments from the provided request and return the results
as a Namespace
:param req: Can be used to overwrite request from Flask
:param strict: if req includes args not in parser, throw 400 BadRequest excep... | [
"def",
"parse_args",
"(",
"self",
",",
"req",
"=",
"None",
",",
"strict",
"=",
"False",
",",
"http_error_code",
"=",
"400",
")",
":",
"if",
"req",
"is",
"None",
":",
"req",
"=",
"request",
"namespace",
"=",
"self",
".",
"namespace_class",
"(",
")",
"... | Parse all arguments from the provided request and return the results
as a Namespace
:param req: Can be used to overwrite request from Flask
:param strict: if req includes args not in parser, throw 400 BadRequest exception
:param http_error_code: use custom error code for `flask_restful.... | [
"Parse",
"all",
"arguments",
"from",
"the",
"provided",
"request",
"and",
"return",
"the",
"results",
"as",
"a",
"Namespace"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L307-L338 | train | Parse all arguments from the provided request and return the results
as a Namespace object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | RequestParser.copy | def copy(self):
""" Creates a copy of this RequestParser with the same set of arguments """
parser_copy = self.__class__(self.argument_class, self.namespace_class)
parser_copy.args = deepcopy(self.args)
parser_copy.trim = self.trim
parser_copy.bundle_errors = self.bundle_errors
... | python | def copy(self):
""" Creates a copy of this RequestParser with the same set of arguments """
parser_copy = self.__class__(self.argument_class, self.namespace_class)
parser_copy.args = deepcopy(self.args)
parser_copy.trim = self.trim
parser_copy.bundle_errors = self.bundle_errors
... | [
"def",
"copy",
"(",
"self",
")",
":",
"parser_copy",
"=",
"self",
".",
"__class__",
"(",
"self",
".",
"argument_class",
",",
"self",
".",
"namespace_class",
")",
"parser_copy",
".",
"args",
"=",
"deepcopy",
"(",
"self",
".",
"args",
")",
"parser_copy",
"... | Creates a copy of this RequestParser with the same set of arguments | [
"Creates",
"a",
"copy",
"of",
"this",
"RequestParser",
"with",
"the",
"same",
"set",
"of",
"arguments"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L340-L346 | train | Creates a copy of this RequestParser with the same set of arguments | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | RequestParser.replace_argument | def replace_argument(self, name, *args, **kwargs):
""" Replace the argument matching the given name with a new version. """
new_arg = self.argument_class(name, *args, **kwargs)
for index, arg in enumerate(self.args[:]):
if new_arg.name == arg.name:
del self.args[index... | python | def replace_argument(self, name, *args, **kwargs):
""" Replace the argument matching the given name with a new version. """
new_arg = self.argument_class(name, *args, **kwargs)
for index, arg in enumerate(self.args[:]):
if new_arg.name == arg.name:
del self.args[index... | [
"def",
"replace_argument",
"(",
"self",
",",
"name",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"new_arg",
"=",
"self",
".",
"argument_class",
"(",
"name",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"for",
"index",
",",
"arg",
"in",
... | Replace the argument matching the given name with a new version. | [
"Replace",
"the",
"argument",
"matching",
"the",
"given",
"name",
"with",
"a",
"new",
"version",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L348-L356 | train | Replace the argument matching the given name with a new version. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/reqparse.py | RequestParser.remove_argument | def remove_argument(self, name):
""" Remove the argument matching the given name. """
for index, arg in enumerate(self.args[:]):
if name == arg.name:
del self.args[index]
break
return self | python | def remove_argument(self, name):
""" Remove the argument matching the given name. """
for index, arg in enumerate(self.args[:]):
if name == arg.name:
del self.args[index]
break
return self | [
"def",
"remove_argument",
"(",
"self",
",",
"name",
")",
":",
"for",
"index",
",",
"arg",
"in",
"enumerate",
"(",
"self",
".",
"args",
"[",
":",
"]",
")",
":",
"if",
"name",
"==",
"arg",
".",
"name",
":",
"del",
"self",
".",
"args",
"[",
"index",... | Remove the argument matching the given name. | [
"Remove",
"the",
"argument",
"matching",
"the",
"given",
"name",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/reqparse.py#L358-L364 | train | Removes the argument matching the given name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/fields.py | to_marshallable_type | def to_marshallable_type(obj):
"""Helper for converting an object to a dictionary only if it is not
dictionary already or an indexable object nor a simple type"""
if obj is None:
return None # make it idempotent for None
if hasattr(obj, '__marshallable__'):
return obj.__marshallable__(... | python | def to_marshallable_type(obj):
"""Helper for converting an object to a dictionary only if it is not
dictionary already or an indexable object nor a simple type"""
if obj is None:
return None # make it idempotent for None
if hasattr(obj, '__marshallable__'):
return obj.__marshallable__(... | [
"def",
"to_marshallable_type",
"(",
"obj",
")",
":",
"if",
"obj",
"is",
"None",
":",
"return",
"None",
"# make it idempotent for None",
"if",
"hasattr",
"(",
"obj",
",",
"'__marshallable__'",
")",
":",
"return",
"obj",
".",
"__marshallable__",
"(",
")",
"if",
... | Helper for converting an object to a dictionary only if it is not
dictionary already or an indexable object nor a simple type | [
"Helper",
"for",
"converting",
"an",
"object",
"to",
"a",
"dictionary",
"only",
"if",
"it",
"is",
"not",
"dictionary",
"already",
"or",
"an",
"indexable",
"object",
"nor",
"a",
"simple",
"type"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/fields.py#L63-L75 | train | Helper for converting an object to a dictionary only if it is not indexable or a simple type | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/fields.py | Raw.output | def output(self, key, obj):
"""Pulls the value for the given key from the object, applies the
field's formatting and returns the result. If the key is not found
in the object, returns the default value. Field classes that create
values which do not require the existence of the key in the... | python | def output(self, key, obj):
"""Pulls the value for the given key from the object, applies the
field's formatting and returns the result. If the key is not found
in the object, returns the default value. Field classes that create
values which do not require the existence of the key in the... | [
"def",
"output",
"(",
"self",
",",
"key",
",",
"obj",
")",
":",
"value",
"=",
"get_value",
"(",
"key",
"if",
"self",
".",
"attribute",
"is",
"None",
"else",
"self",
".",
"attribute",
",",
"obj",
")",
"if",
"value",
"is",
"None",
":",
"return",
"sel... | Pulls the value for the given key from the object, applies the
field's formatting and returns the result. If the key is not found
in the object, returns the default value. Field classes that create
values which do not require the existence of the key in the object
should override this an... | [
"Pulls",
"the",
"value",
"for",
"the",
"given",
"key",
"from",
"the",
"object",
"applies",
"the",
"field",
"s",
"formatting",
"and",
"returns",
"the",
"result",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"the",
"object",
"returns",
"the",
"defa... | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/fields.py#L111-L126 | train | Returns the value for the given key from the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/inputs.py | url | def url(value):
"""Validate a URL.
:param string value: The URL to validate
:returns: The URL if valid.
:raises: ValueError
"""
if not url_regex.search(value):
message = u"{0} is not a valid URL".format(value)
if url_regex.search('http://' + value):
message += u". Di... | python | def url(value):
"""Validate a URL.
:param string value: The URL to validate
:returns: The URL if valid.
:raises: ValueError
"""
if not url_regex.search(value):
message = u"{0} is not a valid URL".format(value)
if url_regex.search('http://' + value):
message += u". Di... | [
"def",
"url",
"(",
"value",
")",
":",
"if",
"not",
"url_regex",
".",
"search",
"(",
"value",
")",
":",
"message",
"=",
"u\"{0} is not a valid URL\"",
".",
"format",
"(",
"value",
")",
"if",
"url_regex",
".",
"search",
"(",
"'http://'",
"+",
"value",
")",... | Validate a URL.
:param string value: The URL to validate
:returns: The URL if valid.
:raises: ValueError | [
"Validate",
"a",
"URL",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/inputs.py#L28-L40 | train | Validate a URL. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/inputs.py | _normalize_interval | def _normalize_interval(start, end, value):
"""Normalize datetime intervals.
Given a pair of datetime.date or datetime.datetime objects,
returns a 2-tuple of tz-aware UTC datetimes spanning the same interval.
For datetime.date objects, the returned interval starts at 00:00:00.0
on the first date a... | python | def _normalize_interval(start, end, value):
"""Normalize datetime intervals.
Given a pair of datetime.date or datetime.datetime objects,
returns a 2-tuple of tz-aware UTC datetimes spanning the same interval.
For datetime.date objects, the returned interval starts at 00:00:00.0
on the first date a... | [
"def",
"_normalize_interval",
"(",
"start",
",",
"end",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"start",
",",
"datetime",
")",
":",
"start",
"=",
"datetime",
".",
"combine",
"(",
"start",
",",
"START_OF_DAY",
")",
"end",
"=",
"datetime",
... | Normalize datetime intervals.
Given a pair of datetime.date or datetime.datetime objects,
returns a 2-tuple of tz-aware UTC datetimes spanning the same interval.
For datetime.date objects, the returned interval starts at 00:00:00.0
on the first date and ends at 00:00:00.0 on the second.
Naive dat... | [
"Normalize",
"datetime",
"intervals",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/inputs.py#L74-L102 | train | Normalizes datetime intervals. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/inputs.py | _parse_interval | def _parse_interval(value):
"""Do some nasty try/except voodoo to get some sort of datetime
object(s) out of the string.
"""
try:
return sorted(aniso8601.parse_interval(value))
except ValueError:
try:
return aniso8601.parse_datetime(value), None
except ValueError:... | python | def _parse_interval(value):
"""Do some nasty try/except voodoo to get some sort of datetime
object(s) out of the string.
"""
try:
return sorted(aniso8601.parse_interval(value))
except ValueError:
try:
return aniso8601.parse_datetime(value), None
except ValueError:... | [
"def",
"_parse_interval",
"(",
"value",
")",
":",
"try",
":",
"return",
"sorted",
"(",
"aniso8601",
".",
"parse_interval",
"(",
"value",
")",
")",
"except",
"ValueError",
":",
"try",
":",
"return",
"aniso8601",
".",
"parse_datetime",
"(",
"value",
")",
","... | Do some nasty try/except voodoo to get some sort of datetime
object(s) out of the string. | [
"Do",
"some",
"nasty",
"try",
"/",
"except",
"voodoo",
"to",
"get",
"some",
"sort",
"of",
"datetime",
"object",
"(",
"s",
")",
"out",
"of",
"the",
"string",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/inputs.py#L129-L139 | train | Try to parse an interval from a string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/inputs.py | iso8601interval | def iso8601interval(value, argument='argument'):
"""Parses ISO 8601-formatted datetime intervals into tuples of datetimes.
Accepts both a single date(time) or a full interval using either start/end
or start/duration notation, with the following behavior:
- Intervals are defined as inclusive start, exc... | python | def iso8601interval(value, argument='argument'):
"""Parses ISO 8601-formatted datetime intervals into tuples of datetimes.
Accepts both a single date(time) or a full interval using either start/end
or start/duration notation, with the following behavior:
- Intervals are defined as inclusive start, exc... | [
"def",
"iso8601interval",
"(",
"value",
",",
"argument",
"=",
"'argument'",
")",
":",
"try",
":",
"start",
",",
"end",
"=",
"_parse_interval",
"(",
"value",
")",
"if",
"end",
"is",
"None",
":",
"end",
"=",
"_expand_datetime",
"(",
"start",
",",
"value",
... | Parses ISO 8601-formatted datetime intervals into tuples of datetimes.
Accepts both a single date(time) or a full interval using either start/end
or start/duration notation, with the following behavior:
- Intervals are defined as inclusive start, exclusive end
- Single datetimes are translated into th... | [
"Parses",
"ISO",
"8601",
"-",
"formatted",
"datetime",
"intervals",
"into",
"tuples",
"of",
"datetimes",
"."
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/inputs.py#L142-L184 | train | Parses ISO 8601 - formatted datetime intervals into two UTC datetimes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/inputs.py | natural | def natural(value, argument='argument'):
""" Restrict input type to the natural numbers (0, 1, 2, 3...) """
value = _get_integer(value)
if value < 0:
error = ('Invalid {arg}: {value}. {arg} must be a non-negative '
'integer'.format(arg=argument, value=value))
raise ValueErro... | python | def natural(value, argument='argument'):
""" Restrict input type to the natural numbers (0, 1, 2, 3...) """
value = _get_integer(value)
if value < 0:
error = ('Invalid {arg}: {value}. {arg} must be a non-negative '
'integer'.format(arg=argument, value=value))
raise ValueErro... | [
"def",
"natural",
"(",
"value",
",",
"argument",
"=",
"'argument'",
")",
":",
"value",
"=",
"_get_integer",
"(",
"value",
")",
"if",
"value",
"<",
"0",
":",
"error",
"=",
"(",
"'Invalid {arg}: {value}. {arg} must be a non-negative '",
"'integer'",
".",
"format",... | Restrict input type to the natural numbers (0, 1, 2, 3...) | [
"Restrict",
"input",
"type",
"to",
"the",
"natural",
"numbers",
"(",
"0",
"1",
"2",
"3",
"...",
")"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/inputs.py#L200-L207 | train | Restrict input type to the natural numbers 0 1 2 3 etc. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/inputs.py | positive | def positive(value, argument='argument'):
""" Restrict input type to the positive integers (1, 2, 3...) """
value = _get_integer(value)
if value < 1:
error = ('Invalid {arg}: {value}. {arg} must be a positive '
'integer'.format(arg=argument, value=value))
raise ValueError(er... | python | def positive(value, argument='argument'):
""" Restrict input type to the positive integers (1, 2, 3...) """
value = _get_integer(value)
if value < 1:
error = ('Invalid {arg}: {value}. {arg} must be a positive '
'integer'.format(arg=argument, value=value))
raise ValueError(er... | [
"def",
"positive",
"(",
"value",
",",
"argument",
"=",
"'argument'",
")",
":",
"value",
"=",
"_get_integer",
"(",
"value",
")",
"if",
"value",
"<",
"1",
":",
"error",
"=",
"(",
"'Invalid {arg}: {value}. {arg} must be a positive '",
"'integer'",
".",
"format",
... | Restrict input type to the positive integers (1, 2, 3...) | [
"Restrict",
"input",
"type",
"to",
"the",
"positive",
"integers",
"(",
"1",
"2",
"3",
"...",
")"
] | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/inputs.py#L210-L217 | train | Restrict input type to the positive integers 1 2 3 etc. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
flask-restful/flask-restful | flask_restful/inputs.py | boolean | def boolean(value):
"""Parse the string ``"true"`` or ``"false"`` as a boolean (case
insensitive). Also accepts ``"1"`` and ``"0"`` as ``True``/``False``
(respectively). If the input is from the request JSON body, the type is
already a native python boolean, and will be passed through without
furthe... | python | def boolean(value):
"""Parse the string ``"true"`` or ``"false"`` as a boolean (case
insensitive). Also accepts ``"1"`` and ``"0"`` as ``True``/``False``
(respectively). If the input is from the request JSON body, the type is
already a native python boolean, and will be passed through without
furthe... | [
"def",
"boolean",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"bool",
")",
":",
"return",
"value",
"if",
"not",
"value",
":",
"raise",
"ValueError",
"(",
"\"boolean type must be non-null\"",
")",
"value",
"=",
"value",
".",
"lower",
"(",... | Parse the string ``"true"`` or ``"false"`` as a boolean (case
insensitive). Also accepts ``"1"`` and ``"0"`` as ``True``/``False``
(respectively). If the input is from the request JSON body, the type is
already a native python boolean, and will be passed through without
further parsing. | [
"Parse",
"the",
"string",
"true",
"or",
"false",
"as",
"a",
"boolean",
"(",
"case",
"insensitive",
")",
".",
"Also",
"accepts",
"1",
"and",
"0",
"as",
"True",
"/",
"False",
"(",
"respectively",
")",
".",
"If",
"the",
"input",
"is",
"from",
"the",
"re... | 25544d697c1f82bafbd1320960df459f58a58e03 | https://github.com/flask-restful/flask-restful/blob/25544d697c1f82bafbd1320960df459f58a58e03/flask_restful/inputs.py#L237-L254 | train | Parse the string true or false as a boolean. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_osx.py | _specialKeyEvent | def _specialKeyEvent(key, upDown):
""" Helper method for special keys.
Source: http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac
"""
assert upDown in ('up', 'down'), "upDown argument must be 'up' or 'down'"
key_code = special_key_translate_table[key]
ev = AppKit.NSEve... | python | def _specialKeyEvent(key, upDown):
""" Helper method for special keys.
Source: http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac
"""
assert upDown in ('up', 'down'), "upDown argument must be 'up' or 'down'"
key_code = special_key_translate_table[key]
ev = AppKit.NSEve... | [
"def",
"_specialKeyEvent",
"(",
"key",
",",
"upDown",
")",
":",
"assert",
"upDown",
"in",
"(",
"'up'",
",",
"'down'",
")",
",",
"\"upDown argument must be 'up' or 'down'\"",
"key_code",
"=",
"special_key_translate_table",
"[",
"key",
"]",
"ev",
"=",
"AppKit",
".... | Helper method for special keys.
Source: http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac | [
"Helper",
"method",
"for",
"special",
"keys",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_osx.py#L264-L285 | train | Internal method for handling special key events. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_x11.py | _keyDown | def _keyDown(key):
"""Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The key to be pressed down.... | python | def _keyDown(key):
"""Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The key to be pressed down.... | [
"def",
"_keyDown",
"(",
"key",
")",
":",
"if",
"key",
"not",
"in",
"keyboardMapping",
"or",
"keyboardMapping",
"[",
"key",
"]",
"is",
"None",
":",
"return",
"if",
"type",
"(",
"key",
")",
"==",
"int",
":",
"fake_input",
"(",
"_display",
",",
"X",
"."... | Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The key to be pressed down. The valid names are liste... | [
"Performs",
"a",
"keyboard",
"key",
"press",
"without",
"the",
"release",
".",
"This",
"will",
"put",
"that",
"key",
"in",
"a",
"held",
"down",
"state",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_x11.py#L99-L129 | train | Performs a keyboard key press without the release. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_x11.py | _keyUp | def _keyUp(key):
"""Performs a keyboard key release (without the press down beforehand).
Args:
key (str): The key to be released up. The valid names are listed in
pyautogui.KEY_NAMES.
Returns:
None
"""
"""
Release a given character key. Also works with character keycodes as
... | python | def _keyUp(key):
"""Performs a keyboard key release (without the press down beforehand).
Args:
key (str): The key to be released up. The valid names are listed in
pyautogui.KEY_NAMES.
Returns:
None
"""
"""
Release a given character key. Also works with character keycodes as
... | [
"def",
"_keyUp",
"(",
"key",
")",
":",
"\"\"\"\n Release a given character key. Also works with character keycodes as\n integers, but not keysyms.\n \"\"\"",
"if",
"key",
"not",
"in",
"keyboardMapping",
"or",
"keyboardMapping",
"[",
"key",
"]",
"is",
"None",
":",
"re... | Performs a keyboard key release (without the press down beforehand).
Args:
key (str): The key to be released up. The valid names are listed in
pyautogui.KEY_NAMES.
Returns:
None | [
"Performs",
"a",
"keyboard",
"key",
"release",
"(",
"without",
"the",
"press",
"down",
"beforehand",
")",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_x11.py#L132-L156 | train | Performs a keyboard key release up. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_window_win.py | getWindows | def getWindows(): #https://sjohannes.wordpress.com/2012/03/23/win32-python-getting-all-window-titles/
"""Return dict: {'window title' : window handle} for all visible windows"""
titles = {}
def foreach_window(hwnd, lparam):
if IsWindowVisible(hwnd):
length = GetWindowTextLength(hwnd)... | python | def getWindows(): #https://sjohannes.wordpress.com/2012/03/23/win32-python-getting-all-window-titles/
"""Return dict: {'window title' : window handle} for all visible windows"""
titles = {}
def foreach_window(hwnd, lparam):
if IsWindowVisible(hwnd):
length = GetWindowTextLength(hwnd)... | [
"def",
"getWindows",
"(",
")",
":",
"#https://sjohannes.wordpress.com/2012/03/23/win32-python-getting-all-window-titles/",
"titles",
"=",
"{",
"}",
"def",
"foreach_window",
"(",
"hwnd",
",",
"lparam",
")",
":",
"if",
"IsWindowVisible",
"(",
"hwnd",
")",
":",
"length",... | Return dict: {'window title' : window handle} for all visible windows | [
"Return",
"dict",
":",
"{",
"window",
"title",
":",
"window",
"handle",
"}",
"for",
"all",
"visible",
"windows"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_window_win.py#L84-L97 | train | Return dict of window title and handle for all visible windows | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_window_win.py | getWindow | def getWindow(title, exact=False):
"""Return Window object if 'title' or its part found in visible windows titles, else return None
Return only 1 window found first
Args:
title: unicode string
exact (bool): True if search only exact match
"""
titles = getWindows()
hwnd = titles.... | python | def getWindow(title, exact=False):
"""Return Window object if 'title' or its part found in visible windows titles, else return None
Return only 1 window found first
Args:
title: unicode string
exact (bool): True if search only exact match
"""
titles = getWindows()
hwnd = titles.... | [
"def",
"getWindow",
"(",
"title",
",",
"exact",
"=",
"False",
")",
":",
"titles",
"=",
"getWindows",
"(",
")",
"hwnd",
"=",
"titles",
".",
"get",
"(",
"title",
",",
"None",
")",
"if",
"not",
"hwnd",
"and",
"not",
"exact",
":",
"for",
"k",
",",
"v... | Return Window object if 'title' or its part found in visible windows titles, else return None
Return only 1 window found first
Args:
title: unicode string
exact (bool): True if search only exact match | [
"Return",
"Window",
"object",
"if",
"title",
"or",
"its",
"part",
"found",
"in",
"visible",
"windows",
"titles",
"else",
"return",
"None"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_window_win.py#L99-L117 | train | Return Window object if title or its part found in visible windows titles else return None | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_window_win.py | Window.set_position | def set_position(self, x, y, width, height):
"""Set window top-left corner position and size"""
SetWindowPos(self._hwnd, None, x, y, width, height, ctypes.c_uint(0)) | python | def set_position(self, x, y, width, height):
"""Set window top-left corner position and size"""
SetWindowPos(self._hwnd, None, x, y, width, height, ctypes.c_uint(0)) | [
"def",
"set_position",
"(",
"self",
",",
"x",
",",
"y",
",",
"width",
",",
"height",
")",
":",
"SetWindowPos",
"(",
"self",
".",
"_hwnd",
",",
"None",
",",
"x",
",",
"y",
",",
"width",
",",
"height",
",",
"ctypes",
".",
"c_uint",
"(",
"0",
")",
... | Set window top-left corner position and size | [
"Set",
"window",
"top",
"-",
"left",
"corner",
"position",
"and",
"size"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_window_win.py#L44-L46 | train | Set top - left corner position and size | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_window_win.py | Window.move | def move(self, x, y):
"""Move window top-left corner to position"""
SetWindowPos(self._hwnd, None, x, y, 0, 0, SWP_NOSIZE) | python | def move(self, x, y):
"""Move window top-left corner to position"""
SetWindowPos(self._hwnd, None, x, y, 0, 0, SWP_NOSIZE) | [
"def",
"move",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"SetWindowPos",
"(",
"self",
".",
"_hwnd",
",",
"None",
",",
"x",
",",
"y",
",",
"0",
",",
"0",
",",
"SWP_NOSIZE",
")"
] | Move window top-left corner to position | [
"Move",
"window",
"top",
"-",
"left",
"corner",
"to",
"position"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_window_win.py#L48-L50 | train | Move the window top - left corner to position | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_window_win.py | Window.resize | def resize(self, width, height):
"""Change window size"""
SetWindowPos(self._hwnd, None, 0, 0, width, height, SWP_NOMOVE) | python | def resize(self, width, height):
"""Change window size"""
SetWindowPos(self._hwnd, None, 0, 0, width, height, SWP_NOMOVE) | [
"def",
"resize",
"(",
"self",
",",
"width",
",",
"height",
")",
":",
"SetWindowPos",
"(",
"self",
".",
"_hwnd",
",",
"None",
",",
"0",
",",
"0",
",",
"width",
",",
"height",
",",
"SWP_NOMOVE",
")"
] | Change window size | [
"Change",
"window",
"size"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_window_win.py#L52-L54 | train | Change window size | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_window_win.py | Window.get_position | def get_position(self):
"""Returns tuple of 4 numbers: (x, y)s of top-left and bottom-right corners"""
rect = _Rect()
GetWindowRect(self._hwnd, ctypes.pointer(rect))
return rect.left, rect.top, rect.right, rect.bottom | python | def get_position(self):
"""Returns tuple of 4 numbers: (x, y)s of top-left and bottom-right corners"""
rect = _Rect()
GetWindowRect(self._hwnd, ctypes.pointer(rect))
return rect.left, rect.top, rect.right, rect.bottom | [
"def",
"get_position",
"(",
"self",
")",
":",
"rect",
"=",
"_Rect",
"(",
")",
"GetWindowRect",
"(",
"self",
".",
"_hwnd",
",",
"ctypes",
".",
"pointer",
"(",
"rect",
")",
")",
"return",
"rect",
".",
"left",
",",
"rect",
".",
"top",
",",
"rect",
"."... | Returns tuple of 4 numbers: (x, y)s of top-left and bottom-right corners | [
"Returns",
"tuple",
"of",
"4",
"numbers",
":",
"(",
"x",
"y",
")",
"s",
"of",
"top",
"-",
"left",
"and",
"bottom",
"-",
"right",
"corners"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_window_win.py#L71-L75 | train | Returns tuple of 4 numbers : left top right bottom right corners | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | getPointOnLine | def getPointOnLine(x1, y1, x2, y2, n):
"""Returns the (x, y) tuple of the point that has progressed a proportion
n along the line defined by the two x, y coordinates.
Copied from pytweening module.
"""
x = ((x2 - x1) * n) + x1
y = ((y2 - y1) * n) + y1
return (x, y) | python | def getPointOnLine(x1, y1, x2, y2, n):
"""Returns the (x, y) tuple of the point that has progressed a proportion
n along the line defined by the two x, y coordinates.
Copied from pytweening module.
"""
x = ((x2 - x1) * n) + x1
y = ((y2 - y1) * n) + y1
return (x, y) | [
"def",
"getPointOnLine",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"n",
")",
":",
"x",
"=",
"(",
"(",
"x2",
"-",
"x1",
")",
"*",
"n",
")",
"+",
"x1",
"y",
"=",
"(",
"(",
"y2",
"-",
"y1",
")",
"*",
"n",
")",
"+",
"y1",
"return",
... | Returns the (x, y) tuple of the point that has progressed a proportion
n along the line defined by the two x, y coordinates.
Copied from pytweening module. | [
"Returns",
"the",
"(",
"x",
"y",
")",
"tuple",
"of",
"the",
"point",
"that",
"has",
"progressed",
"a",
"proportion",
"n",
"along",
"the",
"line",
"defined",
"by",
"the",
"two",
"x",
"y",
"coordinates",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L179-L187 | train | Returns the x y tuple of the point that has progressed a proportion
n along the line defined by the two x y coordinates x2 y2 x2 y2 n along the line defined by the two x y coordinates y2 x2 y2 n along the line defined by the two x y coordinates y2 x2 y2 n. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | _unpackXY | def _unpackXY(x, y):
"""If x is a sequence and y is None, returns x[0], y[0]. Else, returns x, y.
On functions that receive a pair of x,y coordinates, they can be passed as
separate arguments, or as a single two-element sequence.
"""
if isinstance(x, str):
# x parameter is the string of an ... | python | def _unpackXY(x, y):
"""If x is a sequence and y is None, returns x[0], y[0]. Else, returns x, y.
On functions that receive a pair of x,y coordinates, they can be passed as
separate arguments, or as a single two-element sequence.
"""
if isinstance(x, str):
# x parameter is the string of an ... | [
"def",
"_unpackXY",
"(",
"x",
",",
"y",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"str",
")",
":",
"# x parameter is the string of an image filename to find and click on:",
"x",
",",
"y",
"=",
"center",
"(",
"locateOnScreen",
"(",
"x",
")",
")",
"elif",
"... | If x is a sequence and y is None, returns x[0], y[0]. Else, returns x, y.
On functions that receive a pair of x,y coordinates, they can be passed as
separate arguments, or as a single two-element sequence. | [
"If",
"x",
"is",
"a",
"sequence",
"and",
"y",
"is",
"None",
"returns",
"x",
"[",
"0",
"]",
"y",
"[",
"0",
"]",
".",
"Else",
"returns",
"x",
"y",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L210-L231 | train | Unpacks x and y coordinates into the correct order. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | position | def position(x=None, y=None):
"""Returns the current xy coordinates of the mouse cursor as a two-integer
tuple.
Args:
x (int, None, optional) - If not None, this argument overrides the x in
the return value.
y (int, None, optional) - If not None, this argument overrides the y in
... | python | def position(x=None, y=None):
"""Returns the current xy coordinates of the mouse cursor as a two-integer
tuple.
Args:
x (int, None, optional) - If not None, this argument overrides the x in
the return value.
y (int, None, optional) - If not None, this argument overrides the y in
... | [
"def",
"position",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
")",
":",
"posx",
",",
"posy",
"=",
"platformModule",
".",
"_position",
"(",
")",
"posx",
"=",
"int",
"(",
"posx",
")",
"posy",
"=",
"int",
"(",
"posy",
")",
"if",
"x",
"is",
"not... | Returns the current xy coordinates of the mouse cursor as a two-integer
tuple.
Args:
x (int, None, optional) - If not None, this argument overrides the x in
the return value.
y (int, None, optional) - If not None, this argument overrides the y in
the return value.
Returns:
... | [
"Returns",
"the",
"current",
"xy",
"coordinates",
"of",
"the",
"mouse",
"cursor",
"as",
"a",
"two",
"-",
"integer",
"tuple",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L234-L254 | train | Returns the current xy coordinates of the mouse cursor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | onScreen | def onScreen(x, y=None):
"""Returns whether the given xy coordinates are on the screen or not.
Args:
Either the arguments are two separate values, first arg for x and second
for y, or there is a single argument of a sequence with two values, the
first x and the second y.
Example: ... | python | def onScreen(x, y=None):
"""Returns whether the given xy coordinates are on the screen or not.
Args:
Either the arguments are two separate values, first arg for x and second
for y, or there is a single argument of a sequence with two values, the
first x and the second y.
Example: ... | [
"def",
"onScreen",
"(",
"x",
",",
"y",
"=",
"None",
")",
":",
"x",
",",
"y",
"=",
"_unpackXY",
"(",
"x",
",",
"y",
")",
"x",
"=",
"int",
"(",
"x",
")",
"y",
"=",
"int",
"(",
"y",
")",
"width",
",",
"height",
"=",
"platformModule",
".",
"_si... | Returns whether the given xy coordinates are on the screen or not.
Args:
Either the arguments are two separate values, first arg for x and second
for y, or there is a single argument of a sequence with two values, the
first x and the second y.
Example: onScreen(x, y) or onScreen([x, y... | [
"Returns",
"whether",
"the",
"given",
"xy",
"coordinates",
"are",
"on",
"the",
"screen",
"or",
"not",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L266-L284 | train | Returns whether the given xy coordinates are on the screen or not. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | mouseUp | def mouseUp(x=None, y=None, button='left', duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs releasing a mouse button up (but not down beforehand).
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down.... | python | def mouseUp(x=None, y=None, button='left', duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs releasing a mouse button up (but not down beforehand).
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down.... | [
"def",
"mouseUp",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"button",
"=",
"'left'",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"if",
"button",
"not",
"in",
... | Performs releasing a mouse button up (but not down beforehand).
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the screen, the event happens at edge of the
screen.
Args:
... | [
"Performs",
"releasing",
"a",
"mouse",
"button",
"up",
"(",
"but",
"not",
"down",
"beforehand",
")",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L334-L375 | train | Performs a mouse button up and releasing a resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | click | def click(x=None, y=None, clicks=1, interval=0.0, button='left', duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs pressing a mouse button down and then immediately releasing it.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a f... | python | def click(x=None, y=None, clicks=1, interval=0.0, button='left', duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs pressing a mouse button down and then immediately releasing it.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a f... | [
"def",
"click",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"clicks",
"=",
"1",
",",
"interval",
"=",
"0.0",
",",
"button",
"=",
"'left'",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"pause",
"=",
"None",
",",
"_pause",
... | Performs pressing a mouse button down and then immediately releasing it.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the screen, the event happens at edge of the
screen.
... | [
"Performs",
"pressing",
"a",
"mouse",
"button",
"down",
"and",
"then",
"immediately",
"releasing",
"it",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L377-L430 | train | Performs a mouse button down and then immediately releasing it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | rightClick | def rightClick(x=None, y=None, duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs a right mouse button click.
This is a wrapper function for click('right', x, y).
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, ... | python | def rightClick(x=None, y=None, duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs a right mouse button click.
This is a wrapper function for click('right', x, y).
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, ... | [
"def",
"rightClick",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"_failSafeCheck",
"(",
")",
"click",
"(",
"x",
",",
"y",... | Performs a right mouse button click.
This is a wrapper function for click('right', x, y).
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the screen, the event happens at edge o... | [
"Performs",
"a",
"right",
"mouse",
"button",
"click",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L432-L457 | train | Performs a right mouse button click on the
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | doubleClick | def doubleClick(x=None, y=None, interval=0.0, button='left', duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs a double click.
This is a wrapper function for click('left', x, y, 2, interval).
The x and y parameters detail where the mouse event happens. If None, the
current mouse positi... | python | def doubleClick(x=None, y=None, interval=0.0, button='left', duration=0.0, tween=linear, pause=None, _pause=True):
"""Performs a double click.
This is a wrapper function for click('left', x, y, 2, interval).
The x and y parameters detail where the mouse event happens. If None, the
current mouse positi... | [
"def",
"doubleClick",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"interval",
"=",
"0.0",
",",
"button",
"=",
"'left'",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
"... | Performs a double click.
This is a wrapper function for click('left', x, y, 2, interval).
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the screen, the event happens at edge o... | [
"Performs",
"a",
"double",
"click",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L488-L530 | train | Performs a double click on the base image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | scroll | def scroll(clicks, x=None, y=None, pause=None, _pause=True):
"""Performs a scroll of the mouse scroll wheel.
Whether this is a vertical or horizontal scroll depends on the underlying
operating system.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position ... | python | def scroll(clicks, x=None, y=None, pause=None, _pause=True):
"""Performs a scroll of the mouse scroll wheel.
Whether this is a vertical or horizontal scroll depends on the underlying
operating system.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position ... | [
"def",
"scroll",
"(",
"clicks",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"_failSafeCheck",
"(",
")",
"if",
"type",
"(",
"x",
")",
"in",
"(",
"tuple",
",",
"list",
")",
":",
... | Performs a scroll of the mouse scroll wheel.
Whether this is a vertical or horizontal scroll depends on the underlying
operating system.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the bo... | [
"Performs",
"a",
"scroll",
"of",
"the",
"mouse",
"scroll",
"wheel",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L577-L605 | train | Performs a vertical or horizontal scroll of the underlying
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | hscroll | def hscroll(clicks, x=None, y=None, pause=None, _pause=True):
"""Performs an explicitly horizontal scroll of the mouse scroll wheel,
if this is supported by the operating system. (Currently just Linux.)
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is ... | python | def hscroll(clicks, x=None, y=None, pause=None, _pause=True):
"""Performs an explicitly horizontal scroll of the mouse scroll wheel,
if this is supported by the operating system. (Currently just Linux.)
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is ... | [
"def",
"hscroll",
"(",
"clicks",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"_failSafeCheck",
"(",
")",
"if",
"type",
"(",
"x",
")",
"in",
"(",
"tuple",
",",
"list",
")",
":",
... | Performs an explicitly horizontal scroll of the mouse scroll wheel,
if this is supported by the operating system. (Currently just Linux.)
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the bounda... | [
"Performs",
"an",
"explicitly",
"horizontal",
"scroll",
"of",
"the",
"mouse",
"scroll",
"wheel",
"if",
"this",
"is",
"supported",
"by",
"the",
"operating",
"system",
".",
"(",
"Currently",
"just",
"Linux",
".",
")"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L608-L634 | train | Performs an explicitly horizontal scroll of the mouse scroll wheel. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | vscroll | def vscroll(clicks, x=None, y=None, pause=None, _pause=True):
"""Performs an explicitly vertical scroll of the mouse scroll wheel,
if this is supported by the operating system. (Currently just Linux.)
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is us... | python | def vscroll(clicks, x=None, y=None, pause=None, _pause=True):
"""Performs an explicitly vertical scroll of the mouse scroll wheel,
if this is supported by the operating system. (Currently just Linux.)
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is us... | [
"def",
"vscroll",
"(",
"clicks",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"_failSafeCheck",
"(",
")",
"if",
"type",
"(",
"x",
")",
"in",
"(",
"tuple",
",",
"list",
")",
":",
... | Performs an explicitly vertical scroll of the mouse scroll wheel,
if this is supported by the operating system. (Currently just Linux.)
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundari... | [
"Performs",
"an",
"explicitly",
"vertical",
"scroll",
"of",
"the",
"mouse",
"scroll",
"wheel",
"if",
"this",
"is",
"supported",
"by",
"the",
"operating",
"system",
".",
"(",
"Currently",
"just",
"Linux",
".",
")"
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L637-L662 | train | Performs an explicitly vertical scroll of the mouse scroll wheel. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | moveTo | def moveTo(x=None, y=None, duration=0.0, tween=linear, pause=None, _pause=True):
"""Moves the mouse cursor to a point on the screen.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries ... | python | def moveTo(x=None, y=None, duration=0.0, tween=linear, pause=None, _pause=True):
"""Moves the mouse cursor to a point on the screen.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries ... | [
"def",
"moveTo",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"_failSafeCheck",
"(",
")",
"x",
",",
"y",
"=",
"_unpackXY",... | Moves the mouse cursor to a point on the screen.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the screen, the event happens at edge of the
screen.
Args:
x (int, flo... | [
"Moves",
"the",
"mouse",
"cursor",
"to",
"a",
"point",
"on",
"the",
"screen",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L665-L695 | train | Moves the mouse cursor to a point on the screen. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | moveRel | def moveRel(xOffset=None, yOffset=None, duration=0.0, tween=linear, pause=None, _pause=True):
"""Moves the mouse cursor to a point on the screen, relative to its current
position.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value,... | python | def moveRel(xOffset=None, yOffset=None, duration=0.0, tween=linear, pause=None, _pause=True):
"""Moves the mouse cursor to a point on the screen, relative to its current
position.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value,... | [
"def",
"moveRel",
"(",
"xOffset",
"=",
"None",
",",
"yOffset",
"=",
"None",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"_failSafeCheck",
"(",
")",
"xOffset",
",",
"yOffse... | Moves the mouse cursor to a point on the screen, relative to its current
position.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the screen, the event happens at edge of the
... | [
"Moves",
"the",
"mouse",
"cursor",
"to",
"a",
"point",
"on",
"the",
"screen",
"relative",
"to",
"its",
"current",
"position",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L698-L729 | train | Moves the mouse cursor to a point on the screen relative to its current cursor position. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | dragTo | def dragTo(x=None, y=None, duration=0.0, tween=linear, button='left', pause=None, _pause=True, mouseDownUp=True):
"""Performs a mouse drag (mouse movement while a button is held down) to a
point on the screen.
The x and y parameters detail where the mouse event happens. If None, the
current mouse posit... | python | def dragTo(x=None, y=None, duration=0.0, tween=linear, button='left', pause=None, _pause=True, mouseDownUp=True):
"""Performs a mouse drag (mouse movement while a button is held down) to a
point on the screen.
The x and y parameters detail where the mouse event happens. If None, the
current mouse posit... | [
"def",
"dragTo",
"(",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"button",
"=",
"'left'",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
",",
"mouseDownUp",
"=",
"True",
")",
":... | Performs a mouse drag (mouse movement while a button is held down) to a
point on the screen.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the screen, the event happens at edge... | [
"Performs",
"a",
"mouse",
"drag",
"(",
"mouse",
"movement",
"while",
"a",
"button",
"is",
"held",
"down",
")",
"to",
"a",
"point",
"on",
"the",
"screen",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L735-L775 | train | Performs a mouse drag to the a
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | dragRel | def dragRel(xOffset=0, yOffset=0, duration=0.0, tween=linear, button='left', pause=None, _pause=True, mouseDownUp=True):
"""Performs a mouse drag (mouse movement while a button is held down) to a
point on the screen, relative to its current position.
The x and y parameters detail where the mouse event happ... | python | def dragRel(xOffset=0, yOffset=0, duration=0.0, tween=linear, button='left', pause=None, _pause=True, mouseDownUp=True):
"""Performs a mouse drag (mouse movement while a button is held down) to a
point on the screen, relative to its current position.
The x and y parameters detail where the mouse event happ... | [
"def",
"dragRel",
"(",
"xOffset",
"=",
"0",
",",
"yOffset",
"=",
"0",
",",
"duration",
"=",
"0.0",
",",
"tween",
"=",
"linear",
",",
"button",
"=",
"'left'",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
",",
"mouseDownUp",
"=",
"True",
")... | Performs a mouse drag (mouse movement while a button is held down) to a
point on the screen, relative to its current position.
The x and y parameters detail where the mouse event happens. If None, the
current mouse position is used. If a float value, it is rounded down. If
outside the boundaries of the... | [
"Performs",
"a",
"mouse",
"drag",
"(",
"mouse",
"movement",
"while",
"a",
"button",
"is",
"held",
"down",
")",
"to",
"a",
"point",
"on",
"the",
"screen",
"relative",
"to",
"its",
"current",
"position",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L778-L827 | train | Performs a mouse drag to the a
point on the screen relative to its current position. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | _mouseMoveDrag | def _mouseMoveDrag(moveOrDrag, x, y, xOffset, yOffset, duration, tween=linear, button=None):
"""Handles the actual move or drag event, since different platforms
implement them differently.
On Windows & Linux, a drag is a normal mouse move while a mouse button is
held down. On OS X, a distinct "drag" ev... | python | def _mouseMoveDrag(moveOrDrag, x, y, xOffset, yOffset, duration, tween=linear, button=None):
"""Handles the actual move or drag event, since different platforms
implement them differently.
On Windows & Linux, a drag is a normal mouse move while a mouse button is
held down. On OS X, a distinct "drag" ev... | [
"def",
"_mouseMoveDrag",
"(",
"moveOrDrag",
",",
"x",
",",
"y",
",",
"xOffset",
",",
"yOffset",
",",
"duration",
",",
"tween",
"=",
"linear",
",",
"button",
"=",
"None",
")",
":",
"# The move and drag code is similar, but OS X requires a special drag event instead of ... | Handles the actual move or drag event, since different platforms
implement them differently.
On Windows & Linux, a drag is a normal mouse move while a mouse button is
held down. On OS X, a distinct "drag" event must be used instead.
The code for moving and dragging the mouse is similar, so this functi... | [
"Handles",
"the",
"actual",
"move",
"or",
"drag",
"event",
"since",
"different",
"platforms",
"implement",
"them",
"differently",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L833-L929 | train | Handles the mouse move and drag events. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | keyDown | def keyDown(key, pause=None, _pause=True):
"""Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The... | python | def keyDown(key, pause=None, _pause=True):
"""Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The... | [
"def",
"keyDown",
"(",
"key",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"if",
"len",
"(",
"key",
")",
">",
"1",
":",
"key",
"=",
"key",
".",
"lower",
"(",
")",
"_failSafeCheck",
"(",
")",
"platformModule",
".",
"_keyDown",
... | Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The key to be pressed down. The valid names are liste... | [
"Performs",
"a",
"keyboard",
"key",
"press",
"without",
"the",
"release",
".",
"This",
"will",
"put",
"that",
"key",
"in",
"a",
"held",
"down",
"state",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L955-L975 | train | Performs a keyboard key press without the release. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | keyUp | def keyUp(key, pause=None, _pause=True):
"""Performs a keyboard key release (without the press down beforehand).
Args:
key (str): The key to be released up. The valid names are listed in
KEYBOARD_KEYS.
Returns:
None
"""
if len(key) > 1:
key = key.lower()
_failSafeChe... | python | def keyUp(key, pause=None, _pause=True):
"""Performs a keyboard key release (without the press down beforehand).
Args:
key (str): The key to be released up. The valid names are listed in
KEYBOARD_KEYS.
Returns:
None
"""
if len(key) > 1:
key = key.lower()
_failSafeChe... | [
"def",
"keyUp",
"(",
"key",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"if",
"len",
"(",
"key",
")",
">",
"1",
":",
"key",
"=",
"key",
".",
"lower",
"(",
")",
"_failSafeCheck",
"(",
")",
"platformModule",
".",
"_keyUp",
"(",... | Performs a keyboard key release (without the press down beforehand).
Args:
key (str): The key to be released up. The valid names are listed in
KEYBOARD_KEYS.
Returns:
None | [
"Performs",
"a",
"keyboard",
"key",
"release",
"(",
"without",
"the",
"press",
"down",
"beforehand",
")",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L977-L993 | train | Performs a keyboard key release up. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | press | def press(keys, presses=1, interval=0.0, pause=None, _pause=True):
"""Performs a keyboard key press down, followed by a release.
Args:
key (str, list): The key to be pressed. The valid names are listed in
KEYBOARD_KEYS. Can also be a list of such strings.
presses (integer, optiional): the num... | python | def press(keys, presses=1, interval=0.0, pause=None, _pause=True):
"""Performs a keyboard key press down, followed by a release.
Args:
key (str, list): The key to be pressed. The valid names are listed in
KEYBOARD_KEYS. Can also be a list of such strings.
presses (integer, optiional): the num... | [
"def",
"press",
"(",
"keys",
",",
"presses",
"=",
"1",
",",
"interval",
"=",
"0.0",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"if",
"type",
"(",
"keys",
")",
"==",
"str",
":",
"keys",
"=",
"[",
"keys",
"]",
"# put string in... | Performs a keyboard key press down, followed by a release.
Args:
key (str, list): The key to be pressed. The valid names are listed in
KEYBOARD_KEYS. Can also be a list of such strings.
presses (integer, optiional): the number of press repetition
1 by default, for just one press
inter... | [
"Performs",
"a",
"keyboard",
"key",
"press",
"down",
"followed",
"by",
"a",
"release",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L995-L1027 | train | Performs a keyboard key press down followed by a release. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | typewrite | def typewrite(message, interval=0.0, pause=None, _pause=True):
"""Performs a keyboard key press down, followed by a release, for each of
the characters in message.
The message argument can also be list of strings, in which case any valid
keyboard name can be used.
Since this performs a sequence of... | python | def typewrite(message, interval=0.0, pause=None, _pause=True):
"""Performs a keyboard key press down, followed by a release, for each of
the characters in message.
The message argument can also be list of strings, in which case any valid
keyboard name can be used.
Since this performs a sequence of... | [
"def",
"typewrite",
"(",
"message",
",",
"interval",
"=",
"0.0",
",",
"pause",
"=",
"None",
",",
"_pause",
"=",
"True",
")",
":",
"interval",
"=",
"float",
"(",
"interval",
")",
"_failSafeCheck",
"(",
")",
"for",
"c",
"in",
"message",
":",
"if",
"len... | Performs a keyboard key press down, followed by a release, for each of
the characters in message.
The message argument can also be list of strings, in which case any valid
keyboard name can be used.
Since this performs a sequence of keyboard presses and does not hold down
keys, it cannot be used t... | [
"Performs",
"a",
"keyboard",
"key",
"press",
"down",
"followed",
"by",
"a",
"release",
"for",
"each",
"of",
"the",
"characters",
"in",
"message",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L1029-L1061 | train | Performs a keyboard key press down followed by a release for each of the keyboards in message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/__init__.py | displayMousePosition | def displayMousePosition(xOffset=0, yOffset=0):
"""This function is meant to be run from the command line. It will
automatically display the location and RGB of the mouse cursor."""
print('Press Ctrl-C to quit.')
if xOffset != 0 or yOffset != 0:
print('xOffset: %s yOffset: %s' % (xOffset, yOffse... | python | def displayMousePosition(xOffset=0, yOffset=0):
"""This function is meant to be run from the command line. It will
automatically display the location and RGB of the mouse cursor."""
print('Press Ctrl-C to quit.')
if xOffset != 0 or yOffset != 0:
print('xOffset: %s yOffset: %s' % (xOffset, yOffse... | [
"def",
"displayMousePosition",
"(",
"xOffset",
"=",
"0",
",",
"yOffset",
"=",
"0",
")",
":",
"print",
"(",
"'Press Ctrl-C to quit.'",
")",
"if",
"xOffset",
"!=",
"0",
"or",
"yOffset",
"!=",
"0",
":",
"print",
"(",
"'xOffset: %s yOffset: %s'",
"%",
"(",
"xO... | This function is meant to be run from the command line. It will
automatically display the location and RGB of the mouse cursor. | [
"This",
"function",
"is",
"meant",
"to",
"be",
"run",
"from",
"the",
"command",
"line",
".",
"It",
"will",
"automatically",
"display",
"the",
"location",
"and",
"RGB",
"of",
"the",
"mouse",
"cursor",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/__init__.py#L1125-L1149 | train | This function will display the location and RGB of the mouse cursor. It will automatically display the location and RGB of the mouse cursor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_win.py | _keyDown | def _keyDown(key):
"""Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The key to be pressed down.... | python | def _keyDown(key):
"""Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The key to be pressed down.... | [
"def",
"_keyDown",
"(",
"key",
")",
":",
"if",
"key",
"not",
"in",
"keyboardMapping",
"or",
"keyboardMapping",
"[",
"key",
"]",
"is",
"None",
":",
"return",
"needsShift",
"=",
"pyautogui",
".",
"isShiftCharacter",
"(",
"key",
")",
"\"\"\"\n # OLD CODE: The ... | Performs a keyboard key press without the release. This will put that
key in a held down state.
NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.
Args:
key (str): The key to be pressed down. The valid names are liste... | [
"Performs",
"a",
"keyboard",
"key",
"press",
"without",
"the",
"release",
".",
"This",
"will",
"put",
"that",
"key",
"in",
"a",
"held",
"down",
"state",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_win.py#L267-L309 | train | Performs a keyboard key press without the release. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_win.py | _position | def _position():
"""Returns the current xy coordinates of the mouse cursor as a two-integer
tuple by calling the GetCursorPos() win32 function.
Returns:
(x, y) tuple of the current xy coordinates of the mouse cursor.
"""
cursor = POINT()
ctypes.windll.user32.GetCursorPos(ctypes.byref(cur... | python | def _position():
"""Returns the current xy coordinates of the mouse cursor as a two-integer
tuple by calling the GetCursorPos() win32 function.
Returns:
(x, y) tuple of the current xy coordinates of the mouse cursor.
"""
cursor = POINT()
ctypes.windll.user32.GetCursorPos(ctypes.byref(cur... | [
"def",
"_position",
"(",
")",
":",
"cursor",
"=",
"POINT",
"(",
")",
"ctypes",
".",
"windll",
".",
"user32",
".",
"GetCursorPos",
"(",
"ctypes",
".",
"byref",
"(",
"cursor",
")",
")",
"return",
"(",
"cursor",
".",
"x",
",",
"cursor",
".",
"y",
")"
... | Returns the current xy coordinates of the mouse cursor as a two-integer
tuple by calling the GetCursorPos() win32 function.
Returns:
(x, y) tuple of the current xy coordinates of the mouse cursor. | [
"Returns",
"the",
"current",
"xy",
"coordinates",
"of",
"the",
"mouse",
"cursor",
"as",
"a",
"two",
"-",
"integer",
"tuple",
"by",
"calling",
"the",
"GetCursorPos",
"()",
"win32",
"function",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_win.py#L352-L362 | train | Returns the current xy coordinates of the mouse cursor as a two - integer
tuple by calling the GetCursorPos win32 function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_win.py | _mouseDown | def _mouseDown(x, y, button):
"""Send the mouse down event to Windows by calling the mouse_event() win32
function.
Args:
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
button (str): The mouse button, either 'left', 'middle', or 'right'
Returns... | python | def _mouseDown(x, y, button):
"""Send the mouse down event to Windows by calling the mouse_event() win32
function.
Args:
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
button (str): The mouse button, either 'left', 'middle', or 'right'
Returns... | [
"def",
"_mouseDown",
"(",
"x",
",",
"y",
",",
"button",
")",
":",
"if",
"button",
"==",
"'left'",
":",
"try",
":",
"_sendMouseEvent",
"(",
"MOUSEEVENTF_LEFTDOWN",
",",
"x",
",",
"y",
")",
"except",
"(",
"PermissionError",
",",
"OSError",
")",
":",
"# T... | Send the mouse down event to Windows by calling the mouse_event() win32
function.
Args:
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
button (str): The mouse button, either 'left', 'middle', or 'right'
Returns:
None | [
"Send",
"the",
"mouse",
"down",
"event",
"to",
"Windows",
"by",
"calling",
"the",
"mouse_event",
"()",
"win32",
"function",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_win.py#L389-L417 | train | Send the mouse down event to the Windows by calling the mouse_event function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_win.py | _mouseUp | def _mouseUp(x, y, button):
"""Send the mouse up event to Windows by calling the mouse_event() win32
function.
Args:
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
button (str): The mouse button, either 'left', 'middle', or 'right'
Returns:
... | python | def _mouseUp(x, y, button):
"""Send the mouse up event to Windows by calling the mouse_event() win32
function.
Args:
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
button (str): The mouse button, either 'left', 'middle', or 'right'
Returns:
... | [
"def",
"_mouseUp",
"(",
"x",
",",
"y",
",",
"button",
")",
":",
"if",
"button",
"==",
"'left'",
":",
"try",
":",
"_sendMouseEvent",
"(",
"MOUSEEVENTF_LEFTUP",
",",
"x",
",",
"y",
")",
"except",
"(",
"PermissionError",
",",
"OSError",
")",
":",
"# TODO:... | Send the mouse up event to Windows by calling the mouse_event() win32
function.
Args:
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
button (str): The mouse button, either 'left', 'middle', or 'right'
Returns:
None | [
"Send",
"the",
"mouse",
"up",
"event",
"to",
"Windows",
"by",
"calling",
"the",
"mouse_event",
"()",
"win32",
"function",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_win.py#L420-L448 | train | Send the mouse up event to the Windows by calling the mouse_event function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_win.py | _click | def _click(x, y, button):
"""Send the mouse click event to Windows by calling the mouse_event() win32
function.
Args:
button (str): The mouse button, either 'left', 'middle', or 'right'
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
Returns:
... | python | def _click(x, y, button):
"""Send the mouse click event to Windows by calling the mouse_event() win32
function.
Args:
button (str): The mouse button, either 'left', 'middle', or 'right'
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
Returns:
... | [
"def",
"_click",
"(",
"x",
",",
"y",
",",
"button",
")",
":",
"if",
"button",
"==",
"'left'",
":",
"try",
":",
"_sendMouseEvent",
"(",
"MOUSEEVENTF_LEFTCLICK",
",",
"x",
",",
"y",
")",
"except",
"(",
"PermissionError",
",",
"OSError",
")",
":",
"# TODO... | Send the mouse click event to Windows by calling the mouse_event() win32
function.
Args:
button (str): The mouse button, either 'left', 'middle', or 'right'
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
Returns:
None | [
"Send",
"the",
"mouse",
"click",
"event",
"to",
"Windows",
"by",
"calling",
"the",
"mouse_event",
"()",
"win32",
"function",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_win.py#L451-L479 | train | Send the mouse click event to Windows by calling the mouse_event function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_win.py | _sendMouseEvent | def _sendMouseEvent(ev, x, y, dwData=0):
"""The helper function that actually makes the call to the mouse_event()
win32 function.
Args:
ev (int): The win32 code for the mouse event. Use one of the MOUSEEVENTF_*
constants for this argument.
x (int): The x position of the mouse event.
... | python | def _sendMouseEvent(ev, x, y, dwData=0):
"""The helper function that actually makes the call to the mouse_event()
win32 function.
Args:
ev (int): The win32 code for the mouse event. Use one of the MOUSEEVENTF_*
constants for this argument.
x (int): The x position of the mouse event.
... | [
"def",
"_sendMouseEvent",
"(",
"ev",
",",
"x",
",",
"y",
",",
"dwData",
"=",
"0",
")",
":",
"assert",
"x",
"!=",
"None",
"and",
"y",
"!=",
"None",
",",
"'x and y cannot be set to None'",
"# TODO: ARG! For some reason, SendInput isn't working for mouse events. I'm swit... | The helper function that actually makes the call to the mouse_event()
win32 function.
Args:
ev (int): The win32 code for the mouse event. Use one of the MOUSEEVENTF_*
constants for this argument.
x (int): The x position of the mouse event.
y (int): The y position of the mouse event.
... | [
"The",
"helper",
"function",
"that",
"actually",
"makes",
"the",
"call",
"to",
"the",
"mouse_event",
"()",
"win32",
"function",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_win.py#L482-L513 | train | This function is used by the mouse_event function that actually makes the call to the win32 function. It is used by the mouse_event function that actually makes the call to the win32 function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
asweigart/pyautogui | pyautogui/_pyautogui_win.py | _scroll | def _scroll(clicks, x=None, y=None):
"""Send the mouse vertical scroll event to Windows by calling the
mouse_event() win32 function.
Args:
clicks (int): The amount of scrolling to do. A positive value is the mouse
wheel moving forward (scrolling up), a negative value is backwards (down).
... | python | def _scroll(clicks, x=None, y=None):
"""Send the mouse vertical scroll event to Windows by calling the
mouse_event() win32 function.
Args:
clicks (int): The amount of scrolling to do. A positive value is the mouse
wheel moving forward (scrolling up), a negative value is backwards (down).
... | [
"def",
"_scroll",
"(",
"clicks",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
")",
":",
"startx",
",",
"starty",
"=",
"_position",
"(",
")",
"width",
",",
"height",
"=",
"_size",
"(",
")",
"if",
"x",
"is",
"None",
":",
"x",
"=",
"startx",
"els... | Send the mouse vertical scroll event to Windows by calling the
mouse_event() win32 function.
Args:
clicks (int): The amount of scrolling to do. A positive value is the mouse
wheel moving forward (scrolling up), a negative value is backwards (down).
x (int): The x position of the mouse event.
... | [
"Send",
"the",
"mouse",
"vertical",
"scroll",
"event",
"to",
"Windows",
"by",
"calling",
"the",
"mouse_event",
"()",
"win32",
"function",
"."
] | 77524bd47334a89024013fd48e05151c3ac9289a | https://github.com/asweigart/pyautogui/blob/77524bd47334a89024013fd48e05151c3ac9289a/pyautogui/_pyautogui_win.py#L520-L554 | train | Send the mouse vertical scroll event to the available Windows modules. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/__init__.py | authorize | def authorize(credentials, client_class=Client):
"""Login to Google API using OAuth2 credentials.
This is a shortcut function which
instantiates :class:`gspread.client.Client`
and performs login right away.
:returns: :class:`gspread.Client` instance.
"""
client = client_class(auth=credentia... | python | def authorize(credentials, client_class=Client):
"""Login to Google API using OAuth2 credentials.
This is a shortcut function which
instantiates :class:`gspread.client.Client`
and performs login right away.
:returns: :class:`gspread.Client` instance.
"""
client = client_class(auth=credentia... | [
"def",
"authorize",
"(",
"credentials",
",",
"client_class",
"=",
"Client",
")",
":",
"client",
"=",
"client_class",
"(",
"auth",
"=",
"credentials",
")",
"client",
".",
"login",
"(",
")",
"return",
"client"
] | Login to Google API using OAuth2 credentials.
This is a shortcut function which
instantiates :class:`gspread.client.Client`
and performs login right away.
:returns: :class:`gspread.Client` instance. | [
"Login",
"to",
"Google",
"API",
"using",
"OAuth2",
"credentials",
".",
"This",
"is",
"a",
"shortcut",
"function",
"which",
"instantiates",
":",
"class",
":",
"gspread",
".",
"client",
".",
"Client",
"and",
"performs",
"login",
"right",
"away",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/__init__.py#L29-L39 | train | Login to Google API using OAuth2 credentials. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.title | def title(self):
"""Spreadsheet title."""
try:
return self._properties['title']
except KeyError:
metadata = self.fetch_sheet_metadata()
self._properties.update(metadata['properties'])
return self._properties['title'] | python | def title(self):
"""Spreadsheet title."""
try:
return self._properties['title']
except KeyError:
metadata = self.fetch_sheet_metadata()
self._properties.update(metadata['properties'])
return self._properties['title'] | [
"def",
"title",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_properties",
"[",
"'title'",
"]",
"except",
"KeyError",
":",
"metadata",
"=",
"self",
".",
"fetch_sheet_metadata",
"(",
")",
"self",
".",
"_properties",
".",
"update",
"(",
"meta... | Spreadsheet title. | [
"Spreadsheet",
"title",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L50-L57 | train | Spreadsheet title. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.batch_update | def batch_update(self, body):
"""Lower-level method that directly calls `spreadsheets.batchUpdate <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate>`_.
:param dict body: `Request body <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate... | python | def batch_update(self, body):
"""Lower-level method that directly calls `spreadsheets.batchUpdate <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate>`_.
:param dict body: `Request body <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate... | [
"def",
"batch_update",
"(",
"self",
",",
"body",
")",
":",
"r",
"=",
"self",
".",
"client",
".",
"request",
"(",
"'post'",
",",
"SPREADSHEET_BATCH_UPDATE_URL",
"%",
"self",
".",
"id",
",",
"json",
"=",
"body",
")",
"return",
"r",
".",
"json",
"(",
")... | Lower-level method that directly calls `spreadsheets.batchUpdate <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate>`_.
:param dict body: `Request body <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate#request-body>`_.
:returns: `Resp... | [
"Lower",
"-",
"level",
"method",
"that",
"directly",
"calls",
"spreadsheets",
".",
"batchUpdate",
"<https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"sheets",
"/",
"api",
"/",
"reference",
"/",
"rest",
"/",
"v4",
"/",
"spreadsheets",
"/",
... | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L87-L103 | train | Lower - level method that directly calls sheets. batchUpdate. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.values_append | def values_append(self, range, params, body):
"""Lower-level method that directly calls `spreadsheets.values.append <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_... | python | def values_append(self, range, params, body):
"""Lower-level method that directly calls `spreadsheets.values.append <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_... | [
"def",
"values_append",
"(",
"self",
",",
"range",
",",
"params",
",",
"body",
")",
":",
"url",
"=",
"SPREADSHEET_VALUES_APPEND_URL",
"%",
"(",
"self",
".",
"id",
",",
"quote",
"(",
"range",
")",
")",
"r",
"=",
"self",
".",
"client",
".",
"request",
... | Lower-level method that directly calls `spreadsheets.values.append <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`_
of a range to searc... | [
"Lower",
"-",
"level",
"method",
"that",
"directly",
"calls",
"spreadsheets",
".",
"values",
".",
"append",
"<https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"sheets",
"/",
"api",
"/",
"reference",
"/",
"rest",
"/",
"v4",
"/",
"spreadshe... | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L105-L120 | train | Lower - level method that directly calls spreadsheets. values. append <https://developers. google. com / sheets > _. Values are appended after the last row of the table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.values_clear | def values_clear(self, range):
"""Lower-level method that directly calls `spreadsheets.values.clear <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/clear>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`_ of th... | python | def values_clear(self, range):
"""Lower-level method that directly calls `spreadsheets.values.clear <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/clear>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`_ of th... | [
"def",
"values_clear",
"(",
"self",
",",
"range",
")",
":",
"url",
"=",
"SPREADSHEET_VALUES_CLEAR_URL",
"%",
"(",
"self",
".",
"id",
",",
"quote",
"(",
"range",
")",
")",
"r",
"=",
"self",
".",
"client",
".",
"request",
"(",
"'post'",
",",
"url",
")"... | Lower-level method that directly calls `spreadsheets.values.clear <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/clear>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`_ of the values to clear.
:returns: `Resp... | [
"Lower",
"-",
"level",
"method",
"that",
"directly",
"calls",
"spreadsheets",
".",
"values",
".",
"clear",
"<https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"sheets",
"/",
"api",
"/",
"reference",
"/",
"rest",
"/",
"v4",
"/",
"spreadshee... | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L122-L134 | train | Lower - level method that directly calls spreadsheets. values. clear. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.values_get | def values_get(self, range, params=None):
"""Lower-level method that directly calls `spreadsheets.values.get <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`... | python | def values_get(self, range, params=None):
"""Lower-level method that directly calls `spreadsheets.values.get <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`... | [
"def",
"values_get",
"(",
"self",
",",
"range",
",",
"params",
"=",
"None",
")",
":",
"url",
"=",
"SPREADSHEET_VALUES_URL",
"%",
"(",
"self",
".",
"id",
",",
"quote",
"(",
"range",
")",
")",
"r",
"=",
"self",
".",
"client",
".",
"request",
"(",
"'g... | Lower-level method that directly calls `spreadsheets.values.get <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`_ of the values to retrieve.
:param dict para... | [
"Lower",
"-",
"level",
"method",
"that",
"directly",
"calls",
"spreadsheets",
".",
"values",
".",
"get",
"<https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"sheets",
"/",
"api",
"/",
"reference",
"/",
"rest",
"/",
"v4",
"/",
"spreadsheets... | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L136-L149 | train | Lower - level method that directly calls sheets. values. get <https://developers. google. com / sheets / api / guides / concepts#a1_notation >_ of the values to retrieve. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.values_update | def values_update(self, range, params=None, body=None):
"""Lower-level method that directly calls `spreadsheets.values.update <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/update>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/co... | python | def values_update(self, range, params=None, body=None):
"""Lower-level method that directly calls `spreadsheets.values.update <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/update>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/co... | [
"def",
"values_update",
"(",
"self",
",",
"range",
",",
"params",
"=",
"None",
",",
"body",
"=",
"None",
")",
":",
"url",
"=",
"SPREADSHEET_VALUES_URL",
"%",
"(",
"self",
".",
"id",
",",
"quote",
"(",
"range",
")",
")",
"r",
"=",
"self",
".",
"clie... | Lower-level method that directly calls `spreadsheets.values.update <https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/update>`_.
:param str range: The `A1 notation <https://developers.google.com/sheets/api/guides/concepts#a1_notation>`_ of the values to update.
:param dict ... | [
"Lower",
"-",
"level",
"method",
"that",
"directly",
"calls",
"spreadsheets",
".",
"values",
".",
"update",
"<https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"sheets",
"/",
"api",
"/",
"reference",
"/",
"rest",
"/",
"v4",
"/",
"spreadshe... | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L151-L177 | train | Lower - level method that directly calls spreadsheets. values. update. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.get_worksheet | def get_worksheet(self, index):
"""Returns a worksheet with specified `index`.
:param index: An index of a worksheet. Indexes start from zero.
:type index: int
:returns: an instance of :class:`gsperad.models.Worksheet`
or `None` if the worksheet is not found.
... | python | def get_worksheet(self, index):
"""Returns a worksheet with specified `index`.
:param index: An index of a worksheet. Indexes start from zero.
:type index: int
:returns: an instance of :class:`gsperad.models.Worksheet`
or `None` if the worksheet is not found.
... | [
"def",
"get_worksheet",
"(",
"self",
",",
"index",
")",
":",
"sheet_data",
"=",
"self",
".",
"fetch_sheet_metadata",
"(",
")",
"try",
":",
"properties",
"=",
"sheet_data",
"[",
"'sheets'",
"]",
"[",
"index",
"]",
"[",
"'properties'",
"]",
"return",
"Worksh... | Returns a worksheet with specified `index`.
:param index: An index of a worksheet. Indexes start from zero.
:type index: int
:returns: an instance of :class:`gsperad.models.Worksheet`
or `None` if the worksheet is not found.
Example. To get first worksheet of a sprea... | [
"Returns",
"a",
"worksheet",
"with",
"specified",
"index",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L188-L209 | train | Returns a worksheet with specified index. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.worksheets | def worksheets(self):
"""Returns a list of all :class:`worksheets <gsperad.models.Worksheet>`
in a spreadsheet.
"""
sheet_data = self.fetch_sheet_metadata()
return [Worksheet(self, x['properties']) for x in sheet_data['sheets']] | python | def worksheets(self):
"""Returns a list of all :class:`worksheets <gsperad.models.Worksheet>`
in a spreadsheet.
"""
sheet_data = self.fetch_sheet_metadata()
return [Worksheet(self, x['properties']) for x in sheet_data['sheets']] | [
"def",
"worksheets",
"(",
"self",
")",
":",
"sheet_data",
"=",
"self",
".",
"fetch_sheet_metadata",
"(",
")",
"return",
"[",
"Worksheet",
"(",
"self",
",",
"x",
"[",
"'properties'",
"]",
")",
"for",
"x",
"in",
"sheet_data",
"[",
"'sheets'",
"]",
"]"
] | Returns a list of all :class:`worksheets <gsperad.models.Worksheet>`
in a spreadsheet. | [
"Returns",
"a",
"list",
"of",
"all",
":",
"class",
":",
"worksheets",
"<gsperad",
".",
"models",
".",
"Worksheet",
">",
"in",
"a",
"spreadsheet",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L211-L217 | train | Returns a list of all sheets in a spreadsheet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.worksheet | def worksheet(self, title):
"""Returns a worksheet with specified `title`.
:param title: A title of a worksheet. If there're multiple
worksheets with the same title, first one will
be returned.
:type title: int
:returns: an instance of :class... | python | def worksheet(self, title):
"""Returns a worksheet with specified `title`.
:param title: A title of a worksheet. If there're multiple
worksheets with the same title, first one will
be returned.
:type title: int
:returns: an instance of :class... | [
"def",
"worksheet",
"(",
"self",
",",
"title",
")",
":",
"sheet_data",
"=",
"self",
".",
"fetch_sheet_metadata",
"(",
")",
"try",
":",
"item",
"=",
"finditem",
"(",
"lambda",
"x",
":",
"x",
"[",
"'properties'",
"]",
"[",
"'title'",
"]",
"==",
"title",
... | Returns a worksheet with specified `title`.
:param title: A title of a worksheet. If there're multiple
worksheets with the same title, first one will
be returned.
:type title: int
:returns: an instance of :class:`gsperad.models.Worksheet`.
E... | [
"Returns",
"a",
"worksheet",
"with",
"specified",
"title",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L219-L243 | train | Returns a worksheet with the specified title. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.add_worksheet | def add_worksheet(self, title, rows, cols):
"""Adds a new worksheet to a spreadsheet.
:param title: A title of a new worksheet.
:type title: str
:param rows: Number of rows.
:type rows: int
:param cols: Number of columns.
:type cols: int
:returns: a newl... | python | def add_worksheet(self, title, rows, cols):
"""Adds a new worksheet to a spreadsheet.
:param title: A title of a new worksheet.
:type title: str
:param rows: Number of rows.
:type rows: int
:param cols: Number of columns.
:type cols: int
:returns: a newl... | [
"def",
"add_worksheet",
"(",
"self",
",",
"title",
",",
"rows",
",",
"cols",
")",
":",
"body",
"=",
"{",
"'requests'",
":",
"[",
"{",
"'addSheet'",
":",
"{",
"'properties'",
":",
"{",
"'title'",
":",
"title",
",",
"'sheetType'",
":",
"'GRID'",
",",
"... | Adds a new worksheet to a spreadsheet.
:param title: A title of a new worksheet.
:type title: str
:param rows: Number of rows.
:type rows: int
:param cols: Number of columns.
:type cols: int
:returns: a newly created :class:`worksheets <gsperad.models.Worksheet>... | [
"Adds",
"a",
"new",
"worksheet",
"to",
"a",
"spreadsheet",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L245-L278 | train | Adds a new worksheet to a spreadsheet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.duplicate_sheet | def duplicate_sheet(
self,
source_sheet_id,
insert_sheet_index=None,
new_sheet_id=None,
new_sheet_name=None
):
"""Duplicates the contents of a sheet.
:param int source_sheet_id: The sheet ID to duplicate.
:param int insert_sheet_index: (optional) The ... | python | def duplicate_sheet(
self,
source_sheet_id,
insert_sheet_index=None,
new_sheet_id=None,
new_sheet_name=None
):
"""Duplicates the contents of a sheet.
:param int source_sheet_id: The sheet ID to duplicate.
:param int insert_sheet_index: (optional) The ... | [
"def",
"duplicate_sheet",
"(",
"self",
",",
"source_sheet_id",
",",
"insert_sheet_index",
"=",
"None",
",",
"new_sheet_id",
"=",
"None",
",",
"new_sheet_name",
"=",
"None",
")",
":",
"body",
"=",
"{",
"'requests'",
":",
"[",
"{",
"'duplicateSheet'",
":",
"{"... | Duplicates the contents of a sheet.
:param int source_sheet_id: The sheet ID to duplicate.
:param int insert_sheet_index: (optional) The zero-based index
where the new sheet should be inserted.
The index of all sheets after t... | [
"Duplicates",
"the",
"contents",
"of",
"a",
"sheet",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L280-L323 | train | Duplicate a worksheet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.share | def share(self, value, perm_type, role, notify=True, email_message=None, with_link=False):
"""Share the spreadsheet with other accounts.
:param value: user or group e-mail address, domain name
or None for 'default' type.
:type value: str, None
:param perm_type: The... | python | def share(self, value, perm_type, role, notify=True, email_message=None, with_link=False):
"""Share the spreadsheet with other accounts.
:param value: user or group e-mail address, domain name
or None for 'default' type.
:type value: str, None
:param perm_type: The... | [
"def",
"share",
"(",
"self",
",",
"value",
",",
"perm_type",
",",
"role",
",",
"notify",
"=",
"True",
",",
"email_message",
"=",
"None",
",",
"with_link",
"=",
"False",
")",
":",
"self",
".",
"client",
".",
"insert_permission",
"(",
"self",
".",
"id",
... | Share the spreadsheet with other accounts.
:param value: user or group e-mail address, domain name
or None for 'default' type.
:type value: str, None
:param perm_type: The account type.
Allowed values are: ``user``, ``group``, ``domain``,
``an... | [
"Share",
"the",
"spreadsheet",
"with",
"other",
"accounts",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L340-L378 | train | Share the spreadsheet with other accounts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Spreadsheet.remove_permissions | def remove_permissions(self, value, role='any'):
"""Remove permissions from a user or domain.
:param value: User or domain to remove permissions from
:type value: str
:param role: (optional) Permission to remove. Defaults to all
permissions.
:type role: str
... | python | def remove_permissions(self, value, role='any'):
"""Remove permissions from a user or domain.
:param value: User or domain to remove permissions from
:type value: str
:param role: (optional) Permission to remove. Defaults to all
permissions.
:type role: str
... | [
"def",
"remove_permissions",
"(",
"self",
",",
"value",
",",
"role",
"=",
"'any'",
")",
":",
"permission_list",
"=",
"self",
".",
"client",
".",
"list_permissions",
"(",
"self",
".",
"id",
")",
"key",
"=",
"'emailAddress'",
"if",
"'@'",
"in",
"value",
"e... | Remove permissions from a user or domain.
:param value: User or domain to remove permissions from
:type value: str
:param role: (optional) Permission to remove. Defaults to all
permissions.
:type role: str
Example::
# Remove Otto's write permis... | [
"Remove",
"permissions",
"from",
"a",
"user",
"or",
"domain",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L385-L414 | train | Remove permissions from a user or domain. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.acell | def acell(self, label, value_render_option='FORMATTED_VALUE'):
"""Returns an instance of a :class:`gspread.models.Cell`.
:param label: Cell label in A1 notation
Letter case is ignored.
:type label: str
:param value_render_option: (optional) Determines how values sh... | python | def acell(self, label, value_render_option='FORMATTED_VALUE'):
"""Returns an instance of a :class:`gspread.models.Cell`.
:param label: Cell label in A1 notation
Letter case is ignored.
:type label: str
:param value_render_option: (optional) Determines how values sh... | [
"def",
"acell",
"(",
"self",
",",
"label",
",",
"value_render_option",
"=",
"'FORMATTED_VALUE'",
")",
":",
"return",
"self",
".",
"cell",
"(",
"*",
"(",
"a1_to_rowcol",
"(",
"label",
")",
")",
",",
"value_render_option",
"=",
"value_render_option",
")"
] | Returns an instance of a :class:`gspread.models.Cell`.
:param label: Cell label in A1 notation
Letter case is ignored.
:type label: str
:param value_render_option: (optional) Determines how values should be
rendered in the the output. Se... | [
"Returns",
"an",
"instance",
"of",
"a",
":",
"class",
":",
"gspread",
".",
"models",
".",
"Cell",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L467-L490 | train | Returns an instance of a : class : gspread. models. Cell with the given label. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.cell | def cell(self, row, col, value_render_option='FORMATTED_VALUE'):
"""Returns an instance of a :class:`gspread.models.Cell` located at
`row` and `col` column.
:param row: Row number.
:type row: int
:param col: Column number.
:type col: int
:param value_render_optio... | python | def cell(self, row, col, value_render_option='FORMATTED_VALUE'):
"""Returns an instance of a :class:`gspread.models.Cell` located at
`row` and `col` column.
:param row: Row number.
:type row: int
:param col: Column number.
:type col: int
:param value_render_optio... | [
"def",
"cell",
"(",
"self",
",",
"row",
",",
"col",
",",
"value_render_option",
"=",
"'FORMATTED_VALUE'",
")",
":",
"range_label",
"=",
"'%s!%s'",
"%",
"(",
"self",
".",
"title",
",",
"rowcol_to_a1",
"(",
"row",
",",
"col",
")",
")",
"data",
"=",
"self... | Returns an instance of a :class:`gspread.models.Cell` located at
`row` and `col` column.
:param row: Row number.
:type row: int
:param col: Column number.
:type col: int
:param value_render_option: (optional) Determines how values should be
... | [
"Returns",
"an",
"instance",
"of",
"a",
":",
"class",
":",
"gspread",
".",
"models",
".",
"Cell",
"located",
"at",
"row",
"and",
"col",
"column",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L492-L525 | train | Returns an instance of a : class : ~gspread. models. Cell located at
row and col. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.range | def range(self, name):
"""Returns a list of :class:`Cell` objects from a specified range.
:param name: A string with range value in A1 notation, e.g. 'A1:A5'.
:type name: str
Alternatively, you may specify numeric boundaries. All values
index from 1 (one):
:param first... | python | def range(self, name):
"""Returns a list of :class:`Cell` objects from a specified range.
:param name: A string with range value in A1 notation, e.g. 'A1:A5'.
:type name: str
Alternatively, you may specify numeric boundaries. All values
index from 1 (one):
:param first... | [
"def",
"range",
"(",
"self",
",",
"name",
")",
":",
"range_label",
"=",
"'%s!%s'",
"%",
"(",
"self",
".",
"title",
",",
"name",
")",
"data",
"=",
"self",
".",
"spreadsheet",
".",
"values_get",
"(",
"range_label",
")",
"start",
",",
"end",
"=",
"name"... | Returns a list of :class:`Cell` objects from a specified range.
:param name: A string with range value in A1 notation, e.g. 'A1:A5'.
:type name: str
Alternatively, you may specify numeric boundaries. All values
index from 1 (one):
:param first_row: Row number
:type fir... | [
"Returns",
"a",
"list",
"of",
":",
"class",
":",
"Cell",
"objects",
"from",
"a",
"specified",
"range",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L528-L578 | train | Returns a list of Cell objects from a specified range. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.get_all_values | def get_all_values(self):
"""Returns a list of lists containing all cells' values as strings.
.. note::
Empty trailing rows and columns will not be included.
"""
data = self.spreadsheet.values_get(self.title)
try:
return fill_gaps(data['values'])
... | python | def get_all_values(self):
"""Returns a list of lists containing all cells' values as strings.
.. note::
Empty trailing rows and columns will not be included.
"""
data = self.spreadsheet.values_get(self.title)
try:
return fill_gaps(data['values'])
... | [
"def",
"get_all_values",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"spreadsheet",
".",
"values_get",
"(",
"self",
".",
"title",
")",
"try",
":",
"return",
"fill_gaps",
"(",
"data",
"[",
"'values'",
"]",
")",
"except",
"KeyError",
":",
"return",
... | Returns a list of lists containing all cells' values as strings.
.. note::
Empty trailing rows and columns will not be included. | [
"Returns",
"a",
"list",
"of",
"lists",
"containing",
"all",
"cells",
"values",
"as",
"strings",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L580-L593 | train | Returns a list of lists containing all cells values as strings. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.get_all_records | def get_all_records(
self,
empty2zero=False,
head=1,
default_blank="",
allow_underscores_in_numeric_literals=False,
):
"""Returns a list of dictionaries, all of them having the contents
of the spreadsheet with the head row as keys and each of these
... | python | def get_all_records(
self,
empty2zero=False,
head=1,
default_blank="",
allow_underscores_in_numeric_literals=False,
):
"""Returns a list of dictionaries, all of them having the contents
of the spreadsheet with the head row as keys and each of these
... | [
"def",
"get_all_records",
"(",
"self",
",",
"empty2zero",
"=",
"False",
",",
"head",
"=",
"1",
",",
"default_blank",
"=",
"\"\"",
",",
"allow_underscores_in_numeric_literals",
"=",
"False",
",",
")",
":",
"idx",
"=",
"head",
"-",
"1",
"data",
"=",
"self",
... | Returns a list of dictionaries, all of them having the contents
of the spreadsheet with the head row as keys and each of these
dictionaries holding the contents of subsequent rows of cells
as values.
Cell values are numericised (strings that can be read as ints
... | [
"Returns",
"a",
"list",
"of",
"dictionaries",
"all",
"of",
"them",
"having",
"the",
"contents",
"of",
"the",
"spreadsheet",
"with",
"the",
"head",
"row",
"as",
"keys",
"and",
"each",
"of",
"these",
"dictionaries",
"holding",
"the",
"contents",
"of",
"subsequ... | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L595-L645 | train | Returns a list of dictionaries containing all of the contents of the contents of the next cell in the spreadsheet. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.row_values | def row_values(self, row, value_render_option='FORMATTED_VALUE'):
"""Returns a list of all values in a `row`.
Empty cells in this list will be rendered as :const:`None`.
:param row: Row number.
:type row: int
:param value_render_option: (optional) Determines how values should b... | python | def row_values(self, row, value_render_option='FORMATTED_VALUE'):
"""Returns a list of all values in a `row`.
Empty cells in this list will be rendered as :const:`None`.
:param row: Row number.
:type row: int
:param value_render_option: (optional) Determines how values should b... | [
"def",
"row_values",
"(",
"self",
",",
"row",
",",
"value_render_option",
"=",
"'FORMATTED_VALUE'",
")",
":",
"range_label",
"=",
"'%s!A%s:%s'",
"%",
"(",
"self",
".",
"title",
",",
"row",
",",
"row",
")",
"data",
"=",
"self",
".",
"spreadsheet",
".",
"v... | Returns a list of all values in a `row`.
Empty cells in this list will be rendered as :const:`None`.
:param row: Row number.
:type row: int
:param value_render_option: (optional) Determines how values should be
rendered in the the output. See
... | [
"Returns",
"a",
"list",
"of",
"all",
"values",
"in",
"a",
"row",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L647-L673 | train | Returns a list of all values in a row. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.col_values | def col_values(self, col, value_render_option='FORMATTED_VALUE'):
"""Returns a list of all values in column `col`.
Empty cells in this list will be rendered as :const:`None`.
:param col: Column number.
:type col: int
:param value_render_option: (optional) Determines how values ... | python | def col_values(self, col, value_render_option='FORMATTED_VALUE'):
"""Returns a list of all values in column `col`.
Empty cells in this list will be rendered as :const:`None`.
:param col: Column number.
:type col: int
:param value_render_option: (optional) Determines how values ... | [
"def",
"col_values",
"(",
"self",
",",
"col",
",",
"value_render_option",
"=",
"'FORMATTED_VALUE'",
")",
":",
"start_label",
"=",
"rowcol_to_a1",
"(",
"1",
",",
"col",
")",
"range_label",
"=",
"'%s!%s:%s'",
"%",
"(",
"self",
".",
"title",
",",
"start_label",... | Returns a list of all values in column `col`.
Empty cells in this list will be rendered as :const:`None`.
:param col: Column number.
:type col: int
:param value_render_option: (optional) Determines how values should be
rendered in the the output. See... | [
"Returns",
"a",
"list",
"of",
"all",
"values",
"in",
"column",
"col",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L675-L705 | train | Returns a list of all values in column col. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.update_acell | def update_acell(self, label, value):
"""Updates the value of a cell.
:param label: Cell label in A1 notation.
Letter case is ignored.
:type label: str
:param value: New value.
Example::
worksheet.update_acell('A1', '42')
"""
... | python | def update_acell(self, label, value):
"""Updates the value of a cell.
:param label: Cell label in A1 notation.
Letter case is ignored.
:type label: str
:param value: New value.
Example::
worksheet.update_acell('A1', '42')
"""
... | [
"def",
"update_acell",
"(",
"self",
",",
"label",
",",
"value",
")",
":",
"return",
"self",
".",
"update_cell",
"(",
"*",
"(",
"a1_to_rowcol",
"(",
"label",
")",
")",
",",
"value",
"=",
"value",
")"
] | Updates the value of a cell.
:param label: Cell label in A1 notation.
Letter case is ignored.
:type label: str
:param value: New value.
Example::
worksheet.update_acell('A1', '42') | [
"Updates",
"the",
"value",
"of",
"a",
"cell",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L707-L720 | train | Updates the value of a cell in A1 notation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
burnash/gspread | gspread/models.py | Worksheet.update_cell | def update_cell(self, row, col, value):
"""Updates the value of a cell.
:param row: Row number.
:type row: int
:param col: Column number.
:type col: int
:param value: New value.
Example::
worksheet.update_cell(1, 1, '42')
"""
range_... | python | def update_cell(self, row, col, value):
"""Updates the value of a cell.
:param row: Row number.
:type row: int
:param col: Column number.
:type col: int
:param value: New value.
Example::
worksheet.update_cell(1, 1, '42')
"""
range_... | [
"def",
"update_cell",
"(",
"self",
",",
"row",
",",
"col",
",",
"value",
")",
":",
"range_label",
"=",
"'%s!%s'",
"%",
"(",
"self",
".",
"title",
",",
"rowcol_to_a1",
"(",
"row",
",",
"col",
")",
")",
"data",
"=",
"self",
".",
"spreadsheet",
".",
"... | Updates the value of a cell.
:param row: Row number.
:type row: int
:param col: Column number.
:type col: int
:param value: New value.
Example::
worksheet.update_cell(1, 1, '42') | [
"Updates",
"the",
"value",
"of",
"a",
"cell",
"."
] | 0e8debe208095aeed3e3e7136c2fa5cd74090946 | https://github.com/burnash/gspread/blob/0e8debe208095aeed3e3e7136c2fa5cd74090946/gspread/models.py#L722-L748 | train | Updates the value of a cell. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.