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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py | UnorderedResultCollector.notify_ready | def notify_ready(self, apply_result):
"""Called by the ApplyResult object (already registered via
register_result()) that it is now ready (ie. the Job's result
is available or an exception has been raised).
\param apply_result ApplyResult object telling us that the job
has been p... | python | def notify_ready(self, apply_result):
"""Called by the ApplyResult object (already registered via
register_result()) that it is now ready (ie. the Job's result
is available or an exception has been raised).
\param apply_result ApplyResult object telling us that the job
has been p... | [
"def",
"notify_ready",
"(",
"self",
",",
"apply_result",
")",
":",
"first_item",
"=",
"False",
"self",
".",
"_cond",
".",
"acquire",
"(",
")",
"try",
":",
"self",
".",
"_collection",
".",
"append",
"(",
"apply_result",
")",
"first_item",
"=",
"len",
"(",... | Called by the ApplyResult object (already registered via
register_result()) that it is now ready (ie. the Job's result
is available or an exception has been raised).
\param apply_result ApplyResult object telling us that the job
has been processed | [
"Called",
"by",
"the",
"ApplyResult",
"object",
"(",
"already",
"registered",
"via",
"register_result",
"()",
")",
"that",
"it",
"is",
"now",
"ready",
"(",
"ie",
".",
"the",
"Job",
"s",
"result",
"is",
"available",
"or",
"an",
"exception",
"has",
"been",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L542-L560 | train | Called by the ApplyResult object telling us that the job s result
is ready. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py | OrderedResultCollector._get_result | def _get_result(self, idx, timeout=None):
"""Called by the CollectorIterator object to retrieve the
result's values one after another (order defined by the
implementation)
\param idx The index of the result we want, wrt collector's order
\param timeout integer telling how long to... | python | def _get_result(self, idx, timeout=None):
"""Called by the CollectorIterator object to retrieve the
result's values one after another (order defined by the
implementation)
\param idx The index of the result we want, wrt collector's order
\param timeout integer telling how long to... | [
"def",
"_get_result",
"(",
"self",
",",
"idx",
",",
"timeout",
"=",
"None",
")",
":",
"res",
"=",
"self",
".",
"_results",
"[",
"idx",
"]",
"res",
".",
"wait",
"(",
"timeout",
")",
"return",
"res"
] | Called by the CollectorIterator object to retrieve the
result's values one after another (order defined by the
implementation)
\param idx The index of the result we want, wrt collector's order
\param timeout integer telling how long to wait (in seconds)
for the result at index id... | [
"Called",
"by",
"the",
"CollectorIterator",
"object",
"to",
"retrieve",
"the",
"result",
"s",
"values",
"one",
"after",
"another",
"(",
"order",
"defined",
"by",
"the",
"implementation",
")",
"\\",
"param",
"idx",
"The",
"index",
"of",
"the",
"result",
"we",... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L594-L605 | train | Returns the values one after another | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py | OrderedResultCollector.notify_ready | def notify_ready(self, apply_result):
"""Called by the ApplyResult object (already registered via
register_result()) that it is now ready (ie. the Job's result
is available or an exception has been raised).
\param apply_result ApplyResult object telling us that the job
has been p... | python | def notify_ready(self, apply_result):
"""Called by the ApplyResult object (already registered via
register_result()) that it is now ready (ie. the Job's result
is available or an exception has been raised).
\param apply_result ApplyResult object telling us that the job
has been p... | [
"def",
"notify_ready",
"(",
"self",
",",
"apply_result",
")",
":",
"got_first",
"=",
"False",
"got_last",
"=",
"False",
"self",
".",
"_lock",
".",
"acquire",
"(",
")",
"try",
":",
"assert",
"self",
".",
"_remaining",
">",
"0",
"got_first",
"=",
"len",
... | Called by the ApplyResult object (already registered via
register_result()) that it is now ready (ie. the Job's result
is available or an exception has been raised).
\param apply_result ApplyResult object telling us that the job
has been processed | [
"Called",
"by",
"the",
"ApplyResult",
"object",
"(",
"already",
"registered",
"via",
"register_result",
"()",
")",
"that",
"it",
"is",
"now",
"ready",
"(",
"ie",
".",
"the",
"Job",
"s",
"result",
"is",
"available",
"or",
"an",
"exception",
"has",
"been",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L607-L634 | train | Called by the ApplyResult object telling us that the job s result
is ready. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/network.py | command | def command(sock, dbname, spec, slave_ok, is_mongos,
read_preference, codec_options, check=True,
allowable_errors=None, address=None,
check_keys=False, listeners=None, max_bson_size=None,
read_concern=DEFAULT_READ_CONCERN,
parse_write_concern_error=False,
... | python | def command(sock, dbname, spec, slave_ok, is_mongos,
read_preference, codec_options, check=True,
allowable_errors=None, address=None,
check_keys=False, listeners=None, max_bson_size=None,
read_concern=DEFAULT_READ_CONCERN,
parse_write_concern_error=False,
... | [
"def",
"command",
"(",
"sock",
",",
"dbname",
",",
"spec",
",",
"slave_ok",
",",
"is_mongos",
",",
"read_preference",
",",
"codec_options",
",",
"check",
"=",
"True",
",",
"allowable_errors",
"=",
"None",
",",
"address",
"=",
"None",
",",
"check_keys",
"="... | Execute a command over the socket, or raise socket.error.
:Parameters:
- `sock`: a raw socket instance
- `dbname`: name of the database on which to run the command
- `spec`: a command document as a dict, SON, or mapping object
- `slave_ok`: whether to set the SlaveOkay wire protocol bit
... | [
"Execute",
"a",
"command",
"over",
"the",
"socket",
"or",
"raise",
"socket",
".",
"error",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/network.py#L48-L131 | train | Execute a command over a socket. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/network.py | receive_message | def receive_message(
sock, operation, request_id, max_message_size=MAX_MESSAGE_SIZE):
"""Receive a raw BSON message or raise socket.error."""
header = _receive_data_on_socket(sock, 16)
length = _UNPACK_INT(header[:4])[0]
actual_op = _UNPACK_INT(header[12:])[0]
if operation != actual_op:
... | python | def receive_message(
sock, operation, request_id, max_message_size=MAX_MESSAGE_SIZE):
"""Receive a raw BSON message or raise socket.error."""
header = _receive_data_on_socket(sock, 16)
length = _UNPACK_INT(header[:4])[0]
actual_op = _UNPACK_INT(header[12:])[0]
if operation != actual_op:
... | [
"def",
"receive_message",
"(",
"sock",
",",
"operation",
",",
"request_id",
",",
"max_message_size",
"=",
"MAX_MESSAGE_SIZE",
")",
":",
"header",
"=",
"_receive_data_on_socket",
"(",
"sock",
",",
"16",
")",
"length",
"=",
"_UNPACK_INT",
"(",
"header",
"[",
":"... | Receive a raw BSON message or raise socket.error. | [
"Receive",
"a",
"raw",
"BSON",
"message",
"or",
"raise",
"socket",
".",
"error",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/network.py#L134-L157 | train | Receive a BSON message from the socket. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tls/datadog_checks/tls/tls.py | TLSCheck.create_connection | def create_connection(self):
"""See: https://github.com/python/cpython/blob/40ee9a3640d702bce127e9877c82a99ce817f0d1/Lib/socket.py#L691"""
err = None
try:
for res in socket.getaddrinfo(self._server, self._port, 0, self._sock_type):
af, socktype, proto, canonname, sa =... | python | def create_connection(self):
"""See: https://github.com/python/cpython/blob/40ee9a3640d702bce127e9877c82a99ce817f0d1/Lib/socket.py#L691"""
err = None
try:
for res in socket.getaddrinfo(self._server, self._port, 0, self._sock_type):
af, socktype, proto, canonname, sa =... | [
"def",
"create_connection",
"(",
"self",
")",
":",
"err",
"=",
"None",
"try",
":",
"for",
"res",
"in",
"socket",
".",
"getaddrinfo",
"(",
"self",
".",
"_server",
",",
"self",
".",
"_port",
",",
"0",
",",
"self",
".",
"_sock_type",
")",
":",
"af",
"... | See: https://github.com/python/cpython/blob/40ee9a3640d702bce127e9877c82a99ce817f0d1/Lib/socket.py#L691 | [
"See",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"python",
"/",
"cpython",
"/",
"blob",
"/",
"40ee9a3640d702bce127e9877c82a99ce817f0d1",
"/",
"Lib",
"/",
"socket",
".",
"py#L691"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tls/datadog_checks/tls/tls.py#L270-L299 | train | Create a connection to the server and return the socket 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | dumps | def dumps(obj, *args, **kwargs):
"""Helper function that wraps :func:`json.dumps`.
Recursive function that handles all BSON types including
:class:`~bson.binary.Binary` and :class:`~bson.code.Code`.
:Parameters:
- `json_options`: A :class:`JSONOptions` instance used to modify the
encodin... | python | def dumps(obj, *args, **kwargs):
"""Helper function that wraps :func:`json.dumps`.
Recursive function that handles all BSON types including
:class:`~bson.binary.Binary` and :class:`~bson.code.Code`.
:Parameters:
- `json_options`: A :class:`JSONOptions` instance used to modify the
encodin... | [
"def",
"dumps",
"(",
"obj",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"json_options",
"=",
"kwargs",
".",
"pop",
"(",
"\"json_options\"",
",",
"DEFAULT_JSON_OPTIONS",
")",
"return",
"json",
".",
"dumps",
"(",
"_json_convert",
"(",
"obj",
",",
... | Helper function that wraps :func:`json.dumps`.
Recursive function that handles all BSON types including
:class:`~bson.binary.Binary` and :class:`~bson.code.Code`.
:Parameters:
- `json_options`: A :class:`JSONOptions` instance used to modify the
encoding of MongoDB Extended JSON types. Defaul... | [
"Helper",
"function",
"that",
"wraps",
":",
"func",
":",
"json",
".",
"dumps",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L384-L403 | train | Wrapper function that wraps json. dumps. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | loads | def loads(s, *args, **kwargs):
"""Helper function that wraps :func:`json.loads`.
Automatically passes the object_hook for BSON type conversion.
Raises ``TypeError``, ``ValueError``, ``KeyError``, or
:exc:`~bson.errors.InvalidId` on invalid MongoDB Extended JSON.
:Parameters:
- `json_options... | python | def loads(s, *args, **kwargs):
"""Helper function that wraps :func:`json.loads`.
Automatically passes the object_hook for BSON type conversion.
Raises ``TypeError``, ``ValueError``, ``KeyError``, or
:exc:`~bson.errors.InvalidId` on invalid MongoDB Extended JSON.
:Parameters:
- `json_options... | [
"def",
"loads",
"(",
"s",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"json_options",
"=",
"kwargs",
".",
"pop",
"(",
"\"json_options\"",
",",
"DEFAULT_JSON_OPTIONS",
")",
"if",
"_HAS_OBJECT_PAIRS_HOOK",
":",
"kwargs",
"[",
"\"object_pairs_hook\"",
... | Helper function that wraps :func:`json.loads`.
Automatically passes the object_hook for BSON type conversion.
Raises ``TypeError``, ``ValueError``, ``KeyError``, or
:exc:`~bson.errors.InvalidId` on invalid MongoDB Extended JSON.
:Parameters:
- `json_options`: A :class:`JSONOptions` instance use... | [
"Helper",
"function",
"that",
"wraps",
":",
"func",
":",
"json",
".",
"loads",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L406-L433 | train | A wrapper function that wraps json. loads. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _json_convert | def _json_convert(obj, json_options=DEFAULT_JSON_OPTIONS):
"""Recursive helper method that converts BSON types so they can be
converted into json.
"""
if hasattr(obj, 'iteritems') or hasattr(obj, 'items'): # PY3 support
return SON(((k, _json_convert(v, json_options))
for k, ... | python | def _json_convert(obj, json_options=DEFAULT_JSON_OPTIONS):
"""Recursive helper method that converts BSON types so they can be
converted into json.
"""
if hasattr(obj, 'iteritems') or hasattr(obj, 'items'): # PY3 support
return SON(((k, _json_convert(v, json_options))
for k, ... | [
"def",
"_json_convert",
"(",
"obj",
",",
"json_options",
"=",
"DEFAULT_JSON_OPTIONS",
")",
":",
"if",
"hasattr",
"(",
"obj",
",",
"'iteritems'",
")",
"or",
"hasattr",
"(",
"obj",
",",
"'items'",
")",
":",
"# PY3 support",
"return",
"SON",
"(",
"(",
"(",
... | Recursive helper method that converts BSON types so they can be
converted into json. | [
"Recursive",
"helper",
"method",
"that",
"converts",
"BSON",
"types",
"so",
"they",
"can",
"be",
"converted",
"into",
"json",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L436-L448 | train | Recursive helper method that converts BSON types so they can be
converted into json.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_datetime | def _parse_canonical_datetime(doc, json_options):
"""Decode a JSON datetime to python datetime.datetime."""
dtm = doc["$date"]
if len(doc) != 1:
raise TypeError('Bad $date, extra field(s): %s' % (doc,))
# mongoexport 2.6 and newer
if isinstance(dtm, string_type):
# Parse offset
... | python | def _parse_canonical_datetime(doc, json_options):
"""Decode a JSON datetime to python datetime.datetime."""
dtm = doc["$date"]
if len(doc) != 1:
raise TypeError('Bad $date, extra field(s): %s' % (doc,))
# mongoexport 2.6 and newer
if isinstance(dtm, string_type):
# Parse offset
... | [
"def",
"_parse_canonical_datetime",
"(",
"doc",
",",
"json_options",
")",
":",
"dtm",
"=",
"doc",
"[",
"\"$date\"",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $date, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
... | Decode a JSON datetime to python datetime.datetime. | [
"Decode",
"a",
"JSON",
"datetime",
"to",
"python",
"datetime",
".",
"datetime",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L560-L616 | train | Decode a JSON datetime to python datetime. datetime. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_symbol | def _parse_canonical_symbol(doc):
"""Decode a JSON symbol to Python string."""
symbol = doc['$symbol']
if len(doc) != 1:
raise TypeError('Bad $symbol, extra field(s): %s' % (doc,))
return text_type(symbol) | python | def _parse_canonical_symbol(doc):
"""Decode a JSON symbol to Python string."""
symbol = doc['$symbol']
if len(doc) != 1:
raise TypeError('Bad $symbol, extra field(s): %s' % (doc,))
return text_type(symbol) | [
"def",
"_parse_canonical_symbol",
"(",
"doc",
")",
":",
"symbol",
"=",
"doc",
"[",
"'$symbol'",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $symbol, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
")",
"return",
"... | Decode a JSON symbol to Python string. | [
"Decode",
"a",
"JSON",
"symbol",
"to",
"Python",
"string",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L626-L631 | train | Decode a JSON symbol to Python 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_code | def _parse_canonical_code(doc):
"""Decode a JSON code to bson.code.Code."""
for key in doc:
if key not in ('$code', '$scope'):
raise TypeError('Bad $code, extra field(s): %s' % (doc,))
return Code(doc['$code'], scope=doc.get('$scope')) | python | def _parse_canonical_code(doc):
"""Decode a JSON code to bson.code.Code."""
for key in doc:
if key not in ('$code', '$scope'):
raise TypeError('Bad $code, extra field(s): %s' % (doc,))
return Code(doc['$code'], scope=doc.get('$scope')) | [
"def",
"_parse_canonical_code",
"(",
"doc",
")",
":",
"for",
"key",
"in",
"doc",
":",
"if",
"key",
"not",
"in",
"(",
"'$code'",
",",
"'$scope'",
")",
":",
"raise",
"TypeError",
"(",
"'Bad $code, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
")",
"retu... | Decode a JSON code to bson.code.Code. | [
"Decode",
"a",
"JSON",
"code",
"to",
"bson",
".",
"code",
".",
"Code",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L634-L639 | train | Decode a JSON code to bson. code. 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_regex | def _parse_canonical_regex(doc):
"""Decode a JSON regex to bson.regex.Regex."""
regex = doc['$regularExpression']
if len(doc) != 1:
raise TypeError('Bad $regularExpression, extra field(s): %s' % (doc,))
if len(regex) != 2:
raise TypeError('Bad $regularExpression must include only "patter... | python | def _parse_canonical_regex(doc):
"""Decode a JSON regex to bson.regex.Regex."""
regex = doc['$regularExpression']
if len(doc) != 1:
raise TypeError('Bad $regularExpression, extra field(s): %s' % (doc,))
if len(regex) != 2:
raise TypeError('Bad $regularExpression must include only "patter... | [
"def",
"_parse_canonical_regex",
"(",
"doc",
")",
":",
"regex",
"=",
"doc",
"[",
"'$regularExpression'",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $regularExpression, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
... | Decode a JSON regex to bson.regex.Regex. | [
"Decode",
"a",
"JSON",
"regex",
"to",
"bson",
".",
"regex",
".",
"Regex",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L642-L650 | train | Decode a JSON regex to bson. regex. Regex. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_dbref | def _parse_canonical_dbref(doc):
"""Decode a JSON DBRef to bson.dbref.DBRef."""
for key in doc:
if key.startswith('$') and key not in _DBREF_KEYS:
# Other keys start with $, so dct cannot be parsed as a DBRef.
return doc
return DBRef(doc.pop('$ref'), doc.pop('$id'),
... | python | def _parse_canonical_dbref(doc):
"""Decode a JSON DBRef to bson.dbref.DBRef."""
for key in doc:
if key.startswith('$') and key not in _DBREF_KEYS:
# Other keys start with $, so dct cannot be parsed as a DBRef.
return doc
return DBRef(doc.pop('$ref'), doc.pop('$id'),
... | [
"def",
"_parse_canonical_dbref",
"(",
"doc",
")",
":",
"for",
"key",
"in",
"doc",
":",
"if",
"key",
".",
"startswith",
"(",
"'$'",
")",
"and",
"key",
"not",
"in",
"_DBREF_KEYS",
":",
"# Other keys start with $, so dct cannot be parsed as a DBRef.",
"return",
"doc"... | Decode a JSON DBRef to bson.dbref.DBRef. | [
"Decode",
"a",
"JSON",
"DBRef",
"to",
"bson",
".",
"dbref",
".",
"DBRef",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L653-L660 | train | Decode a JSON DBRef to bson. dbref. DBRef. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_dbpointer | def _parse_canonical_dbpointer(doc):
"""Decode a JSON (deprecated) DBPointer to bson.dbref.DBRef."""
dbref = doc['$dbPointer']
if len(doc) != 1:
raise TypeError('Bad $dbPointer, extra field(s): %s' % (doc,))
if isinstance(dbref, DBRef):
dbref_doc = dbref.as_doc()
# DBPointer must... | python | def _parse_canonical_dbpointer(doc):
"""Decode a JSON (deprecated) DBPointer to bson.dbref.DBRef."""
dbref = doc['$dbPointer']
if len(doc) != 1:
raise TypeError('Bad $dbPointer, extra field(s): %s' % (doc,))
if isinstance(dbref, DBRef):
dbref_doc = dbref.as_doc()
# DBPointer must... | [
"def",
"_parse_canonical_dbpointer",
"(",
"doc",
")",
":",
"dbref",
"=",
"doc",
"[",
"'$dbPointer'",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $dbPointer, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
")",
"if",... | Decode a JSON (deprecated) DBPointer to bson.dbref.DBRef. | [
"Decode",
"a",
"JSON",
"(",
"deprecated",
")",
"DBPointer",
"to",
"bson",
".",
"dbref",
".",
"DBRef",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L663-L682 | train | Decode a JSON ( deprecated ) DBPointer to bson. dbref. DBRef. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_int32 | def _parse_canonical_int32(doc):
"""Decode a JSON int32 to python int."""
i_str = doc['$numberInt']
if len(doc) != 1:
raise TypeError('Bad $numberInt, extra field(s): %s' % (doc,))
if not isinstance(i_str, string_type):
raise TypeError('$numberInt must be string: %s' % (doc,))
return... | python | def _parse_canonical_int32(doc):
"""Decode a JSON int32 to python int."""
i_str = doc['$numberInt']
if len(doc) != 1:
raise TypeError('Bad $numberInt, extra field(s): %s' % (doc,))
if not isinstance(i_str, string_type):
raise TypeError('$numberInt must be string: %s' % (doc,))
return... | [
"def",
"_parse_canonical_int32",
"(",
"doc",
")",
":",
"i_str",
"=",
"doc",
"[",
"'$numberInt'",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $numberInt, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
")",
"if",
"... | Decode a JSON int32 to python int. | [
"Decode",
"a",
"JSON",
"int32",
"to",
"python",
"int",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L685-L692 | train | Decode a JSON int32 to python int. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_int64 | def _parse_canonical_int64(doc):
"""Decode a JSON int64 to bson.int64.Int64."""
l_str = doc['$numberLong']
if len(doc) != 1:
raise TypeError('Bad $numberLong, extra field(s): %s' % (doc,))
return Int64(l_str) | python | def _parse_canonical_int64(doc):
"""Decode a JSON int64 to bson.int64.Int64."""
l_str = doc['$numberLong']
if len(doc) != 1:
raise TypeError('Bad $numberLong, extra field(s): %s' % (doc,))
return Int64(l_str) | [
"def",
"_parse_canonical_int64",
"(",
"doc",
")",
":",
"l_str",
"=",
"doc",
"[",
"'$numberLong'",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $numberLong, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
")",
"return... | Decode a JSON int64 to bson.int64.Int64. | [
"Decode",
"a",
"JSON",
"int64",
"to",
"bson",
".",
"int64",
".",
"Int64",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L695-L700 | train | Decode a JSON int64 to bson. int64. Int64. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_double | def _parse_canonical_double(doc):
"""Decode a JSON double to python float."""
d_str = doc['$numberDouble']
if len(doc) != 1:
raise TypeError('Bad $numberDouble, extra field(s): %s' % (doc,))
if not isinstance(d_str, string_type):
raise TypeError('$numberDouble must be string: %s' % (doc,... | python | def _parse_canonical_double(doc):
"""Decode a JSON double to python float."""
d_str = doc['$numberDouble']
if len(doc) != 1:
raise TypeError('Bad $numberDouble, extra field(s): %s' % (doc,))
if not isinstance(d_str, string_type):
raise TypeError('$numberDouble must be string: %s' % (doc,... | [
"def",
"_parse_canonical_double",
"(",
"doc",
")",
":",
"d_str",
"=",
"doc",
"[",
"'$numberDouble'",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $numberDouble, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
")",
"i... | Decode a JSON double to python float. | [
"Decode",
"a",
"JSON",
"double",
"to",
"python",
"float",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L703-L710 | train | Decode a JSON double to python float. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_decimal128 | def _parse_canonical_decimal128(doc):
"""Decode a JSON decimal128 to bson.decimal128.Decimal128."""
d_str = doc['$numberDecimal']
if len(doc) != 1:
raise TypeError('Bad $numberDecimal, extra field(s): %s' % (doc,))
if not isinstance(d_str, string_type):
raise TypeError('$numberDecimal mu... | python | def _parse_canonical_decimal128(doc):
"""Decode a JSON decimal128 to bson.decimal128.Decimal128."""
d_str = doc['$numberDecimal']
if len(doc) != 1:
raise TypeError('Bad $numberDecimal, extra field(s): %s' % (doc,))
if not isinstance(d_str, string_type):
raise TypeError('$numberDecimal mu... | [
"def",
"_parse_canonical_decimal128",
"(",
"doc",
")",
":",
"d_str",
"=",
"doc",
"[",
"'$numberDecimal'",
"]",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",
"raise",
"TypeError",
"(",
"'Bad $numberDecimal, extra field(s): %s'",
"%",
"(",
"doc",
",",
")",
")"... | Decode a JSON decimal128 to bson.decimal128.Decimal128. | [
"Decode",
"a",
"JSON",
"decimal128",
"to",
"bson",
".",
"decimal128",
".",
"Decimal128",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L713-L720 | train | Decode a JSON decimal128 to bson. decimal128. Decimal128. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_minkey | def _parse_canonical_minkey(doc):
"""Decode a JSON MinKey to bson.min_key.MinKey."""
if doc['$minKey'] is not 1:
raise TypeError('$minKey value must be 1: %s' % (doc,))
if len(doc) != 1:
raise TypeError('Bad $minKey, extra field(s): %s' % (doc,))
return MinKey() | python | def _parse_canonical_minkey(doc):
"""Decode a JSON MinKey to bson.min_key.MinKey."""
if doc['$minKey'] is not 1:
raise TypeError('$minKey value must be 1: %s' % (doc,))
if len(doc) != 1:
raise TypeError('Bad $minKey, extra field(s): %s' % (doc,))
return MinKey() | [
"def",
"_parse_canonical_minkey",
"(",
"doc",
")",
":",
"if",
"doc",
"[",
"'$minKey'",
"]",
"is",
"not",
"1",
":",
"raise",
"TypeError",
"(",
"'$minKey value must be 1: %s'",
"%",
"(",
"doc",
",",
")",
")",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",... | Decode a JSON MinKey to bson.min_key.MinKey. | [
"Decode",
"a",
"JSON",
"MinKey",
"to",
"bson",
".",
"min_key",
".",
"MinKey",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L723-L729 | train | Decode a JSON MinKey to bson. min_key. MinKey. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/json_util.py | _parse_canonical_maxkey | def _parse_canonical_maxkey(doc):
"""Decode a JSON MaxKey to bson.max_key.MaxKey."""
if doc['$maxKey'] is not 1:
raise TypeError('$maxKey value must be 1: %s', (doc,))
if len(doc) != 1:
raise TypeError('Bad $minKey, extra field(s): %s' % (doc,))
return MaxKey() | python | def _parse_canonical_maxkey(doc):
"""Decode a JSON MaxKey to bson.max_key.MaxKey."""
if doc['$maxKey'] is not 1:
raise TypeError('$maxKey value must be 1: %s', (doc,))
if len(doc) != 1:
raise TypeError('Bad $minKey, extra field(s): %s' % (doc,))
return MaxKey() | [
"def",
"_parse_canonical_maxkey",
"(",
"doc",
")",
":",
"if",
"doc",
"[",
"'$maxKey'",
"]",
"is",
"not",
"1",
":",
"raise",
"TypeError",
"(",
"'$maxKey value must be 1: %s'",
",",
"(",
"doc",
",",
")",
")",
"if",
"len",
"(",
"doc",
")",
"!=",
"1",
":",... | Decode a JSON MaxKey to bson.max_key.MaxKey. | [
"Decode",
"a",
"JSON",
"MaxKey",
"to",
"bson",
".",
"max_key",
".",
"MaxKey",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/json_util.py#L732-L738 | train | Decode a JSON MaxKey to bson. max_key. MaxKey. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/client_options.py | _parse_credentials | def _parse_credentials(username, password, database, options):
"""Parse authentication credentials."""
mechanism = options.get('authmechanism', 'DEFAULT')
if username is None and mechanism != 'MONGODB-X509':
return None
source = options.get('authsource', database or 'admin')
return _build_cr... | python | def _parse_credentials(username, password, database, options):
"""Parse authentication credentials."""
mechanism = options.get('authmechanism', 'DEFAULT')
if username is None and mechanism != 'MONGODB-X509':
return None
source = options.get('authsource', database or 'admin')
return _build_cr... | [
"def",
"_parse_credentials",
"(",
"username",
",",
"password",
",",
"database",
",",
"options",
")",
":",
"mechanism",
"=",
"options",
".",
"get",
"(",
"'authmechanism'",
",",
"'DEFAULT'",
")",
"if",
"username",
"is",
"None",
"and",
"mechanism",
"!=",
"'MONG... | Parse authentication credentials. | [
"Parse",
"authentication",
"credentials",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/client_options.py#L31-L38 | train | Parse authentication 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/client_options.py | _parse_read_preference | def _parse_read_preference(options):
"""Parse read preference options."""
if 'read_preference' in options:
return options['read_preference']
name = options.get('readpreference', 'primary')
mode = read_pref_mode_from_name(name)
tags = options.get('readpreferencetags')
max_staleness = opt... | python | def _parse_read_preference(options):
"""Parse read preference options."""
if 'read_preference' in options:
return options['read_preference']
name = options.get('readpreference', 'primary')
mode = read_pref_mode_from_name(name)
tags = options.get('readpreferencetags')
max_staleness = opt... | [
"def",
"_parse_read_preference",
"(",
"options",
")",
":",
"if",
"'read_preference'",
"in",
"options",
":",
"return",
"options",
"[",
"'read_preference'",
"]",
"name",
"=",
"options",
".",
"get",
"(",
"'readpreference'",
",",
"'primary'",
")",
"mode",
"=",
"re... | Parse read preference options. | [
"Parse",
"read",
"preference",
"options",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/client_options.py#L41-L50 | train | Parse read preference options. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/client_options.py | _parse_pool_options | def _parse_pool_options(options):
"""Parse connection pool options."""
max_pool_size = options.get('maxpoolsize', common.MAX_POOL_SIZE)
min_pool_size = options.get('minpoolsize', common.MIN_POOL_SIZE)
max_idle_time_ms = options.get('maxidletimems', common.MAX_IDLE_TIME_MS)
if max_pool_size is not No... | python | def _parse_pool_options(options):
"""Parse connection pool options."""
max_pool_size = options.get('maxpoolsize', common.MAX_POOL_SIZE)
min_pool_size = options.get('minpoolsize', common.MIN_POOL_SIZE)
max_idle_time_ms = options.get('maxidletimems', common.MAX_IDLE_TIME_MS)
if max_pool_size is not No... | [
"def",
"_parse_pool_options",
"(",
"options",
")",
":",
"max_pool_size",
"=",
"options",
".",
"get",
"(",
"'maxpoolsize'",
",",
"common",
".",
"MAX_POOL_SIZE",
")",
"min_pool_size",
"=",
"options",
".",
"get",
"(",
"'minpoolsize'",
",",
"common",
".",
"MIN_POO... | Parse connection pool options. | [
"Parse",
"connection",
"pool",
"options",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/client_options.py#L101-L123 | train | Parse connection pool options. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/service_checks.py | service_checks | def service_checks():
"""Validate all `service_checks.json` files."""
root = get_root()
echo_info("Validating all service_checks.json files...")
failed_checks = 0
ok_checks = 0
for check_name in sorted(os.listdir(root)):
service_checks_file = os.path.join(root, check_name, 'service_check... | python | def service_checks():
"""Validate all `service_checks.json` files."""
root = get_root()
echo_info("Validating all service_checks.json files...")
failed_checks = 0
ok_checks = 0
for check_name in sorted(os.listdir(root)):
service_checks_file = os.path.join(root, check_name, 'service_check... | [
"def",
"service_checks",
"(",
")",
":",
"root",
"=",
"get_root",
"(",
")",
"echo_info",
"(",
"\"Validating all service_checks.json files...\"",
")",
"failed_checks",
"=",
"0",
"ok_checks",
"=",
"0",
"for",
"check_name",
"in",
"sorted",
"(",
"os",
".",
"listdir",... | Validate all `service_checks.json` files. | [
"Validate",
"all",
"service_checks",
".",
"json",
"files",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/service_checks.py#L21-L130 | train | Validate all service_checks. json files. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | from_time | def from_time(
year=None, month=None, day=None, hours=None, minutes=None, seconds=None, microseconds=None, timezone=None
):
"""Convenience wrapper to take a series of date/time elements and return a WMI time
of the form `yyyymmddHHMMSS.mmmmmm+UUU`. All elements may be int, string or
omitted altogether. ... | python | def from_time(
year=None, month=None, day=None, hours=None, minutes=None, seconds=None, microseconds=None, timezone=None
):
"""Convenience wrapper to take a series of date/time elements and return a WMI time
of the form `yyyymmddHHMMSS.mmmmmm+UUU`. All elements may be int, string or
omitted altogether. ... | [
"def",
"from_time",
"(",
"year",
"=",
"None",
",",
"month",
"=",
"None",
",",
"day",
"=",
"None",
",",
"hours",
"=",
"None",
",",
"minutes",
"=",
"None",
",",
"seconds",
"=",
"None",
",",
"microseconds",
"=",
"None",
",",
"timezone",
"=",
"None",
"... | Convenience wrapper to take a series of date/time elements and return a WMI time
of the form `yyyymmddHHMMSS.mmmmmm+UUU`. All elements may be int, string or
omitted altogether. If omitted, they will be replaced in the output string
by a series of stars of the appropriate length.
:param year: The year el... | [
"Convenience",
"wrapper",
"to",
"take",
"a",
"series",
"of",
"date",
"/",
"time",
"elements",
"and",
"return",
"a",
"WMI",
"time",
"of",
"the",
"form",
"yyyymmddHHMMSS",
".",
"mmmmmm",
"+",
"UUU",
".",
"All",
"elements",
"may",
"be",
"int",
"string",
"or... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L263-L311 | train | Convenience wrapper to take a series of date and time elements and return a WMI time
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | to_time | def to_time(wmi_time):
"""Convenience wrapper to take a WMI datetime string of the form
yyyymmddHHMMSS.mmmmmm+UUU and return a 9-tuple containing the
individual elements, or None where string contains placeholder
stars.
:param wmi_time: The WMI datetime string in `yyyymmddHHMMSS.mmmmmm+UUU` format
... | python | def to_time(wmi_time):
"""Convenience wrapper to take a WMI datetime string of the form
yyyymmddHHMMSS.mmmmmm+UUU and return a 9-tuple containing the
individual elements, or None where string contains placeholder
stars.
:param wmi_time: The WMI datetime string in `yyyymmddHHMMSS.mmmmmm+UUU` format
... | [
"def",
"to_time",
"(",
"wmi_time",
")",
":",
"def",
"int_or_none",
"(",
"s",
",",
"start",
",",
"end",
")",
":",
"try",
":",
"return",
"int",
"(",
"s",
"[",
"start",
":",
"end",
"]",
")",
"except",
"ValueError",
":",
"return",
"None",
"year",
"=",
... | Convenience wrapper to take a WMI datetime string of the form
yyyymmddHHMMSS.mmmmmm+UUU and return a 9-tuple containing the
individual elements, or None where string contains placeholder
stars.
:param wmi_time: The WMI datetime string in `yyyymmddHHMMSS.mmmmmm+UUU` format
:returns: A 9-tuple of (y... | [
"Convenience",
"wrapper",
"to",
"take",
"a",
"WMI",
"datetime",
"string",
"of",
"the",
"form",
"yyyymmddHHMMSS",
".",
"mmmmmm",
"+",
"UUU",
"and",
"return",
"a",
"9",
"-",
"tuple",
"containing",
"the",
"individual",
"elements",
"or",
"None",
"where",
"string... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L314-L343 | train | Convert a WMI time string into a 9 - tuple. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | WinWMICheck._format_tag_query | def _format_tag_query(self, sampler, wmi_obj, tag_query):
"""
Format `tag_query` or raise on incorrect parameters.
"""
try:
link_source_property = int(wmi_obj[tag_query[0]])
target_class = tag_query[1]
link_target_class_property = tag_query[2]
... | python | def _format_tag_query(self, sampler, wmi_obj, tag_query):
"""
Format `tag_query` or raise on incorrect parameters.
"""
try:
link_source_property = int(wmi_obj[tag_query[0]])
target_class = tag_query[1]
link_target_class_property = tag_query[2]
... | [
"def",
"_format_tag_query",
"(",
"self",
",",
"sampler",
",",
"wmi_obj",
",",
"tag_query",
")",
":",
"try",
":",
"link_source_property",
"=",
"int",
"(",
"wmi_obj",
"[",
"tag_query",
"[",
"0",
"]",
"]",
")",
"target_class",
"=",
"tag_query",
"[",
"1",
"]... | Format `tag_query` or raise on incorrect parameters. | [
"Format",
"tag_query",
"or",
"raise",
"on",
"incorrect",
"parameters",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L50-L73 | train | Format tag query. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | WinWMICheck._get_tag_query_tag | def _get_tag_query_tag(self, sampler, wmi_obj, tag_query):
"""
Design a query based on the given WMIObject to extract a tag.
Returns: tag or TagQueryUniquenessFailure exception.
"""
self.log.debug(
u"`tag_queries` parameter found."
" wmi_object={wmi_obj} ... | python | def _get_tag_query_tag(self, sampler, wmi_obj, tag_query):
"""
Design a query based on the given WMIObject to extract a tag.
Returns: tag or TagQueryUniquenessFailure exception.
"""
self.log.debug(
u"`tag_queries` parameter found."
" wmi_object={wmi_obj} ... | [
"def",
"_get_tag_query_tag",
"(",
"self",
",",
"sampler",
",",
"wmi_obj",
",",
"tag_query",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"u\"`tag_queries` parameter found.\"",
"\" wmi_object={wmi_obj} - query={tag_query}\"",
".",
"format",
"(",
"wmi_obj",
"=",
"... | Design a query based on the given WMIObject to extract a tag.
Returns: tag or TagQueryUniquenessFailure exception. | [
"Design",
"a",
"query",
"based",
"on",
"the",
"given",
"WMIObject",
"to",
"extract",
"a",
"tag",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L100-L127 | train | Design a query based on the given WMIObject to extract a tag. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | WinWMICheck._extract_metrics | def _extract_metrics(self, wmi_sampler, tag_by, tag_queries, constant_tags):
"""
Extract and tag metrics from the WMISampler.
Raise when multiple WMIObject were returned by the sampler with no `tag_by` specified.
Returns: List of WMIMetric
```
[
WMIMetric("f... | python | def _extract_metrics(self, wmi_sampler, tag_by, tag_queries, constant_tags):
"""
Extract and tag metrics from the WMISampler.
Raise when multiple WMIObject were returned by the sampler with no `tag_by` specified.
Returns: List of WMIMetric
```
[
WMIMetric("f... | [
"def",
"_extract_metrics",
"(",
"self",
",",
"wmi_sampler",
",",
"tag_by",
",",
"tag_queries",
",",
"constant_tags",
")",
":",
"if",
"len",
"(",
"wmi_sampler",
")",
">",
"1",
"and",
"not",
"tag_by",
":",
"raise",
"MissingTagBy",
"(",
"u\"WMI query returned mul... | Extract and tag metrics from the WMISampler.
Raise when multiple WMIObject were returned by the sampler with no `tag_by` specified.
Returns: List of WMIMetric
```
[
WMIMetric("freemegabytes", 19742, ["name:_total"]),
WMIMetric("avgdiskbytesperwrite", 1536, ["nam... | [
"Extract",
"and",
"tag",
"metrics",
"from",
"the",
"WMISampler",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L129-L197 | train | Extract and tag metrics from the WMI sampler. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | WinWMICheck._submit_metrics | def _submit_metrics(self, metrics, metric_name_and_type_by_property):
"""
Resolve metric names and types and submit it.
"""
for metric in metrics:
if (
metric.name not in metric_name_and_type_by_property
and metric.name.lower() not in metric_na... | python | def _submit_metrics(self, metrics, metric_name_and_type_by_property):
"""
Resolve metric names and types and submit it.
"""
for metric in metrics:
if (
metric.name not in metric_name_and_type_by_property
and metric.name.lower() not in metric_na... | [
"def",
"_submit_metrics",
"(",
"self",
",",
"metrics",
",",
"metric_name_and_type_by_property",
")",
":",
"for",
"metric",
"in",
"metrics",
":",
"if",
"(",
"metric",
".",
"name",
"not",
"in",
"metric_name_and_type_by_property",
"and",
"metric",
".",
"name",
".",... | Resolve metric names and types and submit it. | [
"Resolve",
"metric",
"names",
"and",
"types",
"and",
"submit",
"it",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L199-L224 | train | Submit the given metrics to the user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | WinWMICheck._get_instance_key | def _get_instance_key(self, host, namespace, wmi_class, other=None):
"""
Return an index key for a given instance. Useful for caching.
"""
if other:
return "{host}:{namespace}:{wmi_class}-{other}".format(
host=host, namespace=namespace, wmi_class=wmi_class, ot... | python | def _get_instance_key(self, host, namespace, wmi_class, other=None):
"""
Return an index key for a given instance. Useful for caching.
"""
if other:
return "{host}:{namespace}:{wmi_class}-{other}".format(
host=host, namespace=namespace, wmi_class=wmi_class, ot... | [
"def",
"_get_instance_key",
"(",
"self",
",",
"host",
",",
"namespace",
",",
"wmi_class",
",",
"other",
"=",
"None",
")",
":",
"if",
"other",
":",
"return",
"\"{host}:{namespace}:{wmi_class}-{other}\"",
".",
"format",
"(",
"host",
"=",
"host",
",",
"namespace"... | Return an index key for a given instance. Useful for caching. | [
"Return",
"an",
"index",
"key",
"for",
"a",
"given",
"instance",
".",
"Useful",
"for",
"caching",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L226-L235 | train | Return an index key for a given instance. Useful for caching. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | WinWMICheck._get_wmi_sampler | def _get_wmi_sampler(self, instance_key, wmi_class, properties, tag_by="", **kwargs):
"""
Create and cache a WMISampler for the given (class, properties)
"""
properties = list(properties) + [tag_by] if tag_by else list(properties)
if instance_key not in self.wmi_samplers:
... | python | def _get_wmi_sampler(self, instance_key, wmi_class, properties, tag_by="", **kwargs):
"""
Create and cache a WMISampler for the given (class, properties)
"""
properties = list(properties) + [tag_by] if tag_by else list(properties)
if instance_key not in self.wmi_samplers:
... | [
"def",
"_get_wmi_sampler",
"(",
"self",
",",
"instance_key",
",",
"wmi_class",
",",
"properties",
",",
"tag_by",
"=",
"\"\"",
",",
"*",
"*",
"kwargs",
")",
":",
"properties",
"=",
"list",
"(",
"properties",
")",
"+",
"[",
"tag_by",
"]",
"if",
"tag_by",
... | Create and cache a WMISampler for the given (class, properties) | [
"Create",
"and",
"cache",
"a",
"WMISampler",
"for",
"the",
"given",
"(",
"class",
"properties",
")"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L237-L247 | train | Get a WMISampler instance for the given instance_key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py | WinWMICheck._get_wmi_properties | def _get_wmi_properties(self, instance_key, metrics, tag_queries):
"""
Create and cache a (metric name, metric type) by WMI property map and a property list.
"""
if instance_key not in self.wmi_props:
metric_name_by_property = dict(
(wmi_property.lower(), (met... | python | def _get_wmi_properties(self, instance_key, metrics, tag_queries):
"""
Create and cache a (metric name, metric type) by WMI property map and a property list.
"""
if instance_key not in self.wmi_props:
metric_name_by_property = dict(
(wmi_property.lower(), (met... | [
"def",
"_get_wmi_properties",
"(",
"self",
",",
"instance_key",
",",
"metrics",
",",
"tag_queries",
")",
":",
"if",
"instance_key",
"not",
"in",
"self",
".",
"wmi_props",
":",
"metric_name_by_property",
"=",
"dict",
"(",
"(",
"wmi_property",
".",
"lower",
"(",... | Create and cache a (metric name, metric type) by WMI property map and a property list. | [
"Create",
"and",
"cache",
"a",
"(",
"metric",
"name",
"metric",
"type",
")",
"by",
"WMI",
"property",
"map",
"and",
"a",
"property",
"list",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/__init__.py#L249-L260 | train | Get WMI properties for a given 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... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/prometheus/prometheus_base.py | PrometheusCheck._submit_rate | def _submit_rate(self, metric_name, val, metric, custom_tags=None, hostname=None):
"""
Submit a metric as a rate, additional tags provided will be added to
the ones from the label provided via the metrics object.
`custom_tags` is an array of 'tag:value' that will be added to the
... | python | def _submit_rate(self, metric_name, val, metric, custom_tags=None, hostname=None):
"""
Submit a metric as a rate, additional tags provided will be added to
the ones from the label provided via the metrics object.
`custom_tags` is an array of 'tag:value' that will be added to the
... | [
"def",
"_submit_rate",
"(",
"self",
",",
"metric_name",
",",
"val",
",",
"metric",
",",
"custom_tags",
"=",
"None",
",",
"hostname",
"=",
"None",
")",
":",
"_tags",
"=",
"self",
".",
"_metric_tags",
"(",
"metric_name",
",",
"val",
",",
"metric",
",",
"... | Submit a metric as a rate, additional tags provided will be added to
the ones from the label provided via the metrics object.
`custom_tags` is an array of 'tag:value' that will be added to the
metric when sending the rate to Datadog. | [
"Submit",
"a",
"metric",
"as",
"a",
"rate",
"additional",
"tags",
"provided",
"will",
"be",
"added",
"to",
"the",
"ones",
"from",
"the",
"label",
"provided",
"via",
"the",
"metrics",
"object",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/prometheus_base.py#L38-L47 | train | Submit a metric as a rate | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/prometheus/prometheus_base.py | PrometheusCheck._submit_monotonic_count | def _submit_monotonic_count(self, metric_name, val, metric, custom_tags=None, hostname=None):
"""
Submit a metric as a monotonic count, additional tags provided will be added to
the ones from the label provided via the metrics object.
`custom_tags` is an array of 'tag:value' that will b... | python | def _submit_monotonic_count(self, metric_name, val, metric, custom_tags=None, hostname=None):
"""
Submit a metric as a monotonic count, additional tags provided will be added to
the ones from the label provided via the metrics object.
`custom_tags` is an array of 'tag:value' that will b... | [
"def",
"_submit_monotonic_count",
"(",
"self",
",",
"metric_name",
",",
"val",
",",
"metric",
",",
"custom_tags",
"=",
"None",
",",
"hostname",
"=",
"None",
")",
":",
"_tags",
"=",
"self",
".",
"_metric_tags",
"(",
"metric_name",
",",
"val",
",",
"metric",... | Submit a metric as a monotonic count, additional tags provided will be added to
the ones from the label provided via the metrics object.
`custom_tags` is an array of 'tag:value' that will be added to the
metric when sending the monotonic count to Datadog. | [
"Submit",
"a",
"metric",
"as",
"a",
"monotonic",
"count",
"additional",
"tags",
"provided",
"will",
"be",
"added",
"to",
"the",
"ones",
"from",
"the",
"label",
"provided",
"via",
"the",
"metrics",
"object",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/prometheus_base.py#L49-L59 | train | Submit a metric as a monotonic count. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | go_expvar/datadog_checks/go_expvar/go_expvar.py | GoExpvar.parse_expvar_data | def parse_expvar_data(self, data, tags, metrics, max_metrics, namespace):
'''
Report all the metrics based on the configuration in instance
If a metric is not well configured or is not present in the payload,
continue processing metrics but log the information to the info page
''... | python | def parse_expvar_data(self, data, tags, metrics, max_metrics, namespace):
'''
Report all the metrics based on the configuration in instance
If a metric is not well configured or is not present in the payload,
continue processing metrics but log the information to the info page
''... | [
"def",
"parse_expvar_data",
"(",
"self",
",",
"data",
",",
"tags",
",",
"metrics",
",",
"max_metrics",
",",
"namespace",
")",
":",
"count",
"=",
"0",
"for",
"metric",
"in",
"metrics",
":",
"path",
"=",
"metric",
".",
"get",
"(",
"PATH",
")",
"metric_ty... | Report all the metrics based on the configuration in instance
If a metric is not well configured or is not present in the payload,
continue processing metrics but log the information to the info page | [
"Report",
"all",
"the",
"metrics",
"based",
"on",
"the",
"configuration",
"in",
"instance",
"If",
"a",
"metric",
"is",
"not",
"well",
"configured",
"or",
"is",
"not",
"present",
"in",
"the",
"payload",
"continue",
"processing",
"metrics",
"but",
"log",
"the"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/go_expvar/datadog_checks/go_expvar/go_expvar.py#L141-L192 | train | Parse the expvar data and return the corresponding instance of ExpVar class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | go_expvar/datadog_checks/go_expvar/go_expvar.py | GoExpvar.deep_get | def deep_get(self, content, keys, traversed_path=None):
'''
Allow to retrieve content nested inside a several layers deep dict/list
Examples: -content: {
"key1": {
"key2" : [
{
... | python | def deep_get(self, content, keys, traversed_path=None):
'''
Allow to retrieve content nested inside a several layers deep dict/list
Examples: -content: {
"key1": {
"key2" : [
{
... | [
"def",
"deep_get",
"(",
"self",
",",
"content",
",",
"keys",
",",
"traversed_path",
"=",
"None",
")",
":",
"if",
"traversed_path",
"is",
"None",
":",
"traversed_path",
"=",
"[",
"]",
"if",
"keys",
"==",
"[",
"]",
":",
"return",
"[",
"(",
"traversed_pat... | Allow to retrieve content nested inside a several layers deep dict/list
Examples: -content: {
"key1": {
"key2" : [
{
"name" : "object1",
... | [
"Allow",
"to",
"retrieve",
"content",
"nested",
"inside",
"a",
"several",
"layers",
"deep",
"dict",
"/",
"list"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/go_expvar/datadog_checks/go_expvar/go_expvar.py#L194-L241 | train | This method recursively gets the content of a deep dict. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | partition_node | def partition_node(node):
"""Split a host:port string into (host, int(port)) pair."""
host = node
port = 27017
idx = node.rfind(':')
if idx != -1:
host, port = node[:idx], int(node[idx + 1:])
if host.startswith('['):
host = host[1:-1]
return host, port | python | def partition_node(node):
"""Split a host:port string into (host, int(port)) pair."""
host = node
port = 27017
idx = node.rfind(':')
if idx != -1:
host, port = node[:idx], int(node[idx + 1:])
if host.startswith('['):
host = host[1:-1]
return host, port | [
"def",
"partition_node",
"(",
"node",
")",
":",
"host",
"=",
"node",
"port",
"=",
"27017",
"idx",
"=",
"node",
".",
"rfind",
"(",
"':'",
")",
"if",
"idx",
"!=",
"-",
"1",
":",
"host",
",",
"port",
"=",
"node",
"[",
":",
"idx",
"]",
",",
"int",
... | Split a host:port string into (host, int(port)) pair. | [
"Split",
"a",
"host",
":",
"port",
"string",
"into",
"(",
"host",
"int",
"(",
"port",
"))",
"pair",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L91-L100 | train | Split a host string into host and port pair. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_boolean_or_string | def validate_boolean_or_string(option, value):
"""Validates that value is True, False, 'true', or 'false'."""
if isinstance(value, string_type):
if value not in ('true', 'false'):
raise ValueError("The value of %s must be "
"'true' or 'false'" % (option,))
... | python | def validate_boolean_or_string(option, value):
"""Validates that value is True, False, 'true', or 'false'."""
if isinstance(value, string_type):
if value not in ('true', 'false'):
raise ValueError("The value of %s must be "
"'true' or 'false'" % (option,))
... | [
"def",
"validate_boolean_or_string",
"(",
"option",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"string_type",
")",
":",
"if",
"value",
"not",
"in",
"(",
"'true'",
",",
"'false'",
")",
":",
"raise",
"ValueError",
"(",
"\"The value of %s mu... | Validates that value is True, False, 'true', or 'false'. | [
"Validates",
"that",
"value",
"is",
"True",
"False",
"true",
"or",
"false",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L135-L142 | train | Validates that value is True False True or false. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_positive_integer | def validate_positive_integer(option, value):
"""Validate that 'value' is a positive integer, which does not include 0.
"""
val = validate_integer(option, value)
if val <= 0:
raise ValueError("The value of %s must be "
"a positive integer" % (option,))
return val | python | def validate_positive_integer(option, value):
"""Validate that 'value' is a positive integer, which does not include 0.
"""
val = validate_integer(option, value)
if val <= 0:
raise ValueError("The value of %s must be "
"a positive integer" % (option,))
return val | [
"def",
"validate_positive_integer",
"(",
"option",
",",
"value",
")",
":",
"val",
"=",
"validate_integer",
"(",
"option",
",",
"value",
")",
"if",
"val",
"<=",
"0",
":",
"raise",
"ValueError",
"(",
"\"The value of %s must be \"",
"\"a positive integer\"",
"%",
"... | Validate that 'value' is a positive integer, which does not include 0. | [
"Validate",
"that",
"value",
"is",
"a",
"positive",
"integer",
"which",
"does",
"not",
"include",
"0",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L158-L165 | train | Validate that value is a positive integer which does not include 0. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_non_negative_integer | def validate_non_negative_integer(option, value):
"""Validate that 'value' is a positive integer or 0.
"""
val = validate_integer(option, value)
if val < 0:
raise ValueError("The value of %s must be "
"a non negative integer" % (option,))
return val | python | def validate_non_negative_integer(option, value):
"""Validate that 'value' is a positive integer or 0.
"""
val = validate_integer(option, value)
if val < 0:
raise ValueError("The value of %s must be "
"a non negative integer" % (option,))
return val | [
"def",
"validate_non_negative_integer",
"(",
"option",
",",
"value",
")",
":",
"val",
"=",
"validate_integer",
"(",
"option",
",",
"value",
")",
"if",
"val",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"\"The value of %s must be \"",
"\"a non negative integer\"",
"... | Validate that 'value' is a positive integer or 0. | [
"Validate",
"that",
"value",
"is",
"a",
"positive",
"integer",
"or",
"0",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L168-L175 | train | Validate that value is a positive integer or 0. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_readable | def validate_readable(option, value):
"""Validates that 'value' is file-like and readable.
"""
if value is None:
return value
# First make sure its a string py3.3 open(True, 'r') succeeds
# Used in ssl cert checking due to poor ssl module error reporting
value = validate_string(option, v... | python | def validate_readable(option, value):
"""Validates that 'value' is file-like and readable.
"""
if value is None:
return value
# First make sure its a string py3.3 open(True, 'r') succeeds
# Used in ssl cert checking due to poor ssl module error reporting
value = validate_string(option, v... | [
"def",
"validate_readable",
"(",
"option",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"value",
"# First make sure its a string py3.3 open(True, 'r') succeeds",
"# Used in ssl cert checking due to poor ssl module error reporting",
"value",
"=",
"validate... | Validates that 'value' is file-like and readable. | [
"Validates",
"that",
"value",
"is",
"file",
"-",
"like",
"and",
"readable",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L178-L187 | train | Validates that value is file - like and readable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_string | def validate_string(option, value):
"""Validates that 'value' is an instance of `basestring` for Python 2
or `str` for Python 3.
"""
if isinstance(value, string_type):
return value
raise TypeError("Wrong type for %s, value must be "
"an instance of %s" % (option, string_t... | python | def validate_string(option, value):
"""Validates that 'value' is an instance of `basestring` for Python 2
or `str` for Python 3.
"""
if isinstance(value, string_type):
return value
raise TypeError("Wrong type for %s, value must be "
"an instance of %s" % (option, string_t... | [
"def",
"validate_string",
"(",
"option",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"string_type",
")",
":",
"return",
"value",
"raise",
"TypeError",
"(",
"\"Wrong type for %s, value must be \"",
"\"an instance of %s\"",
"%",
"(",
"option",
","... | Validates that 'value' is an instance of `basestring` for Python 2
or `str` for Python 3. | [
"Validates",
"that",
"value",
"is",
"an",
"instance",
"of",
"basestring",
"for",
"Python",
"2",
"or",
"str",
"for",
"Python",
"3",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L206-L213 | train | Validates that value is an instance of basestring for Python 2
or str for Python 3. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_positive_float | def validate_positive_float(option, value):
"""Validates that 'value' is a float, or can be converted to one, and is
positive.
"""
errmsg = "%s must be an integer or float" % (option,)
try:
value = float(value)
except ValueError:
raise ValueError(errmsg)
except TypeError:
... | python | def validate_positive_float(option, value):
"""Validates that 'value' is a float, or can be converted to one, and is
positive.
"""
errmsg = "%s must be an integer or float" % (option,)
try:
value = float(value)
except ValueError:
raise ValueError(errmsg)
except TypeError:
... | [
"def",
"validate_positive_float",
"(",
"option",
",",
"value",
")",
":",
"errmsg",
"=",
"\"%s must be an integer or float\"",
"%",
"(",
"option",
",",
")",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError"... | Validates that 'value' is a float, or can be converted to one, and is
positive. | [
"Validates",
"that",
"value",
"is",
"a",
"float",
"or",
"can",
"be",
"converted",
"to",
"one",
"and",
"is",
"positive",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L237-L254 | train | Validates that value is a float or can be converted to one and is
positive. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_timeout_or_zero | def validate_timeout_or_zero(option, value):
"""Validates a timeout specified in milliseconds returning
a value in floating point seconds for the case where None is an error
and 0 is valid. Setting the timeout to nothing in the URI string is a
config error.
"""
if value is None:
raise Co... | python | def validate_timeout_or_zero(option, value):
"""Validates a timeout specified in milliseconds returning
a value in floating point seconds for the case where None is an error
and 0 is valid. Setting the timeout to nothing in the URI string is a
config error.
"""
if value is None:
raise Co... | [
"def",
"validate_timeout_or_zero",
"(",
"option",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"raise",
"ConfigurationError",
"(",
"\"%s cannot be None\"",
"%",
"(",
"option",
",",
")",
")",
"if",
"value",
"==",
"0",
"or",
"value",
"==",
"\"0\... | Validates a timeout specified in milliseconds returning
a value in floating point seconds for the case where None is an error
and 0 is valid. Setting the timeout to nothing in the URI string is a
config error. | [
"Validates",
"a",
"timeout",
"specified",
"in",
"milliseconds",
"returning",
"a",
"value",
"in",
"floating",
"point",
"seconds",
"for",
"the",
"case",
"where",
"None",
"is",
"an",
"error",
"and",
"0",
"is",
"valid",
".",
"Setting",
"the",
"timeout",
"to",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L275-L285 | train | Validates a timeout specified in milliseconds returning a value in floating point seconds for the case where None is an error
0 is a ConfigurationError. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_auth_mechanism | def validate_auth_mechanism(option, value):
"""Validate the authMechanism URI option.
"""
# CRAM-MD5 is for server testing only. Undocumented,
# unsupported, may be removed at any time. You have
# been warned.
if value not in MECHANISMS and value != 'CRAM-MD5':
raise ValueError("%s must ... | python | def validate_auth_mechanism(option, value):
"""Validate the authMechanism URI option.
"""
# CRAM-MD5 is for server testing only. Undocumented,
# unsupported, may be removed at any time. You have
# been warned.
if value not in MECHANISMS and value != 'CRAM-MD5':
raise ValueError("%s must ... | [
"def",
"validate_auth_mechanism",
"(",
"option",
",",
"value",
")",
":",
"# CRAM-MD5 is for server testing only. Undocumented,",
"# unsupported, may be removed at any time. You have",
"# been warned.",
"if",
"value",
"not",
"in",
"MECHANISMS",
"and",
"value",
"!=",
"'CRAM-MD5'"... | Validate the authMechanism URI option. | [
"Validate",
"the",
"authMechanism",
"URI",
"option",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L316-L324 | train | Validate the authMechanism URI option. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_uuid_representation | def validate_uuid_representation(dummy, value):
"""Validate the uuid representation option selected in the URI.
"""
try:
return _UUID_REPRESENTATIONS[value]
except KeyError:
raise ValueError("%s is an invalid UUID representation. "
"Must be one of "
... | python | def validate_uuid_representation(dummy, value):
"""Validate the uuid representation option selected in the URI.
"""
try:
return _UUID_REPRESENTATIONS[value]
except KeyError:
raise ValueError("%s is an invalid UUID representation. "
"Must be one of "
... | [
"def",
"validate_uuid_representation",
"(",
"dummy",
",",
"value",
")",
":",
"try",
":",
"return",
"_UUID_REPRESENTATIONS",
"[",
"value",
"]",
"except",
"KeyError",
":",
"raise",
"ValueError",
"(",
"\"%s is an invalid UUID representation. \"",
"\"Must be one of \"",
"\"... | Validate the uuid representation option selected in the URI. | [
"Validate",
"the",
"uuid",
"representation",
"option",
"selected",
"in",
"the",
"URI",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L327-L335 | train | Validate the uuid representation option selected in the URI. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_read_preference_tags | def validate_read_preference_tags(name, value):
"""Parse readPreferenceTags if passed as a client kwarg.
"""
if not isinstance(value, list):
value = [value]
tag_sets = []
for tag_set in value:
if tag_set == '':
tag_sets.append({})
continue
try:
... | python | def validate_read_preference_tags(name, value):
"""Parse readPreferenceTags if passed as a client kwarg.
"""
if not isinstance(value, list):
value = [value]
tag_sets = []
for tag_set in value:
if tag_set == '':
tag_sets.append({})
continue
try:
... | [
"def",
"validate_read_preference_tags",
"(",
"name",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"value",
"=",
"[",
"value",
"]",
"tag_sets",
"=",
"[",
"]",
"for",
"tag_set",
"in",
"value",
":",
"if",
"tag_se... | Parse readPreferenceTags if passed as a client kwarg. | [
"Parse",
"readPreferenceTags",
"if",
"passed",
"as",
"a",
"client",
"kwarg",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L338-L355 | train | Parse readPreferenceTags if passed as a client kwarg. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_auth_mechanism_properties | def validate_auth_mechanism_properties(option, value):
"""Validate authMechanismProperties."""
value = validate_string(option, value)
props = {}
for opt in value.split(','):
try:
key, val = opt.split(':')
except ValueError:
raise ValueError("auth mechanism propert... | python | def validate_auth_mechanism_properties(option, value):
"""Validate authMechanismProperties."""
value = validate_string(option, value)
props = {}
for opt in value.split(','):
try:
key, val = opt.split(':')
except ValueError:
raise ValueError("auth mechanism propert... | [
"def",
"validate_auth_mechanism_properties",
"(",
"option",
",",
"value",
")",
":",
"value",
"=",
"validate_string",
"(",
"option",
",",
"value",
")",
"props",
"=",
"{",
"}",
"for",
"opt",
"in",
"value",
".",
"split",
"(",
"','",
")",
":",
"try",
":",
... | Validate authMechanismProperties. | [
"Validate",
"authMechanismProperties",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L363-L383 | train | Validate authMechanismProperties. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_document_class | def validate_document_class(option, value):
"""Validate the document_class option."""
if not issubclass(value, (collections.MutableMapping, RawBSONDocument)):
raise TypeError("%s must be dict, bson.son.SON, "
"bson.raw_bson.RawBSONDocument, or a "
"sublass... | python | def validate_document_class(option, value):
"""Validate the document_class option."""
if not issubclass(value, (collections.MutableMapping, RawBSONDocument)):
raise TypeError("%s must be dict, bson.son.SON, "
"bson.raw_bson.RawBSONDocument, or a "
"sublass... | [
"def",
"validate_document_class",
"(",
"option",
",",
"value",
")",
":",
"if",
"not",
"issubclass",
"(",
"value",
",",
"(",
"collections",
".",
"MutableMapping",
",",
"RawBSONDocument",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"%s must be dict, bson.son.SON, \"... | Validate the document_class option. | [
"Validate",
"the",
"document_class",
"option",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L386-L392 | train | Validate the document_class option. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_is_document_type | def validate_is_document_type(option, value):
"""Validate the type of method arguments that expect a MongoDB document."""
if not isinstance(value, (collections.MutableMapping, RawBSONDocument)):
raise TypeError("%s must be an instance of dict, bson.son.SON, "
"bson.raw_bson.RawBS... | python | def validate_is_document_type(option, value):
"""Validate the type of method arguments that expect a MongoDB document."""
if not isinstance(value, (collections.MutableMapping, RawBSONDocument)):
raise TypeError("%s must be an instance of dict, bson.son.SON, "
"bson.raw_bson.RawBS... | [
"def",
"validate_is_document_type",
"(",
"option",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"(",
"collections",
".",
"MutableMapping",
",",
"RawBSONDocument",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"%s must be an instance of dict,... | Validate the type of method arguments that expect a MongoDB document. | [
"Validate",
"the",
"type",
"of",
"method",
"arguments",
"that",
"expect",
"a",
"MongoDB",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L403-L409 | train | Validate the type of method arguments that expect a MongoDB document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_appname_or_none | def validate_appname_or_none(option, value):
"""Validate the appname option."""
if value is None:
return value
validate_string(option, value)
# We need length in bytes, so encode utf8 first.
if len(value.encode('utf-8')) > 128:
raise ValueError("%s must be <= 128 bytes" % (option,))
... | python | def validate_appname_or_none(option, value):
"""Validate the appname option."""
if value is None:
return value
validate_string(option, value)
# We need length in bytes, so encode utf8 first.
if len(value.encode('utf-8')) > 128:
raise ValueError("%s must be <= 128 bytes" % (option,))
... | [
"def",
"validate_appname_or_none",
"(",
"option",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"value",
"validate_string",
"(",
"option",
",",
"value",
")",
"# We need length in bytes, so encode utf8 first.",
"if",
"len",
"(",
"value",
".",
... | Validate the appname option. | [
"Validate",
"the",
"appname",
"option",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L412-L420 | train | Validate the appname option. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_ok_for_replace | def validate_ok_for_replace(replacement):
"""Validate a replacement document."""
validate_is_mapping("replacement", replacement)
# Replacement can be {}
if replacement and not isinstance(replacement, RawBSONDocument):
first = next(iter(replacement))
if first.startswith('$'):
... | python | def validate_ok_for_replace(replacement):
"""Validate a replacement document."""
validate_is_mapping("replacement", replacement)
# Replacement can be {}
if replacement and not isinstance(replacement, RawBSONDocument):
first = next(iter(replacement))
if first.startswith('$'):
... | [
"def",
"validate_ok_for_replace",
"(",
"replacement",
")",
":",
"validate_is_mapping",
"(",
"\"replacement\"",
",",
"replacement",
")",
"# Replacement can be {}",
"if",
"replacement",
"and",
"not",
"isinstance",
"(",
"replacement",
",",
"RawBSONDocument",
")",
":",
"f... | Validate a replacement document. | [
"Validate",
"a",
"replacement",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L423-L430 | train | Validate a replacement document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_ok_for_update | def validate_ok_for_update(update):
"""Validate an update document."""
validate_is_mapping("update", update)
# Update can not be {}
if not update:
raise ValueError('update only works with $ operators')
first = next(iter(update))
if not first.startswith('$'):
raise ValueError('upd... | python | def validate_ok_for_update(update):
"""Validate an update document."""
validate_is_mapping("update", update)
# Update can not be {}
if not update:
raise ValueError('update only works with $ operators')
first = next(iter(update))
if not first.startswith('$'):
raise ValueError('upd... | [
"def",
"validate_ok_for_update",
"(",
"update",
")",
":",
"validate_is_mapping",
"(",
"\"update\"",
",",
"update",
")",
"# Update can not be {}",
"if",
"not",
"update",
":",
"raise",
"ValueError",
"(",
"'update only works with $ operators'",
")",
"first",
"=",
"next",... | Validate an update document. | [
"Validate",
"an",
"update",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L433-L441 | train | Validate an update document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_unicode_decode_error_handler | def validate_unicode_decode_error_handler(dummy, value):
"""Validate the Unicode decode error handler option of CodecOptions.
"""
if value not in _UNICODE_DECODE_ERROR_HANDLERS:
raise ValueError("%s is an invalid Unicode decode error handler. "
"Must be one of "
... | python | def validate_unicode_decode_error_handler(dummy, value):
"""Validate the Unicode decode error handler option of CodecOptions.
"""
if value not in _UNICODE_DECODE_ERROR_HANDLERS:
raise ValueError("%s is an invalid Unicode decode error handler. "
"Must be one of "
... | [
"def",
"validate_unicode_decode_error_handler",
"(",
"dummy",
",",
"value",
")",
":",
"if",
"value",
"not",
"in",
"_UNICODE_DECODE_ERROR_HANDLERS",
":",
"raise",
"ValueError",
"(",
"\"%s is an invalid Unicode decode error handler. \"",
"\"Must be one of \"",
"\"%s\"",
"%",
... | Validate the Unicode decode error handler option of CodecOptions. | [
"Validate",
"the",
"Unicode",
"decode",
"error",
"handler",
"option",
"of",
"CodecOptions",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L447-L454 | train | Validate Unicode decode error handler option of CodecOptions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_tzinfo | def validate_tzinfo(dummy, value):
"""Validate the tzinfo option
"""
if value is not None and not isinstance(value, datetime.tzinfo):
raise TypeError("%s must be an instance of datetime.tzinfo" % value)
return value | python | def validate_tzinfo(dummy, value):
"""Validate the tzinfo option
"""
if value is not None and not isinstance(value, datetime.tzinfo):
raise TypeError("%s must be an instance of datetime.tzinfo" % value)
return value | [
"def",
"validate_tzinfo",
"(",
"dummy",
",",
"value",
")",
":",
"if",
"value",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"value",
",",
"datetime",
".",
"tzinfo",
")",
":",
"raise",
"TypeError",
"(",
"\"%s must be an instance of datetime.tzinfo\"",
... | Validate the tzinfo option | [
"Validate",
"the",
"tzinfo",
"option"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L457-L462 | train | Validate the tzinfo option
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate_auth_option | def validate_auth_option(option, value):
"""Validate optional authentication parameters.
"""
lower, value = validate(option, value)
if lower not in _AUTH_OPTIONS:
raise ConfigurationError('Unknown '
'authentication option: %s' % (option,))
return lower, value | python | def validate_auth_option(option, value):
"""Validate optional authentication parameters.
"""
lower, value = validate(option, value)
if lower not in _AUTH_OPTIONS:
raise ConfigurationError('Unknown '
'authentication option: %s' % (option,))
return lower, value | [
"def",
"validate_auth_option",
"(",
"option",
",",
"value",
")",
":",
"lower",
",",
"value",
"=",
"validate",
"(",
"option",
",",
"value",
")",
"if",
"lower",
"not",
"in",
"_AUTH_OPTIONS",
":",
"raise",
"ConfigurationError",
"(",
"'Unknown '",
"'authentication... | Validate optional authentication parameters. | [
"Validate",
"optional",
"authentication",
"parameters",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L528-L535 | train | Validate optional authentication parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | validate | def validate(option, value):
"""Generic validation function.
"""
lower = option.lower()
validator = VALIDATORS.get(lower, raise_config_error)
value = validator(option, value)
return lower, value | python | def validate(option, value):
"""Generic validation function.
"""
lower = option.lower()
validator = VALIDATORS.get(lower, raise_config_error)
value = validator(option, value)
return lower, value | [
"def",
"validate",
"(",
"option",
",",
"value",
")",
":",
"lower",
"=",
"option",
".",
"lower",
"(",
")",
"validator",
"=",
"VALIDATORS",
".",
"get",
"(",
"lower",
",",
"raise_config_error",
")",
"value",
"=",
"validator",
"(",
"option",
",",
"value",
... | Generic validation function. | [
"Generic",
"validation",
"function",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L538-L544 | train | Generic validation 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/common.py | get_validated_options | def get_validated_options(options, warn=True):
"""Validate each entry in options and raise a warning if it is not valid.
Returns a copy of options with invalid entries removed
"""
validated_options = {}
for opt, value in iteritems(options):
lower = opt.lower()
try:
valida... | python | def get_validated_options(options, warn=True):
"""Validate each entry in options and raise a warning if it is not valid.
Returns a copy of options with invalid entries removed
"""
validated_options = {}
for opt, value in iteritems(options):
lower = opt.lower()
try:
valida... | [
"def",
"get_validated_options",
"(",
"options",
",",
"warn",
"=",
"True",
")",
":",
"validated_options",
"=",
"{",
"}",
"for",
"opt",
",",
"value",
"in",
"iteritems",
"(",
"options",
")",
":",
"lower",
"=",
"opt",
".",
"lower",
"(",
")",
"try",
":",
... | Validate each entry in options and raise a warning if it is not valid.
Returns a copy of options with invalid entries removed | [
"Validate",
"each",
"entry",
"in",
"options",
"and",
"raise",
"a",
"warning",
"if",
"it",
"is",
"not",
"valid",
".",
"Returns",
"a",
"copy",
"of",
"options",
"with",
"invalid",
"entries",
"removed"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/common.py#L547-L564 | train | Validate each entry in options and raise a warning if it is not valid. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | redisdb/datadog_checks/redisdb/redisdb.py | Redis._parse_dict_string | def _parse_dict_string(self, string, key, default):
"""Take from a more recent redis.py, parse_info"""
try:
for item in string.split(','):
k, v = item.rsplit('=', 1)
if k == key:
try:
return int(v)
... | python | def _parse_dict_string(self, string, key, default):
"""Take from a more recent redis.py, parse_info"""
try:
for item in string.split(','):
k, v = item.rsplit('=', 1)
if k == key:
try:
return int(v)
... | [
"def",
"_parse_dict_string",
"(",
"self",
",",
"string",
",",
"key",
",",
"default",
")",
":",
"try",
":",
"for",
"item",
"in",
"string",
".",
"split",
"(",
"','",
")",
":",
"k",
",",
"v",
"=",
"item",
".",
"rsplit",
"(",
"'='",
",",
"1",
")",
... | Take from a more recent redis.py, parse_info | [
"Take",
"from",
"a",
"more",
"recent",
"redis",
".",
"py",
"parse_info"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/redisdb/datadog_checks/redisdb/redisdb.py#L96-L109 | train | Take from a more recent redis. py parse_info | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | redisdb/datadog_checks/redisdb/redisdb.py | Redis._check_key_lengths | def _check_key_lengths(self, conn, instance, tags):
"""
Compute the length of the configured keys across all the databases
"""
key_list = instance.get('keys')
if key_list is None:
return
if not isinstance(key_list, list) or len(key_list) == 0:
se... | python | def _check_key_lengths(self, conn, instance, tags):
"""
Compute the length of the configured keys across all the databases
"""
key_list = instance.get('keys')
if key_list is None:
return
if not isinstance(key_list, list) or len(key_list) == 0:
se... | [
"def",
"_check_key_lengths",
"(",
"self",
",",
"conn",
",",
"instance",
",",
"tags",
")",
":",
"key_list",
"=",
"instance",
".",
"get",
"(",
"'keys'",
")",
"if",
"key_list",
"is",
"None",
":",
"return",
"if",
"not",
"isinstance",
"(",
"key_list",
",",
... | Compute the length of the configured keys across all the databases | [
"Compute",
"the",
"length",
"of",
"the",
"configured",
"keys",
"across",
"all",
"the",
"databases"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/redisdb/datadog_checks/redisdb/redisdb.py#L234-L336 | train | Compute the length of the configured keys across all the databases and store the result in a set of keys that are configured for the current user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | redisdb/datadog_checks/redisdb/redisdb.py | Redis._check_slowlog | def _check_slowlog(self, instance, custom_tags):
"""Retrieve length and entries from Redis' SLOWLOG
This will parse through all entries of the SLOWLOG and select ones
within the time range between the last seen entries and now
"""
conn = self._get_conn(instance)
tags =... | python | def _check_slowlog(self, instance, custom_tags):
"""Retrieve length and entries from Redis' SLOWLOG
This will parse through all entries of the SLOWLOG and select ones
within the time range between the last seen entries and now
"""
conn = self._get_conn(instance)
tags =... | [
"def",
"_check_slowlog",
"(",
"self",
",",
"instance",
",",
"custom_tags",
")",
":",
"conn",
"=",
"self",
".",
"_get_conn",
"(",
"instance",
")",
"tags",
"=",
"self",
".",
"_get_tags",
"(",
"custom_tags",
",",
"instance",
")",
"if",
"not",
"instance",
".... | Retrieve length and entries from Redis' SLOWLOG
This will parse through all entries of the SLOWLOG and select ones
within the time range between the last seen entries and now | [
"Retrieve",
"length",
"and",
"entries",
"from",
"Redis",
"SLOWLOG"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/redisdb/datadog_checks/redisdb/redisdb.py#L365-L424 | train | Retrieve length and entries from Redis SLOWLOG | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | redisdb/datadog_checks/redisdb/redisdb.py | Redis._check_command_stats | def _check_command_stats(self, conn, tags):
"""Get command-specific statistics from redis' INFO COMMANDSTATS command
"""
try:
command_stats = conn.info("commandstats")
except Exception:
self.warning('Could not retrieve command stats from Redis. INFO COMMANDSTATS o... | python | def _check_command_stats(self, conn, tags):
"""Get command-specific statistics from redis' INFO COMMANDSTATS command
"""
try:
command_stats = conn.info("commandstats")
except Exception:
self.warning('Could not retrieve command stats from Redis. INFO COMMANDSTATS o... | [
"def",
"_check_command_stats",
"(",
"self",
",",
"conn",
",",
"tags",
")",
":",
"try",
":",
"command_stats",
"=",
"conn",
".",
"info",
"(",
"\"commandstats\"",
")",
"except",
"Exception",
":",
"self",
".",
"warning",
"(",
"'Could not retrieve command stats from ... | Get command-specific statistics from redis' INFO COMMANDSTATS command | [
"Get",
"command",
"-",
"specific",
"statistics",
"from",
"redis",
"INFO",
"COMMANDSTATS",
"command"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/redisdb/datadog_checks/redisdb/redisdb.py#L426-L444 | train | Get command - specific statistics from redis INFO COMMANDSTATS | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | coredns/datadog_checks/coredns/coredns.py | CoreDNSCheck.create_generic_instances | def create_generic_instances(self, instances):
"""
Transform each CoreDNS instance into a OpenMetricsBaseCheck instance
"""
generic_instances = []
for instance in instances:
transformed_instance = self._create_core_dns_instance(instance)
generic_instances.... | python | def create_generic_instances(self, instances):
"""
Transform each CoreDNS instance into a OpenMetricsBaseCheck instance
"""
generic_instances = []
for instance in instances:
transformed_instance = self._create_core_dns_instance(instance)
generic_instances.... | [
"def",
"create_generic_instances",
"(",
"self",
",",
"instances",
")",
":",
"generic_instances",
"=",
"[",
"]",
"for",
"instance",
"in",
"instances",
":",
"transformed_instance",
"=",
"self",
".",
"_create_core_dns_instance",
"(",
"instance",
")",
"generic_instances... | Transform each CoreDNS instance into a OpenMetricsBaseCheck instance | [
"Transform",
"each",
"CoreDNS",
"instance",
"into",
"a",
"OpenMetricsBaseCheck",
"instance"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/coredns/datadog_checks/coredns/coredns.py#L73-L82 | train | Transform each CoreDNS instance into OpenMetricsBaseCheck 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... |
DataDog/integrations-core | coredns/datadog_checks/coredns/coredns.py | CoreDNSCheck._create_core_dns_instance | def _create_core_dns_instance(self, instance):
"""
Set up coredns instance so it can be used in OpenMetricsBaseCheck
"""
endpoint = instance.get('prometheus_url')
if endpoint is None:
raise ConfigurationError("Unable to find prometheus endpoint in config file.")
... | python | def _create_core_dns_instance(self, instance):
"""
Set up coredns instance so it can be used in OpenMetricsBaseCheck
"""
endpoint = instance.get('prometheus_url')
if endpoint is None:
raise ConfigurationError("Unable to find prometheus endpoint in config file.")
... | [
"def",
"_create_core_dns_instance",
"(",
"self",
",",
"instance",
")",
":",
"endpoint",
"=",
"instance",
".",
"get",
"(",
"'prometheus_url'",
")",
"if",
"endpoint",
"is",
"None",
":",
"raise",
"ConfigurationError",
"(",
"\"Unable to find prometheus endpoint in config ... | Set up coredns instance so it can be used in OpenMetricsBaseCheck | [
"Set",
"up",
"coredns",
"instance",
"so",
"it",
"can",
"be",
"used",
"in",
"OpenMetricsBaseCheck"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/coredns/datadog_checks/coredns/coredns.py#L84-L97 | train | Create a coredns instance from the config file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_dev/datadog_checks/dev/tooling/commands/clean.py | clean | def clean(ctx, check, compiled_only, all_matches, force, verbose):
"""Removes a project's build artifacts.
If `check` is not specified, the current working directory will be used.
All `*.pyc`/`*.pyd`/`*.pyo`/`*.whl` files and `__pycache__` directories will be
removed. Additionally, the following patte... | python | def clean(ctx, check, compiled_only, all_matches, force, verbose):
"""Removes a project's build artifacts.
If `check` is not specified, the current working directory will be used.
All `*.pyc`/`*.pyd`/`*.pyo`/`*.whl` files and `__pycache__` directories will be
removed. Additionally, the following patte... | [
"def",
"clean",
"(",
"ctx",
",",
"check",
",",
"compiled_only",
",",
"all_matches",
",",
"force",
",",
"verbose",
")",
":",
"force_clean_root",
"=",
"False",
"if",
"check",
":",
"path",
"=",
"resolve_path",
"(",
"os",
".",
"path",
".",
"join",
"(",
"ge... | Removes a project's build artifacts.
If `check` is not specified, the current working directory will be used.
All `*.pyc`/`*.pyd`/`*.pyo`/`*.whl` files and `__pycache__` directories will be
removed. Additionally, the following patterns will be removed from the root of
the path: `.cache`, `.coverage`, ... | [
"Removes",
"a",
"project",
"s",
"build",
"artifacts",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/clean.py#L41-L89 | train | Removes a project s build artifacts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | couch/datadog_checks/couch/couch.py | CouchDb.get | def get(self, url, instance, service_check_tags, run_check=False):
"Hit a given URL and return the parsed json"
self.log.debug('Fetching CouchDB stats at url: %s' % url)
auth = None
if 'user' in instance and 'password' in instance:
auth = (instance['user'], instance['passwor... | python | def get(self, url, instance, service_check_tags, run_check=False):
"Hit a given URL and return the parsed json"
self.log.debug('Fetching CouchDB stats at url: %s' % url)
auth = None
if 'user' in instance and 'password' in instance:
auth = (instance['user'], instance['passwor... | [
"def",
"get",
"(",
"self",
",",
"url",
",",
"instance",
",",
"service_check_tags",
",",
"run_check",
"=",
"False",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"'Fetching CouchDB stats at url: %s'",
"%",
"url",
")",
"auth",
"=",
"None",
"if",
"'user'",... | Hit a given URL and return the parsed json | [
"Hit",
"a",
"given",
"URL",
"and",
"return",
"the",
"parsed",
"json"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/couch/datadog_checks/couch/couch.py#L30-L68 | train | Hit a given URL and return the parsed json | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/son.py | SON.to_dict | def to_dict(self):
"""Convert a SON document to a normal Python dictionary instance.
This is trickier than just *dict(...)* because it needs to be
recursive.
"""
def transform_value(value):
if isinstance(value, list):
return [transform_value(v) for v... | python | def to_dict(self):
"""Convert a SON document to a normal Python dictionary instance.
This is trickier than just *dict(...)* because it needs to be
recursive.
"""
def transform_value(value):
if isinstance(value, list):
return [transform_value(v) for v... | [
"def",
"to_dict",
"(",
"self",
")",
":",
"def",
"transform_value",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"return",
"[",
"transform_value",
"(",
"v",
")",
"for",
"v",
"in",
"value",
"]",
"elif",
"isinstance",
... | Convert a SON document to a normal Python dictionary instance.
This is trickier than just *dict(...)* because it needs to be
recursive. | [
"Convert",
"a",
"SON",
"document",
"to",
"a",
"normal",
"Python",
"dictionary",
"instance",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/son.py#L220-L237 | train | Convert a SON document to a normal Python dictionary 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._cache_credentials | def _cache_credentials(self, source, credentials, connect=False):
"""Save a set of authentication credentials.
The credentials are used to login a socket whenever one is created.
If `connect` is True, verify the credentials on the server first.
"""
# Don't let other threads affe... | python | def _cache_credentials(self, source, credentials, connect=False):
"""Save a set of authentication credentials.
The credentials are used to login a socket whenever one is created.
If `connect` is True, verify the credentials on the server first.
"""
# Don't let other threads affe... | [
"def",
"_cache_credentials",
"(",
"self",
",",
"source",
",",
"credentials",
",",
"connect",
"=",
"False",
")",
":",
"# Don't let other threads affect this call's data.",
"all_credentials",
"=",
"self",
".",
"__all_credentials",
".",
"copy",
"(",
")",
"if",
"source"... | Save a set of authentication credentials.
The credentials are used to login a socket whenever one is created.
If `connect` is True, verify the credentials on the server first. | [
"Save",
"a",
"set",
"of",
"authentication",
"credentials",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L524-L550 | train | Save a set of authentication 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._cached | def _cached(self, dbname, coll, index):
"""Test if `index` is cached."""
cache = self.__index_cache
now = datetime.datetime.utcnow()
with self.__index_cache_lock:
return (dbname in cache and
coll in cache[dbname] and
index in cache[dbna... | python | def _cached(self, dbname, coll, index):
"""Test if `index` is cached."""
cache = self.__index_cache
now = datetime.datetime.utcnow()
with self.__index_cache_lock:
return (dbname in cache and
coll in cache[dbname] and
index in cache[dbna... | [
"def",
"_cached",
"(",
"self",
",",
"dbname",
",",
"coll",
",",
"index",
")",
":",
"cache",
"=",
"self",
".",
"__index_cache",
"now",
"=",
"datetime",
".",
"datetime",
".",
"utcnow",
"(",
")",
"with",
"self",
".",
"__index_cache_lock",
":",
"return",
"... | Test if `index` is cached. | [
"Test",
"if",
"index",
"is",
"cached",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L556-L564 | train | Test if index is cached. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._purge_index | def _purge_index(self, database_name,
collection_name=None, index_name=None):
"""Purge an index from the index cache.
If `index_name` is None purge an entire collection.
If `collection_name` is None purge an entire database.
"""
with self.__index_cache_lock... | python | def _purge_index(self, database_name,
collection_name=None, index_name=None):
"""Purge an index from the index cache.
If `index_name` is None purge an entire collection.
If `collection_name` is None purge an entire database.
"""
with self.__index_cache_lock... | [
"def",
"_purge_index",
"(",
"self",
",",
"database_name",
",",
"collection_name",
"=",
"None",
",",
"index_name",
"=",
"None",
")",
":",
"with",
"self",
".",
"__index_cache_lock",
":",
"if",
"not",
"database_name",
"in",
"self",
".",
"__index_cache",
":",
"r... | Purge an index from the index cache.
If `index_name` is None purge an entire collection.
If `collection_name` is None purge an entire database. | [
"Purge",
"an",
"index",
"from",
"the",
"index",
"cache",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L584-L608 | train | Purge an index from the index cache. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._server_property | def _server_property(self, attr_name):
"""An attribute of the current server's description.
If the client is not connected, this will block until a connection is
established or raise ServerSelectionTimeoutError if no server is
available.
Not threadsafe if used multiple times in... | python | def _server_property(self, attr_name):
"""An attribute of the current server's description.
If the client is not connected, this will block until a connection is
established or raise ServerSelectionTimeoutError if no server is
available.
Not threadsafe if used multiple times in... | [
"def",
"_server_property",
"(",
"self",
",",
"attr_name",
")",
":",
"server",
"=",
"self",
".",
"_topology",
".",
"select_server",
"(",
"writable_server_selector",
")",
"return",
"getattr",
"(",
"server",
".",
"description",
",",
"attr_name",
")"
] | An attribute of the current server's description.
If the client is not connected, this will block until a connection is
established or raise ServerSelectionTimeoutError if no server is
available.
Not threadsafe if used multiple times in a single method, since
the server may cha... | [
"An",
"attribute",
"of",
"the",
"current",
"server",
"s",
"description",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L610-L624 | train | An attribute of the current server s description. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.address | def address(self):
"""(host, port) of the current standalone, primary, or mongos, or None.
Accessing :attr:`address` raises :exc:`~.errors.InvalidOperation` if
the client is load-balancing among mongoses, since there is no single
address. Use :attr:`nodes` instead.
If the clien... | python | def address(self):
"""(host, port) of the current standalone, primary, or mongos, or None.
Accessing :attr:`address` raises :exc:`~.errors.InvalidOperation` if
the client is load-balancing among mongoses, since there is no single
address. Use :attr:`nodes` instead.
If the clien... | [
"def",
"address",
"(",
"self",
")",
":",
"topology_type",
"=",
"self",
".",
"_topology",
".",
"_description",
".",
"topology_type",
"if",
"topology_type",
"==",
"TOPOLOGY_TYPE",
".",
"Sharded",
":",
"raise",
"InvalidOperation",
"(",
"'Cannot use \"address\" property... | (host, port) of the current standalone, primary, or mongos, or None.
Accessing :attr:`address` raises :exc:`~.errors.InvalidOperation` if
the client is load-balancing among mongoses, since there is no single
address. Use :attr:`nodes` instead.
If the client is not connected, this will ... | [
"(",
"host",
"port",
")",
"of",
"the",
"current",
"standalone",
"primary",
"or",
"mongos",
"or",
"None",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L635-L656 | train | Returns the value of the address property of the current node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.nodes | def nodes(self):
"""Set of all currently connected servers.
.. warning:: When connected to a replica set the value of :attr:`nodes`
can change over time as :class:`MongoClient`'s view of the replica
set changes. :attr:`nodes` can also be an empty set when
:class:`MongoClie... | python | def nodes(self):
"""Set of all currently connected servers.
.. warning:: When connected to a replica set the value of :attr:`nodes`
can change over time as :class:`MongoClient`'s view of the replica
set changes. :attr:`nodes` can also be an empty set when
:class:`MongoClie... | [
"def",
"nodes",
"(",
"self",
")",
":",
"description",
"=",
"self",
".",
"_topology",
".",
"description",
"return",
"frozenset",
"(",
"s",
".",
"address",
"for",
"s",
"in",
"description",
".",
"known_servers",
")"
] | Set of all currently connected servers.
.. warning:: When connected to a replica set the value of :attr:`nodes`
can change over time as :class:`MongoClient`'s view of the replica
set changes. :attr:`nodes` can also be an empty set when
:class:`MongoClient` is first instantiated an... | [
"Set",
"of",
"all",
"currently",
"connected",
"servers",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L746-L757 | train | Set of all currently connected servers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._is_writable | def _is_writable(self):
"""Attempt to connect to a writable server, or return False.
"""
topology = self._get_topology() # Starts monitors if necessary.
try:
svr = topology.select_server(writable_server_selector)
# When directly connected to a secondary, arbiter... | python | def _is_writable(self):
"""Attempt to connect to a writable server, or return False.
"""
topology = self._get_topology() # Starts monitors if necessary.
try:
svr = topology.select_server(writable_server_selector)
# When directly connected to a secondary, arbiter... | [
"def",
"_is_writable",
"(",
"self",
")",
":",
"topology",
"=",
"self",
".",
"_get_topology",
"(",
")",
"# Starts monitors if necessary.",
"try",
":",
"svr",
"=",
"topology",
".",
"select_server",
"(",
"writable_server_selector",
")",
"# When directly connected to a se... | Attempt to connect to a writable server, or return False. | [
"Attempt",
"to",
"connect",
"to",
"a",
"writable",
"server",
"or",
"return",
"False",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L802-L814 | train | Attempt to connect to a writable server and return True. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.set_cursor_manager | def set_cursor_manager(self, manager_class):
"""DEPRECATED - Set this client's cursor manager.
Raises :class:`TypeError` if `manager_class` is not a subclass of
:class:`~pymongo.cursor_manager.CursorManager`. A cursor manager
handles closing cursors. Different managers can implement dif... | python | def set_cursor_manager(self, manager_class):
"""DEPRECATED - Set this client's cursor manager.
Raises :class:`TypeError` if `manager_class` is not a subclass of
:class:`~pymongo.cursor_manager.CursorManager`. A cursor manager
handles closing cursors. Different managers can implement dif... | [
"def",
"set_cursor_manager",
"(",
"self",
",",
"manager_class",
")",
":",
"warnings",
".",
"warn",
"(",
"\"set_cursor_manager is Deprecated\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"manager",
"=",
"manager_class",
"(",
"self",
")",
"if",
... | DEPRECATED - Set this client's cursor manager.
Raises :class:`TypeError` if `manager_class` is not a subclass of
:class:`~pymongo.cursor_manager.CursorManager`. A cursor manager
handles closing cursors. Different managers can implement different
policies in terms of when to actually kil... | [
"DEPRECATED",
"-",
"Set",
"this",
"client",
"s",
"cursor",
"manager",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L828-L855 | train | Deprecated - Set this client s cursor manager. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._send_message_with_response | def _send_message_with_response(self, operation, read_preference=None,
exhaust=False, address=None):
"""Send a message to MongoDB and return a Response.
:Parameters:
- `operation`: a _Query or _GetMore object.
- `read_preference` (optional): A Rea... | python | def _send_message_with_response(self, operation, read_preference=None,
exhaust=False, address=None):
"""Send a message to MongoDB and return a Response.
:Parameters:
- `operation`: a _Query or _GetMore object.
- `read_preference` (optional): A Rea... | [
"def",
"_send_message_with_response",
"(",
"self",
",",
"operation",
",",
"read_preference",
"=",
"None",
",",
"exhaust",
"=",
"False",
",",
"address",
"=",
"None",
")",
":",
"with",
"self",
".",
"__lock",
":",
"# If needed, restart kill-cursors thread after a fork.... | Send a message to MongoDB and return a Response.
:Parameters:
- `operation`: a _Query or _GetMore object.
- `read_preference` (optional): A ReadPreference.
- `exhaust` (optional): If True, the socket used stays checked out.
It is returned along with its Pool in the Res... | [
"Send",
"a",
"message",
"to",
"MongoDB",
"and",
"return",
"a",
"Response",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L909-L950 | train | Send a message to MongoDB and return a Response. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._reset_on_error | def _reset_on_error(self, server, func, *args, **kwargs):
"""Execute an operation. Reset the server on network error.
Returns fn()'s return value on success. On error, clears the server's
pool and marks the server Unknown.
Re-raises any exception thrown by fn().
"""
try... | python | def _reset_on_error(self, server, func, *args, **kwargs):
"""Execute an operation. Reset the server on network error.
Returns fn()'s return value on success. On error, clears the server's
pool and marks the server Unknown.
Re-raises any exception thrown by fn().
"""
try... | [
"def",
"_reset_on_error",
"(",
"self",
",",
"server",
",",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"NetworkTimeout",
":",
"# The socket has bee... | Execute an operation. Reset the server on network error.
Returns fn()'s return value on success. On error, clears the server's
pool and marks the server Unknown.
Re-raises any exception thrown by fn(). | [
"Execute",
"an",
"operation",
".",
"Reset",
"the",
"server",
"on",
"network",
"error",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L952-L967 | train | Execute an operation on network error. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.close_cursor | def close_cursor(self, cursor_id, address=None):
"""Send a kill cursors message soon with the given id.
Raises :class:`TypeError` if `cursor_id` is not an instance of
``(int, long)``. What closing the cursor actually means
depends on this client's cursor manager.
This method ma... | python | def close_cursor(self, cursor_id, address=None):
"""Send a kill cursors message soon with the given id.
Raises :class:`TypeError` if `cursor_id` is not an instance of
``(int, long)``. What closing the cursor actually means
depends on this client's cursor manager.
This method ma... | [
"def",
"close_cursor",
"(",
"self",
",",
"cursor_id",
",",
"address",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"cursor_id",
",",
"integer_types",
")",
":",
"raise",
"TypeError",
"(",
"\"cursor_id must be an instance of (int, long)\"",
")",
"if",
"s... | Send a kill cursors message soon with the given id.
Raises :class:`TypeError` if `cursor_id` is not an instance of
``(int, long)``. What closing the cursor actually means
depends on this client's cursor manager.
This method may be called from a :class:`~pymongo.cursor.Cursor`
d... | [
"Send",
"a",
"kill",
"cursors",
"message",
"soon",
"with",
"the",
"given",
"id",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1044-L1071 | train | Send a kill cursors message soon with the given id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient._close_cursor_now | def _close_cursor_now(self, cursor_id, address=None):
"""Send a kill cursors message with the given id.
What closing the cursor actually means depends on this client's
cursor manager. If there is none, the cursor is closed synchronously
on the current thread.
"""
if not ... | python | def _close_cursor_now(self, cursor_id, address=None):
"""Send a kill cursors message with the given id.
What closing the cursor actually means depends on this client's
cursor manager. If there is none, the cursor is closed synchronously
on the current thread.
"""
if not ... | [
"def",
"_close_cursor_now",
"(",
"self",
",",
"cursor_id",
",",
"address",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"cursor_id",
",",
"integer_types",
")",
":",
"raise",
"TypeError",
"(",
"\"cursor_id must be an instance of (int, long)\"",
")",
"if",... | Send a kill cursors message with the given id.
What closing the cursor actually means depends on this client's
cursor manager. If there is none, the cursor is closed synchronously
on the current thread. | [
"Send",
"a",
"kill",
"cursors",
"message",
"with",
"the",
"given",
"id",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1073-L1086 | train | Send a kill cursors message with the given id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.kill_cursors | def kill_cursors(self, cursor_ids, address=None):
"""DEPRECATED - Send a kill cursors message soon with the given ids.
Raises :class:`TypeError` if `cursor_ids` is not an instance of
``list``.
:Parameters:
- `cursor_ids`: list of cursor ids to kill
- `address` (opti... | python | def kill_cursors(self, cursor_ids, address=None):
"""DEPRECATED - Send a kill cursors message soon with the given ids.
Raises :class:`TypeError` if `cursor_ids` is not an instance of
``list``.
:Parameters:
- `cursor_ids`: list of cursor ids to kill
- `address` (opti... | [
"def",
"kill_cursors",
"(",
"self",
",",
"cursor_ids",
",",
"address",
"=",
"None",
")",
":",
"warnings",
".",
"warn",
"(",
"\"kill_cursors is deprecated.\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"if",
"not",
"isinstance",
"(",
"cursor_... | DEPRECATED - Send a kill cursors message soon with the given ids.
Raises :class:`TypeError` if `cursor_ids` is not an instance of
``list``.
:Parameters:
- `cursor_ids`: list of cursor ids to kill
- `address` (optional): (host, port) pair of the cursor's server.
... | [
"DEPRECATED",
"-",
"Send",
"a",
"kill",
"cursors",
"message",
"soon",
"with",
"the",
"given",
"ids",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1088-L1117 | train | Sends a kill cursors message soon with the given ids. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.drop_database | def drop_database(self, name_or_database):
"""Drop a database.
Raises :class:`TypeError` if `name_or_database` is not an instance of
:class:`basestring` (:class:`str` in python 3) or
:class:`~pymongo.database.Database`.
:Parameters:
- `name_or_database`: the name of a... | python | def drop_database(self, name_or_database):
"""Drop a database.
Raises :class:`TypeError` if `name_or_database` is not an instance of
:class:`basestring` (:class:`str` in python 3) or
:class:`~pymongo.database.Database`.
:Parameters:
- `name_or_database`: the name of a... | [
"def",
"drop_database",
"(",
"self",
",",
"name_or_database",
")",
":",
"name",
"=",
"name_or_database",
"if",
"isinstance",
"(",
"name",
",",
"database",
".",
"Database",
")",
":",
"name",
"=",
"name",
".",
"name",
"if",
"not",
"isinstance",
"(",
"name",
... | Drop a database.
Raises :class:`TypeError` if `name_or_database` is not an instance of
:class:`basestring` (:class:`str` in python 3) or
:class:`~pymongo.database.Database`.
:Parameters:
- `name_or_database`: the name of a database to drop, or a
:class:`~pymongo.d... | [
"Drop",
"a",
"database",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1215-L1253 | train | Drop a database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.get_default_database | def get_default_database(self):
"""DEPRECATED - Get the database named in the MongoDB connection URI.
>>> uri = 'mongodb://host/my_database'
>>> client = MongoClient(uri)
>>> db = client.get_default_database()
>>> assert db.name == 'my_database'
>>> db = client.get_datab... | python | def get_default_database(self):
"""DEPRECATED - Get the database named in the MongoDB connection URI.
>>> uri = 'mongodb://host/my_database'
>>> client = MongoClient(uri)
>>> db = client.get_default_database()
>>> assert db.name == 'my_database'
>>> db = client.get_datab... | [
"def",
"get_default_database",
"(",
"self",
")",
":",
"warnings",
".",
"warn",
"(",
"\"get_default_database is deprecated. Use get_database \"",
"\"instead.\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"if",
"self",
".",
"__default_database_name",
"i... | DEPRECATED - Get the database named in the MongoDB connection URI.
>>> uri = 'mongodb://host/my_database'
>>> client = MongoClient(uri)
>>> db = client.get_default_database()
>>> assert db.name == 'my_database'
>>> db = client.get_database()
>>> assert db.name == 'my_dat... | [
"DEPRECATED",
"-",
"Get",
"the",
"database",
"named",
"in",
"the",
"MongoDB",
"connection",
"URI",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1255-L1276 | train | Deprecated - Get the default database 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.get_database | def get_database(self, name=None, codec_options=None, read_preference=None,
write_concern=None, read_concern=None):
"""Get a :class:`~pymongo.database.Database` with the given name and
options.
Useful for creating a :class:`~pymongo.database.Database` with
different... | python | def get_database(self, name=None, codec_options=None, read_preference=None,
write_concern=None, read_concern=None):
"""Get a :class:`~pymongo.database.Database` with the given name and
options.
Useful for creating a :class:`~pymongo.database.Database` with
different... | [
"def",
"get_database",
"(",
"self",
",",
"name",
"=",
"None",
",",
"codec_options",
"=",
"None",
",",
"read_preference",
"=",
"None",
",",
"write_concern",
"=",
"None",
",",
"read_concern",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"if",
... | Get a :class:`~pymongo.database.Database` with the given name and
options.
Useful for creating a :class:`~pymongo.database.Database` with
different codec options, read preference, and/or write concern from
this :class:`MongoClient`.
>>> client.read_preference
Primar... | [
"Get",
"a",
":",
"class",
":",
"~pymongo",
".",
"database",
".",
"Database",
"with",
"the",
"given",
"name",
"and",
"options",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1278-L1330 | train | Get a database with the given name and options. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.fsync | def fsync(self, **kwargs):
"""Flush all pending writes to datafiles.
:Parameters:
Optional parameters can be passed as keyword arguments:
- `lock`: If True lock the server to disallow writes.
- `async`: If True don't block while synchronizing.
.. warni... | python | def fsync(self, **kwargs):
"""Flush all pending writes to datafiles.
:Parameters:
Optional parameters can be passed as keyword arguments:
- `lock`: If True lock the server to disallow writes.
- `async`: If True don't block while synchronizing.
.. warni... | [
"def",
"fsync",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"admin",
".",
"command",
"(",
"\"fsync\"",
",",
"read_preference",
"=",
"ReadPreference",
".",
"PRIMARY",
",",
"*",
"*",
"kwargs",
")"
] | Flush all pending writes to datafiles.
:Parameters:
Optional parameters can be passed as keyword arguments:
- `lock`: If True lock the server to disallow writes.
- `async`: If True don't block while synchronizing.
.. warning:: `async` and `lock` can not be use... | [
"Flush",
"all",
"pending",
"writes",
"to",
"datafiles",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1348-L1365 | train | Flush all pending writes to datafiles. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py | MongoClient.unlock | def unlock(self):
"""Unlock a previously locked server.
"""
cmd = {"fsyncUnlock": 1}
with self._socket_for_writes() as sock_info:
if sock_info.max_wire_version >= 4:
try:
sock_info.command("admin", cmd)
except OperationFailu... | python | def unlock(self):
"""Unlock a previously locked server.
"""
cmd = {"fsyncUnlock": 1}
with self._socket_for_writes() as sock_info:
if sock_info.max_wire_version >= 4:
try:
sock_info.command("admin", cmd)
except OperationFailu... | [
"def",
"unlock",
"(",
"self",
")",
":",
"cmd",
"=",
"{",
"\"fsyncUnlock\"",
":",
"1",
"}",
"with",
"self",
".",
"_socket_for_writes",
"(",
")",
"as",
"sock_info",
":",
"if",
"sock_info",
".",
"max_wire_version",
">=",
"4",
":",
"try",
":",
"sock_info",
... | Unlock a previously locked server. | [
"Unlock",
"a",
"previously",
"locked",
"server",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/mongo_client.py#L1367-L1382 | train | Unlock a previously locked server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | gunicorn/datadog_checks/gunicorn/gunicorn.py | GUnicornCheck.check | def check(self, instance):
""" Collect metrics for the given gunicorn instance. """
self.log.debug("Running instance: %s", instance)
custom_tags = instance.get('tags', [])
# Validate the config.
if not instance or self.PROC_NAME not in instance:
raise GUnicornCheckEr... | python | def check(self, instance):
""" Collect metrics for the given gunicorn instance. """
self.log.debug("Running instance: %s", instance)
custom_tags = instance.get('tags', [])
# Validate the config.
if not instance or self.PROC_NAME not in instance:
raise GUnicornCheckEr... | [
"def",
"check",
"(",
"self",
",",
"instance",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"\"Running instance: %s\"",
",",
"instance",
")",
"custom_tags",
"=",
"instance",
".",
"get",
"(",
"'tags'",
",",
"[",
"]",
")",
"# Validate the config.",
"if",
... | Collect metrics for the given gunicorn instance. | [
"Collect",
"metrics",
"for",
"the",
"given",
"gunicorn",
"instance",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/gunicorn/datadog_checks/gunicorn/gunicorn.py#L36-L63 | train | Check the gunicorn master process and submit the 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... |
DataDog/integrations-core | gunicorn/datadog_checks/gunicorn/gunicorn.py | GUnicornCheck._get_master_proc_by_name | def _get_master_proc_by_name(self, name, tags):
""" Return a psutil process for the master gunicorn process with the given name. """
master_name = GUnicornCheck._get_master_proc_name(name)
master_procs = [p for p in psutil.process_iter() if p.cmdline() and p.cmdline()[0] == master_name]
... | python | def _get_master_proc_by_name(self, name, tags):
""" Return a psutil process for the master gunicorn process with the given name. """
master_name = GUnicornCheck._get_master_proc_name(name)
master_procs = [p for p in psutil.process_iter() if p.cmdline() and p.cmdline()[0] == master_name]
... | [
"def",
"_get_master_proc_by_name",
"(",
"self",
",",
"name",
",",
"tags",
")",
":",
"master_name",
"=",
"GUnicornCheck",
".",
"_get_master_proc_name",
"(",
"name",
")",
"master_procs",
"=",
"[",
"p",
"for",
"p",
"in",
"psutil",
".",
"process_iter",
"(",
")",... | Return a psutil process for the master gunicorn process with the given name. | [
"Return",
"a",
"psutil",
"process",
"for",
"the",
"master",
"gunicorn",
"process",
"with",
"the",
"given",
"name",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/gunicorn/datadog_checks/gunicorn/gunicorn.py#L111-L126 | train | Return a psutil process for the master gunicorn process with 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... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py | CommandCursor.batch_size | def batch_size(self, batch_size):
"""Limits the number of documents returned in one batch. Each batch
requires a round trip to the server. It can be adjusted to optimize
performance and limit data transfer.
.. note:: batch_size can not override MongoDB's internal limits on the
... | python | def batch_size(self, batch_size):
"""Limits the number of documents returned in one batch. Each batch
requires a round trip to the server. It can be adjusted to optimize
performance and limit data transfer.
.. note:: batch_size can not override MongoDB's internal limits on the
... | [
"def",
"batch_size",
"(",
"self",
",",
"batch_size",
")",
":",
"if",
"not",
"isinstance",
"(",
"batch_size",
",",
"integer_types",
")",
":",
"raise",
"TypeError",
"(",
"\"batch_size must be an integer\"",
")",
"if",
"batch_size",
"<",
"0",
":",
"raise",
"Value... | Limits the number of documents returned in one batch. Each batch
requires a round trip to the server. It can be adjusted to optimize
performance and limit data transfer.
.. note:: batch_size can not override MongoDB's internal limits on the
amount of data it will return to the client... | [
"Limits",
"the",
"number",
"of",
"documents",
"returned",
"in",
"one",
"batch",
".",
"Each",
"batch",
"requires",
"a",
"round",
"trip",
"to",
"the",
"server",
".",
"It",
"can",
"be",
"adjusted",
"to",
"optimize",
"performance",
"and",
"limit",
"data",
"tra... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py#L70-L92 | train | Limits the number of documents returned in one batch. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py | CommandCursor.__send_message | def __send_message(self, operation):
"""Send a getmore message and handle the response.
"""
client = self.__collection.database.client
listeners = client._event_listeners
publish = listeners.enabled_for_commands
try:
response = client._send_message_with_respon... | python | def __send_message(self, operation):
"""Send a getmore message and handle the response.
"""
client = self.__collection.database.client
listeners = client._event_listeners
publish = listeners.enabled_for_commands
try:
response = client._send_message_with_respon... | [
"def",
"__send_message",
"(",
"self",
",",
"operation",
")",
":",
"client",
"=",
"self",
".",
"__collection",
".",
"database",
".",
"client",
"listeners",
"=",
"client",
".",
"_event_listeners",
"publish",
"=",
"listeners",
".",
"enabled_for_commands",
"try",
... | Send a getmore message and handle the response. | [
"Send",
"a",
"getmore",
"message",
"and",
"handle",
"the",
"response",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py#L94-L175 | train | Send a getmore message and handle the response. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py | CommandCursor._refresh | def _refresh(self):
"""Refreshes the cursor with more data from the server.
Returns the length of self.__data after refresh. Will exit early if
self.__data is already non-empty. Raises OperationFailure when the
cursor cannot be refreshed due to an error on the query.
"""
... | python | def _refresh(self):
"""Refreshes the cursor with more data from the server.
Returns the length of self.__data after refresh. Will exit early if
self.__data is already non-empty. Raises OperationFailure when the
cursor cannot be refreshed due to an error on the query.
"""
... | [
"def",
"_refresh",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"__data",
")",
"or",
"self",
".",
"__killed",
":",
"return",
"len",
"(",
"self",
".",
"__data",
")",
"if",
"self",
".",
"__id",
":",
"# Get More",
"dbname",
",",
"collname",
"... | Refreshes the cursor with more data from the server.
Returns the length of self.__data after refresh. Will exit early if
self.__data is already non-empty. Raises OperationFailure when the
cursor cannot be refreshed due to an error on the query. | [
"Refreshes",
"the",
"cursor",
"with",
"more",
"data",
"from",
"the",
"server",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py#L178-L200 | train | Refreshes the cursor with more data from the server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py | CommandCursor.next | def next(self):
"""Advance the cursor."""
if len(self.__data) or self._refresh():
coll = self.__collection
return coll.database._fix_outgoing(self.__data.popleft(), coll)
else:
raise StopIteration | python | def next(self):
"""Advance the cursor."""
if len(self.__data) or self._refresh():
coll = self.__collection
return coll.database._fix_outgoing(self.__data.popleft(), coll)
else:
raise StopIteration | [
"def",
"next",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"__data",
")",
"or",
"self",
".",
"_refresh",
"(",
")",
":",
"coll",
"=",
"self",
".",
"__collection",
"return",
"coll",
".",
"database",
".",
"_fix_outgoing",
"(",
"self",
".",
"... | Advance the cursor. | [
"Advance",
"the",
"cursor",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/command_cursor.py#L235-L241 | train | Advance the 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... |
DataDog/integrations-core | disk/datadog_checks/disk/disk.py | Disk._exclude_disk | def _exclude_disk(self, device, file_system, mount_point):
"""
Return True for disks we don't want or that match regex in the config file
"""
self.log.debug('_exclude_disk: {}, {}, {}'.format(device, file_system, mount_point))
if not device or device == 'none':
devic... | python | def _exclude_disk(self, device, file_system, mount_point):
"""
Return True for disks we don't want or that match regex in the config file
"""
self.log.debug('_exclude_disk: {}, {}, {}'.format(device, file_system, mount_point))
if not device or device == 'none':
devic... | [
"def",
"_exclude_disk",
"(",
"self",
",",
"device",
",",
"file_system",
",",
"mount_point",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"'_exclude_disk: {}, {}, {}'",
".",
"format",
"(",
"device",
",",
"file_system",
",",
"mount_point",
")",
")",
"if",
... | Return True for disks we don't want or that match regex in the config file | [
"Return",
"True",
"for",
"disks",
"we",
"don",
"t",
"want",
"or",
"that",
"match",
"regex",
"in",
"the",
"config",
"file"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/disk/datadog_checks/disk/disk.py#L165-L186 | train | Return True if disks we don t want or that match regex in the config file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | disk/datadog_checks/disk/disk.py | Disk._list_devices | def _list_devices(self, df_output):
"""
Given raw output for the df command, transform it into a normalized
list devices. A 'device' is a list with fields corresponding to the
output of df output on each platform.
"""
all_devices = [l.strip().split() for l in df_output.sp... | python | def _list_devices(self, df_output):
"""
Given raw output for the df command, transform it into a normalized
list devices. A 'device' is a list with fields corresponding to the
output of df output on each platform.
"""
all_devices = [l.strip().split() for l in df_output.sp... | [
"def",
"_list_devices",
"(",
"self",
",",
"df_output",
")",
":",
"all_devices",
"=",
"[",
"l",
".",
"strip",
"(",
")",
".",
"split",
"(",
")",
"for",
"l",
"in",
"df_output",
".",
"splitlines",
"(",
")",
"]",
"# Skip the header row and empty lines.",
"raw_d... | Given raw output for the df command, transform it into a normalized
list devices. A 'device' is a list with fields corresponding to the
output of df output on each platform. | [
"Given",
"raw",
"output",
"for",
"the",
"df",
"command",
"transform",
"it",
"into",
"a",
"normalized",
"list",
"devices",
".",
"A",
"device",
"is",
"a",
"list",
"with",
"fields",
"corresponding",
"to",
"the",
"output",
"of",
"df",
"output",
"on",
"each",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/disk/datadog_checks/disk/disk.py#L362-L377 | train | Transform the raw output for the df command into a normalized
list devices. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | disk/datadog_checks/disk/disk.py | Disk._compile_tag_re | def _compile_tag_re(self):
"""
Compile regex strings from device_tag_re option and return list of compiled regex/tag pairs
"""
device_tag_list = []
for regex_str, tags in iteritems(self._device_tag_re):
try:
device_tag_list.append([re.compile(regex_str... | python | def _compile_tag_re(self):
"""
Compile regex strings from device_tag_re option and return list of compiled regex/tag pairs
"""
device_tag_list = []
for regex_str, tags in iteritems(self._device_tag_re):
try:
device_tag_list.append([re.compile(regex_str... | [
"def",
"_compile_tag_re",
"(",
"self",
")",
":",
"device_tag_list",
"=",
"[",
"]",
"for",
"regex_str",
",",
"tags",
"in",
"iteritems",
"(",
"self",
".",
"_device_tag_re",
")",
":",
"try",
":",
"device_tag_list",
".",
"append",
"(",
"[",
"re",
".",
"compi... | Compile regex strings from device_tag_re option and return list of compiled regex/tag pairs | [
"Compile",
"regex",
"strings",
"from",
"device_tag_re",
"option",
"and",
"return",
"list",
"of",
"compiled",
"regex",
"/",
"tag",
"pairs"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/disk/datadog_checks/disk/disk.py#L447-L457 | train | Compile regex strings from device_tag_re option and return list of compiled regex / tag pairs | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/objects_queue.py | ObjectsQueue.fill | def fill(self, key, mor_dict):
"""
Set a dict mapping (resouce_type --> objects[]) for a given key
"""
with self._objects_queue_lock:
self._objects_queue[key] = mor_dict | python | def fill(self, key, mor_dict):
"""
Set a dict mapping (resouce_type --> objects[]) for a given key
"""
with self._objects_queue_lock:
self._objects_queue[key] = mor_dict | [
"def",
"fill",
"(",
"self",
",",
"key",
",",
"mor_dict",
")",
":",
"with",
"self",
".",
"_objects_queue_lock",
":",
"self",
".",
"_objects_queue",
"[",
"key",
"]",
"=",
"mor_dict"
] | Set a dict mapping (resouce_type --> objects[]) for a given key | [
"Set",
"a",
"dict",
"mapping",
"(",
"resouce_type",
"--",
">",
"objects",
"[]",
")",
"for",
"a",
"given",
"key"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/objects_queue.py#L18-L23 | train | Fill the dict with a given key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/objects_queue.py | ObjectsQueue.size | def size(self, key, resource_type):
"""
Return the size of the queue for a given key and resource type.
If the key is not in the cache, this will raise a KeyError.
"""
with self._objects_queue_lock:
return len(self._objects_queue[key].get(resource_type, [])) | python | def size(self, key, resource_type):
"""
Return the size of the queue for a given key and resource type.
If the key is not in the cache, this will raise a KeyError.
"""
with self._objects_queue_lock:
return len(self._objects_queue[key].get(resource_type, [])) | [
"def",
"size",
"(",
"self",
",",
"key",
",",
"resource_type",
")",
":",
"with",
"self",
".",
"_objects_queue_lock",
":",
"return",
"len",
"(",
"self",
".",
"_objects_queue",
"[",
"key",
"]",
".",
"get",
"(",
"resource_type",
",",
"[",
"]",
")",
")"
] | Return the size of the queue for a given key and resource type.
If the key is not in the cache, this will raise a KeyError. | [
"Return",
"the",
"size",
"of",
"the",
"queue",
"for",
"a",
"given",
"key",
"and",
"resource",
"type",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"cache",
"this",
"will",
"raise",
"a",
"KeyError",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/objects_queue.py#L29-L35 | train | Return the size of the queue for a given key and resource 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... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/objects_queue.py | ObjectsQueue.pop | def pop(self, key, resource_type):
"""
Extract an object from the list.
If the key is not in the cache, this will raise a KeyError.
If the list is empty, method will return None
"""
with self._objects_queue_lock:
objects = self._objects_queue[key].get(resource... | python | def pop(self, key, resource_type):
"""
Extract an object from the list.
If the key is not in the cache, this will raise a KeyError.
If the list is empty, method will return None
"""
with self._objects_queue_lock:
objects = self._objects_queue[key].get(resource... | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"resource_type",
")",
":",
"with",
"self",
".",
"_objects_queue_lock",
":",
"objects",
"=",
"self",
".",
"_objects_queue",
"[",
"key",
"]",
".",
"get",
"(",
"resource_type",
",",
"[",
"]",
")",
"return",
"obj... | Extract an object from the list.
If the key is not in the cache, this will raise a KeyError.
If the list is empty, method will return None | [
"Extract",
"an",
"object",
"from",
"the",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"cache",
"this",
"will",
"raise",
"a",
"KeyError",
".",
"If",
"the",
"list",
"is",
"empty",
"method",
"will",
"return",
"None"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/objects_queue.py#L37-L45 | train | Removes an object from the list of objects for a given resource type from the cache. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/ssl_match_hostname.py | _ipaddress_match | def _ipaddress_match(ipname, host_ip):
"""Exact matching of IP addresses.
RFC 6125 explicitly doesn't define an algorithm for this
(section 1.7.2 - "Out of Scope").
"""
# OpenSSL may add a trailing newline to a subjectAltName's IP address
ip = ip_address(_unicode(ipname).rstrip())
return ip... | python | def _ipaddress_match(ipname, host_ip):
"""Exact matching of IP addresses.
RFC 6125 explicitly doesn't define an algorithm for this
(section 1.7.2 - "Out of Scope").
"""
# OpenSSL may add a trailing newline to a subjectAltName's IP address
ip = ip_address(_unicode(ipname).rstrip())
return ip... | [
"def",
"_ipaddress_match",
"(",
"ipname",
",",
"host_ip",
")",
":",
"# OpenSSL may add a trailing newline to a subjectAltName's IP address",
"ip",
"=",
"ip_address",
"(",
"_unicode",
"(",
"ipname",
")",
".",
"rstrip",
"(",
")",
")",
"return",
"ip",
"==",
"host_ip"
] | Exact matching of IP addresses.
RFC 6125 explicitly doesn't define an algorithm for this
(section 1.7.2 - "Out of Scope"). | [
"Exact",
"matching",
"of",
"IP",
"addresses",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/ssl_match_hostname.py#L75-L83 | train | Exact match of IP addresses. | Pu7Z6IJCgH3a,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.