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 | vsphere/datadog_checks/vsphere/vsphere.py | VSphereCheck._transform_value | def _transform_value(self, instance, counter_id, value):
""" Given the counter_id, look up for the metrics metadata to check the vsphere
type of the counter and apply pre-reporting transformation if needed.
"""
i_key = self._instance_key(instance)
try:
metadata = self... | python | def _transform_value(self, instance, counter_id, value):
""" Given the counter_id, look up for the metrics metadata to check the vsphere
type of the counter and apply pre-reporting transformation if needed.
"""
i_key = self._instance_key(instance)
try:
metadata = self... | [
"def",
"_transform_value",
"(",
"self",
",",
"instance",
",",
"counter_id",
",",
"value",
")",
":",
"i_key",
"=",
"self",
".",
"_instance_key",
"(",
"instance",
")",
"try",
":",
"metadata",
"=",
"self",
".",
"metadata_cache",
".",
"get_metadata",
"(",
"i_k... | Given the counter_id, look up for the metrics metadata to check the vsphere
type of the counter and apply pre-reporting transformation if needed. | [
"Given",
"the",
"counter_id",
"look",
"up",
"for",
"the",
"metrics",
"metadata",
"to",
"check",
"the",
"vsphere",
"type",
"of",
"the",
"counter",
"and",
"apply",
"pre",
"-",
"reporting",
"transformation",
"if",
"needed",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/vsphere.py#L753-L766 | train | Given the value of a counter return the value with transformation if needed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/vsphere.py | VSphereCheck._collect_metrics_async | def _collect_metrics_async(self, instance, query_specs):
""" Task that collects the metrics listed in the morlist for one MOR
"""
# ## <TEST-INSTRUMENTATION>
t = Timer()
# ## </TEST-INSTRUMENTATION>
i_key = self._instance_key(instance)
server_instance = self._get_... | python | def _collect_metrics_async(self, instance, query_specs):
""" Task that collects the metrics listed in the morlist for one MOR
"""
# ## <TEST-INSTRUMENTATION>
t = Timer()
# ## </TEST-INSTRUMENTATION>
i_key = self._instance_key(instance)
server_instance = self._get_... | [
"def",
"_collect_metrics_async",
"(",
"self",
",",
"instance",
",",
"query_specs",
")",
":",
"# ## <TEST-INSTRUMENTATION>",
"t",
"=",
"Timer",
"(",
")",
"# ## </TEST-INSTRUMENTATION>",
"i_key",
"=",
"self",
".",
"_instance_key",
"(",
"instance",
")",
"server_instanc... | Task that collects the metrics listed in the morlist for one MOR | [
"Task",
"that",
"collects",
"the",
"metrics",
"listed",
"in",
"the",
"morlist",
"for",
"one",
"MOR"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/vsphere.py#L769-L834 | train | This method is used to collect the metrics from the MORs in the cache. It is responsible for getting the metrics from the MORs in 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 | vsphere/datadog_checks/vsphere/vsphere.py | VSphereCheck.collect_metrics | def collect_metrics(self, instance):
"""
Calls asynchronously _collect_metrics_async on all MORs, as the
job queue is processed the Aggregator will receive the metrics.
"""
i_key = self._instance_key(instance)
if not self.mor_cache.contains(i_key):
self.log.de... | python | def collect_metrics(self, instance):
"""
Calls asynchronously _collect_metrics_async on all MORs, as the
job queue is processed the Aggregator will receive the metrics.
"""
i_key = self._instance_key(instance)
if not self.mor_cache.contains(i_key):
self.log.de... | [
"def",
"collect_metrics",
"(",
"self",
",",
"instance",
")",
":",
"i_key",
"=",
"self",
".",
"_instance_key",
"(",
"instance",
")",
"if",
"not",
"self",
".",
"mor_cache",
".",
"contains",
"(",
"i_key",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
... | Calls asynchronously _collect_metrics_async on all MORs, as the
job queue is processed the Aggregator will receive the metrics. | [
"Calls",
"asynchronously",
"_collect_metrics_async",
"on",
"all",
"MORs",
"as",
"the",
"job",
"queue",
"is",
"processed",
"the",
"Aggregator",
"will",
"receive",
"the",
"metrics",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/vsphere.py#L837-L883 | train | Collect metrics for all MORs in the MOR list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer._check_db_exists | def _check_db_exists(self, instance):
"""
Check if the database we're targeting actually exists
If not then we won't do any checks
This allows the same config to be installed on many servers but fail gracefully
"""
dsn, host, username, password, database, driver = self._... | python | def _check_db_exists(self, instance):
"""
Check if the database we're targeting actually exists
If not then we won't do any checks
This allows the same config to be installed on many servers but fail gracefully
"""
dsn, host, username, password, database, driver = self._... | [
"def",
"_check_db_exists",
"(",
"self",
",",
"instance",
")",
":",
"dsn",
",",
"host",
",",
"username",
",",
"password",
",",
"database",
",",
"driver",
"=",
"self",
".",
"_get_access_info",
"(",
"instance",
",",
"self",
".",
"DEFAULT_DB_KEY",
")",
"contex... | Check if the database we're targeting actually exists
If not then we won't do any checks
This allows the same config to be installed on many servers but fail gracefully | [
"Check",
"if",
"the",
"database",
"we",
"re",
"targeting",
"actually",
"exists",
"If",
"not",
"then",
"we",
"won",
"t",
"do",
"any",
"checks",
"This",
"allows",
"the",
"same",
"config",
"to",
"be",
"installed",
"on",
"many",
"servers",
"but",
"fail",
"gr... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L178-L202 | train | Check if the database we re targeting actually exists | Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer._make_metric_list_to_collect | def _make_metric_list_to_collect(self, instance, custom_metrics):
"""
Store the list of metrics to collect by instance_key.
Will also create and cache cursors to query the db.
"""
metrics_to_collect = []
for name, counter_name, instance_name in self.METRICS:
t... | python | def _make_metric_list_to_collect(self, instance, custom_metrics):
"""
Store the list of metrics to collect by instance_key.
Will also create and cache cursors to query the db.
"""
metrics_to_collect = []
for name, counter_name, instance_name in self.METRICS:
t... | [
"def",
"_make_metric_list_to_collect",
"(",
"self",
",",
"instance",
",",
"custom_metrics",
")",
":",
"metrics_to_collect",
"=",
"[",
"]",
"for",
"name",
",",
"counter_name",
",",
"instance_name",
"in",
"self",
".",
"METRICS",
":",
"try",
":",
"sql_type",
",",... | Store the list of metrics to collect by instance_key.
Will also create and cache cursors to query the db. | [
"Store",
"the",
"list",
"of",
"metrics",
"to",
"collect",
"by",
"instance_key",
".",
"Will",
"also",
"create",
"and",
"cache",
"cursors",
"to",
"query",
"the",
"db",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L204-L286 | train | Load the list of metrics to collect by 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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.typed_metric | def typed_metric(self, instance, cfg_inst, table, base_name, user_type, sql_type, column):
'''
Create the appropriate SqlServerMetric object, each implementing its method to
fetch the metrics properly.
If a `type` was specified in the config, it is used to report the value
direct... | python | def typed_metric(self, instance, cfg_inst, table, base_name, user_type, sql_type, column):
'''
Create the appropriate SqlServerMetric object, each implementing its method to
fetch the metrics properly.
If a `type` was specified in the config, it is used to report the value
direct... | [
"def",
"typed_metric",
"(",
"self",
",",
"instance",
",",
"cfg_inst",
",",
"table",
",",
"base_name",
",",
"user_type",
",",
"sql_type",
",",
"column",
")",
":",
"if",
"table",
"==",
"DEFAULT_PERFORMANCE_TABLE",
":",
"metric_type_mapping",
"=",
"{",
"PERF_COUN... | Create the appropriate SqlServerMetric object, each implementing its method to
fetch the metrics properly.
If a `type` was specified in the config, it is used to report the value
directly fetched from SQLServer. Otherwise, it is decided based on the
sql_type, according to microsoft's doc... | [
"Create",
"the",
"appropriate",
"SqlServerMetric",
"object",
"each",
"implementing",
"its",
"method",
"to",
"fetch",
"the",
"metrics",
"properly",
".",
"If",
"a",
"type",
"was",
"specified",
"in",
"the",
"config",
"it",
"is",
"used",
"to",
"report",
"the",
"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L288-L319 | train | Create the appropriate SqlServerMetric object for a typed metric. | Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer._get_access_info | def _get_access_info(self, instance, db_key, db_name=None):
''' Convenience method to extract info from instance
'''
dsn = instance.get('dsn')
host = instance.get('host')
username = instance.get('username')
password = instance.get('password')
database = instance.g... | python | def _get_access_info(self, instance, db_key, db_name=None):
''' Convenience method to extract info from instance
'''
dsn = instance.get('dsn')
host = instance.get('host')
username = instance.get('username')
password = instance.get('password')
database = instance.g... | [
"def",
"_get_access_info",
"(",
"self",
",",
"instance",
",",
"db_key",
",",
"db_name",
"=",
"None",
")",
":",
"dsn",
"=",
"instance",
".",
"get",
"(",
"'dsn'",
")",
"host",
"=",
"instance",
".",
"get",
"(",
"'host'",
")",
"username",
"=",
"instance",
... | Convenience method to extract info from instance | [
"Convenience",
"method",
"to",
"extract",
"info",
"from",
"instance"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L341-L357 | train | Utility method to extract info from instance and db_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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer._conn_key | def _conn_key(self, instance, db_key, db_name=None):
''' Return a key to use for the connection cache
'''
dsn, host, username, password, database, driver = self._get_access_info(instance, db_key, db_name)
return '{}:{}:{}:{}:{}:{}'.format(dsn, host, username, password, database, driver) | python | def _conn_key(self, instance, db_key, db_name=None):
''' Return a key to use for the connection cache
'''
dsn, host, username, password, database, driver = self._get_access_info(instance, db_key, db_name)
return '{}:{}:{}:{}:{}:{}'.format(dsn, host, username, password, database, driver) | [
"def",
"_conn_key",
"(",
"self",
",",
"instance",
",",
"db_key",
",",
"db_name",
"=",
"None",
")",
":",
"dsn",
",",
"host",
",",
"username",
",",
"password",
",",
"database",
",",
"driver",
"=",
"self",
".",
"_get_access_info",
"(",
"instance",
",",
"d... | Return a key to use for the connection cache | [
"Return",
"a",
"key",
"to",
"use",
"for",
"the",
"connection",
"cache"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L359-L363 | train | Return a key to use for the connection 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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer._conn_string_odbc | def _conn_string_odbc(self, db_key, instance=None, conn_key=None, db_name=None):
''' Return a connection string to use with odbc
'''
if instance:
dsn, host, username, password, database, driver = self._get_access_info(instance, db_key, db_name)
elif conn_key:
dsn,... | python | def _conn_string_odbc(self, db_key, instance=None, conn_key=None, db_name=None):
''' Return a connection string to use with odbc
'''
if instance:
dsn, host, username, password, database, driver = self._get_access_info(instance, db_key, db_name)
elif conn_key:
dsn,... | [
"def",
"_conn_string_odbc",
"(",
"self",
",",
"db_key",
",",
"instance",
"=",
"None",
",",
"conn_key",
"=",
"None",
",",
"db_name",
"=",
"None",
")",
":",
"if",
"instance",
":",
"dsn",
",",
"host",
",",
"username",
",",
"password",
",",
"database",
","... | Return a connection string to use with odbc | [
"Return",
"a",
"connection",
"string",
"to",
"use",
"with",
"odbc"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L365-L389 | train | Return a connection string to use with odbc
| Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer._conn_string_adodbapi | def _conn_string_adodbapi(self, db_key, instance=None, conn_key=None, db_name=None):
''' Return a connection string to use with adodbapi
'''
if instance:
_, host, username, password, database, _ = self._get_access_info(instance, db_key, db_name)
elif conn_key:
_, ... | python | def _conn_string_adodbapi(self, db_key, instance=None, conn_key=None, db_name=None):
''' Return a connection string to use with adodbapi
'''
if instance:
_, host, username, password, database, _ = self._get_access_info(instance, db_key, db_name)
elif conn_key:
_, ... | [
"def",
"_conn_string_adodbapi",
"(",
"self",
",",
"db_key",
",",
"instance",
"=",
"None",
",",
"conn_key",
"=",
"None",
",",
"db_name",
"=",
"None",
")",
":",
"if",
"instance",
":",
"_",
",",
"host",
",",
"username",
",",
"password",
",",
"database",
"... | Return a connection string to use with adodbapi | [
"Return",
"a",
"connection",
"string",
"to",
"use",
"with",
"adodbapi"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L391-L408 | train | Return a connection string to use with adodbapi | Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.get_cursor | def get_cursor(self, instance, db_key, db_name=None):
'''
Return a cursor to execute query against the db
Cursor are cached in the self.connections dict
'''
conn_key = self._conn_key(instance, db_key, db_name)
try:
conn = self.connections[conn_key]['conn']
... | python | def get_cursor(self, instance, db_key, db_name=None):
'''
Return a cursor to execute query against the db
Cursor are cached in the self.connections dict
'''
conn_key = self._conn_key(instance, db_key, db_name)
try:
conn = self.connections[conn_key]['conn']
... | [
"def",
"get_cursor",
"(",
"self",
",",
"instance",
",",
"db_key",
",",
"db_name",
"=",
"None",
")",
":",
"conn_key",
"=",
"self",
".",
"_conn_key",
"(",
"instance",
",",
"db_key",
",",
"db_name",
")",
"try",
":",
"conn",
"=",
"self",
".",
"connections"... | Return a cursor to execute query against the db
Cursor are cached in the self.connections dict | [
"Return",
"a",
"cursor",
"to",
"execute",
"query",
"against",
"the",
"db",
"Cursor",
"are",
"cached",
"in",
"the",
"self",
".",
"connections",
"dict"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L417-L430 | train | Return a cursor to execute query against the db
| Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.get_sql_type | def get_sql_type(self, instance, counter_name):
'''
Return the type of the performance counter so that we can report it to
Datadog correctly
If the sql_type is one that needs a base (PERF_RAW_LARGE_FRACTION and
PERF_AVERAGE_BULK), the name of the base counter will also be returne... | python | def get_sql_type(self, instance, counter_name):
'''
Return the type of the performance counter so that we can report it to
Datadog correctly
If the sql_type is one that needs a base (PERF_RAW_LARGE_FRACTION and
PERF_AVERAGE_BULK), the name of the base counter will also be returne... | [
"def",
"get_sql_type",
"(",
"self",
",",
"instance",
",",
"counter_name",
")",
":",
"with",
"self",
".",
"get_managed_cursor",
"(",
"instance",
",",
"self",
".",
"DEFAULT_DB_KEY",
")",
"as",
"cursor",
":",
"cursor",
".",
"execute",
"(",
"COUNTER_TYPE_QUERY",
... | Return the type of the performance counter so that we can report it to
Datadog correctly
If the sql_type is one that needs a base (PERF_RAW_LARGE_FRACTION and
PERF_AVERAGE_BULK), the name of the base counter will also be returned | [
"Return",
"the",
"type",
"of",
"the",
"performance",
"counter",
"so",
"that",
"we",
"can",
"report",
"it",
"to",
"Datadog",
"correctly",
"If",
"the",
"sql_type",
"is",
"one",
"that",
"needs",
"a",
"base",
"(",
"PERF_RAW_LARGE_FRACTION",
"and",
"PERF_AVERAGE_BU... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L432-L462 | train | Get the SQL type of the performance counter and the base name of the base. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.do_perf_counter_check | def do_perf_counter_check(self, instance):
"""
Fetch the metrics from the sys.dm_os_performance_counters table
"""
custom_tags = instance.get('tags', [])
if custom_tags is None:
custom_tags = []
instance_key = self._conn_key(instance, self.DEFAULT_DB_KEY)
... | python | def do_perf_counter_check(self, instance):
"""
Fetch the metrics from the sys.dm_os_performance_counters table
"""
custom_tags = instance.get('tags', [])
if custom_tags is None:
custom_tags = []
instance_key = self._conn_key(instance, self.DEFAULT_DB_KEY)
... | [
"def",
"do_perf_counter_check",
"(",
"self",
",",
"instance",
")",
":",
"custom_tags",
"=",
"instance",
".",
"get",
"(",
"'tags'",
",",
"[",
"]",
")",
"if",
"custom_tags",
"is",
"None",
":",
"custom_tags",
"=",
"[",
"]",
"instance_key",
"=",
"self",
".",... | Fetch the metrics from the sys.dm_os_performance_counters table | [
"Fetch",
"the",
"metrics",
"from",
"the",
"sys",
".",
"dm_os_performance_counters",
"table"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L474-L518 | train | Fetch the metrics from the sys. dm_os_performance_counters table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.do_stored_procedure_check | def do_stored_procedure_check(self, instance, proc):
"""
Fetch the metrics from the stored proc
"""
guardSql = instance.get('proc_only_if')
custom_tags = instance.get("tags", [])
if (guardSql and self.proc_check_guard(instance, guardSql)) or not guardSql:
se... | python | def do_stored_procedure_check(self, instance, proc):
"""
Fetch the metrics from the stored proc
"""
guardSql = instance.get('proc_only_if')
custom_tags = instance.get("tags", [])
if (guardSql and self.proc_check_guard(instance, guardSql)) or not guardSql:
se... | [
"def",
"do_stored_procedure_check",
"(",
"self",
",",
"instance",
",",
"proc",
")",
":",
"guardSql",
"=",
"instance",
".",
"get",
"(",
"'proc_only_if'",
")",
"custom_tags",
"=",
"instance",
".",
"get",
"(",
"\"tags\"",
",",
"[",
"]",
")",
"if",
"(",
"gua... | Fetch the metrics from the stored proc | [
"Fetch",
"the",
"metrics",
"from",
"the",
"stored",
"proc"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L520-L564 | train | Calls the stored procedure and checks the status of the stored procedure. | Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.proc_check_guard | def proc_check_guard(self, instance, sql):
"""
check to see if the guard SQL returns a single column containing 0 or 1
We return true if 1, else False
"""
self.open_db_connections(instance, self.PROC_GUARD_DB_KEY)
cursor = self.get_cursor(instance, self.PROC_GUARD_DB_KEY)... | python | def proc_check_guard(self, instance, sql):
"""
check to see if the guard SQL returns a single column containing 0 or 1
We return true if 1, else False
"""
self.open_db_connections(instance, self.PROC_GUARD_DB_KEY)
cursor = self.get_cursor(instance, self.PROC_GUARD_DB_KEY)... | [
"def",
"proc_check_guard",
"(",
"self",
",",
"instance",
",",
"sql",
")",
":",
"self",
".",
"open_db_connections",
"(",
"instance",
",",
"self",
".",
"PROC_GUARD_DB_KEY",
")",
"cursor",
"=",
"self",
".",
"get_cursor",
"(",
"instance",
",",
"self",
".",
"PR... | check to see if the guard SQL returns a single column containing 0 or 1
We return true if 1, else False | [
"check",
"to",
"see",
"if",
"the",
"guard",
"SQL",
"returns",
"a",
"single",
"column",
"containing",
"0",
"or",
"1",
"We",
"return",
"true",
"if",
"1",
"else",
"False"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L566-L584 | train | check to see if the guard SQL returns a single column containing 0 or 1 | Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.close_cursor | def close_cursor(self, cursor):
"""
We close the cursor explicitly b/c we had proven memory leaks
We handle any exception from closing, although according to the doc:
"in adodbapi, it is NOT an error to re-close a closed cursor"
"""
try:
cursor.close()
... | python | def close_cursor(self, cursor):
"""
We close the cursor explicitly b/c we had proven memory leaks
We handle any exception from closing, although according to the doc:
"in adodbapi, it is NOT an error to re-close a closed cursor"
"""
try:
cursor.close()
... | [
"def",
"close_cursor",
"(",
"self",
",",
"cursor",
")",
":",
"try",
":",
"cursor",
".",
"close",
"(",
")",
"except",
"Exception",
"as",
"e",
":",
"self",
".",
"log",
".",
"warning",
"(",
"\"Could not close adodbapi cursor\\n{}\"",
".",
"format",
"(",
"e",
... | We close the cursor explicitly b/c we had proven memory leaks
We handle any exception from closing, although according to the doc:
"in adodbapi, it is NOT an error to re-close a closed cursor" | [
"We",
"close",
"the",
"cursor",
"explicitly",
"b",
"/",
"c",
"we",
"had",
"proven",
"memory",
"leaks",
"We",
"handle",
"any",
"exception",
"from",
"closing",
"although",
"according",
"to",
"the",
"doc",
":",
"in",
"adodbapi",
"it",
"is",
"NOT",
"an",
"er... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L586-L595 | train | Closes the cursor explicitly b/c we had proven memory leaks
We handle any exception from closing | Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.close_db_connections | def close_db_connections(self, instance, db_key, db_name=None):
"""
We close the db connections explicitly b/c when we don't they keep
locks on the db. This presents as issues such as the SQL Server Agent
being unable to stop.
"""
conn_key = self._conn_key(instance, db_ke... | python | def close_db_connections(self, instance, db_key, db_name=None):
"""
We close the db connections explicitly b/c when we don't they keep
locks on the db. This presents as issues such as the SQL Server Agent
being unable to stop.
"""
conn_key = self._conn_key(instance, db_ke... | [
"def",
"close_db_connections",
"(",
"self",
",",
"instance",
",",
"db_key",
",",
"db_name",
"=",
"None",
")",
":",
"conn_key",
"=",
"self",
".",
"_conn_key",
"(",
"instance",
",",
"db_key",
",",
"db_name",
")",
"if",
"conn_key",
"not",
"in",
"self",
".",... | We close the db connections explicitly b/c when we don't they keep
locks on the db. This presents as issues such as the SQL Server Agent
being unable to stop. | [
"We",
"close",
"the",
"db",
"connections",
"explicitly",
"b",
"/",
"c",
"when",
"we",
"don",
"t",
"they",
"keep",
"locks",
"on",
"the",
"db",
".",
"This",
"presents",
"as",
"issues",
"such",
"as",
"the",
"SQL",
"Server",
"Agent",
"being",
"unable",
"to... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L597-L611 | train | Closes the db connections for the current 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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SQLServer.open_db_connections | def open_db_connections(self, instance, db_key, db_name=None):
"""
We open the db connections explicitly, so we can ensure they are open
before we use them, and are closable, once we are finished. Open db
connections keep locks on the db, presenting issues such as the SQL
Server ... | python | def open_db_connections(self, instance, db_key, db_name=None):
"""
We open the db connections explicitly, so we can ensure they are open
before we use them, and are closable, once we are finished. Open db
connections keep locks on the db, presenting issues such as the SQL
Server ... | [
"def",
"open_db_connections",
"(",
"self",
",",
"instance",
",",
"db_key",
",",
"db_name",
"=",
"None",
")",
":",
"conn_key",
"=",
"self",
".",
"_conn_key",
"(",
"instance",
",",
"db_key",
",",
"db_name",
")",
"timeout",
"=",
"int",
"(",
"instance",
".",... | We open the db connections explicitly, so we can ensure they are open
before we use them, and are closable, once we are finished. Open db
connections keep locks on the db, presenting issues such as the SQL
Server Agent being unable to stop. | [
"We",
"open",
"the",
"db",
"connections",
"explicitly",
"so",
"we",
"can",
"ensure",
"they",
"are",
"open",
"before",
"we",
"use",
"them",
"and",
"are",
"closable",
"once",
"we",
"are",
"finished",
".",
"Open",
"db",
"connections",
"keep",
"locks",
"on",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L620-L673 | train | Open the db connections. | Pu7Z6IJCgH3a,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 | sqlserver/datadog_checks/sqlserver/sqlserver.py | SqlFractionMetric.fetch_metric | def fetch_metric(self, cursor, results, tags):
'''
Because we need to query the metrics by matching pairs, we can't query
all of them together without having to perform some matching based on
the name afterwards so instead we query instance by instance.
We cache the list of insta... | python | def fetch_metric(self, cursor, results, tags):
'''
Because we need to query the metrics by matching pairs, we can't query
all of them together without having to perform some matching based on
the name afterwards so instead we query instance by instance.
We cache the list of insta... | [
"def",
"fetch_metric",
"(",
"self",
",",
"cursor",
",",
"results",
",",
"tags",
")",
":",
"if",
"self",
".",
"sql_name",
"not",
"in",
"results",
":",
"self",
".",
"log",
".",
"warning",
"(",
"\"Couldn't find {} in results\"",
".",
"format",
"(",
"self",
... | Because we need to query the metrics by matching pairs, we can't query
all of them together without having to perform some matching based on
the name afterwards so instead we query instance by instance.
We cache the list of instance so that we don't have to look it up every time | [
"Because",
"we",
"need",
"to",
"query",
"the",
"metrics",
"by",
"matching",
"pairs",
"we",
"can",
"t",
"query",
"all",
"of",
"them",
"together",
"without",
"having",
"to",
"perform",
"some",
"matching",
"based",
"on",
"the",
"name",
"afterwards",
"so",
"in... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/sqlserver/datadog_checks/sqlserver/sqlserver.py#L766-L818 | train | This method is used to fetch the metric from the 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 | kube_dns/datadog_checks/kube_dns/kube_dns.py | KubeDNSCheck.create_generic_instances | def create_generic_instances(self, instances):
"""
Transform each Kube DNS instance into a OpenMetricsBaseCheck instance
"""
generic_instances = []
for instance in instances:
transformed_instance = self._create_kube_dns_instance(instance)
generic_instances... | python | def create_generic_instances(self, instances):
"""
Transform each Kube DNS instance into a OpenMetricsBaseCheck instance
"""
generic_instances = []
for instance in instances:
transformed_instance = self._create_kube_dns_instance(instance)
generic_instances... | [
"def",
"create_generic_instances",
"(",
"self",
",",
"instances",
")",
":",
"generic_instances",
"=",
"[",
"]",
"for",
"instance",
"in",
"instances",
":",
"transformed_instance",
"=",
"self",
".",
"_create_kube_dns_instance",
"(",
"instance",
")",
"generic_instances... | Transform each Kube DNS instance into a OpenMetricsBaseCheck instance | [
"Transform",
"each",
"Kube",
"DNS",
"instance",
"into",
"a",
"OpenMetricsBaseCheck",
"instance"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kube_dns/datadog_checks/kube_dns/kube_dns.py#L45-L54 | train | Transform each Kube DNS 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 | kube_dns/datadog_checks/kube_dns/kube_dns.py | KubeDNSCheck._create_kube_dns_instance | def _create_kube_dns_instance(self, instance):
"""
Set up kube_dns instance so it can be used in OpenMetricsBaseCheck
"""
kube_dns_instance = deepcopy(instance)
# kube_dns uses 'prometheus_endpoint' and not 'prometheus_url', so we have to rename the key
kube_dns_instance... | python | def _create_kube_dns_instance(self, instance):
"""
Set up kube_dns instance so it can be used in OpenMetricsBaseCheck
"""
kube_dns_instance = deepcopy(instance)
# kube_dns uses 'prometheus_endpoint' and not 'prometheus_url', so we have to rename the key
kube_dns_instance... | [
"def",
"_create_kube_dns_instance",
"(",
"self",
",",
"instance",
")",
":",
"kube_dns_instance",
"=",
"deepcopy",
"(",
"instance",
")",
"# kube_dns uses 'prometheus_endpoint' and not 'prometheus_url', so we have to rename the key",
"kube_dns_instance",
"[",
"'prometheus_url'",
"]... | Set up kube_dns instance so it can be used in OpenMetricsBaseCheck | [
"Set",
"up",
"kube_dns",
"instance",
"so",
"it",
"can",
"be",
"used",
"in",
"OpenMetricsBaseCheck"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kube_dns/datadog_checks/kube_dns/kube_dns.py#L56-L86 | train | Create kube_dns instance from instance 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 | kube_dns/datadog_checks/kube_dns/kube_dns.py | KubeDNSCheck.submit_as_gauge_and_monotonic_count | def submit_as_gauge_and_monotonic_count(self, metric_suffix, metric, scraper_config):
"""
submit a kube_dns metric both as a gauge (for compatibility) and as a monotonic_count
"""
metric_name = scraper_config['namespace'] + metric_suffix
for sample in metric.samples:
... | python | def submit_as_gauge_and_monotonic_count(self, metric_suffix, metric, scraper_config):
"""
submit a kube_dns metric both as a gauge (for compatibility) and as a monotonic_count
"""
metric_name = scraper_config['namespace'] + metric_suffix
for sample in metric.samples:
... | [
"def",
"submit_as_gauge_and_monotonic_count",
"(",
"self",
",",
"metric_suffix",
",",
"metric",
",",
"scraper_config",
")",
":",
"metric_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"metric_suffix",
"for",
"sample",
"in",
"metric",
".",
"samples",
"... | submit a kube_dns metric both as a gauge (for compatibility) and as a monotonic_count | [
"submit",
"a",
"kube_dns",
"metric",
"both",
"as",
"a",
"gauge",
"(",
"for",
"compatibility",
")",
"and",
"as",
"a",
"monotonic_count"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kube_dns/datadog_checks/kube_dns/kube_dns.py#L88-L102 | train | Submit a kube_dns metric both as a gauge and 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection._command | def _command(self, sock_info, command, slave_ok=False,
read_preference=None,
codec_options=None, check=True, allowable_errors=None,
read_concern=DEFAULT_READ_CONCERN,
write_concern=None,
parse_write_concern_error=False,
... | python | def _command(self, sock_info, command, slave_ok=False,
read_preference=None,
codec_options=None, check=True, allowable_errors=None,
read_concern=DEFAULT_READ_CONCERN,
write_concern=None,
parse_write_concern_error=False,
... | [
"def",
"_command",
"(",
"self",
",",
"sock_info",
",",
"command",
",",
"slave_ok",
"=",
"False",
",",
"read_preference",
"=",
"None",
",",
"codec_options",
"=",
"None",
",",
"check",
"=",
"True",
",",
"allowable_errors",
"=",
"None",
",",
"read_concern",
"... | Internal command helper.
:Parameters:
- `sock_info` - A SocketInfo instance.
- `command` - The command itself, as a SON instance.
- `slave_ok`: whether to set the SlaveOkay wire protocol bit.
- `codec_options` (optional) - An instance of
:class:`~bson.codec_o... | [
"Internal",
"command",
"helper",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L188-L232 | train | Internal command helper. | Pu7Z6IJCgH3a,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/collection.py | Collection.with_options | def with_options(
self, codec_options=None, read_preference=None,
write_concern=None, read_concern=None):
"""Get a clone of this collection changing the specified settings.
>>> coll1.read_preference
Primary()
>>> from pymongo import ReadPreference
... | python | def with_options(
self, codec_options=None, read_preference=None,
write_concern=None, read_concern=None):
"""Get a clone of this collection changing the specified settings.
>>> coll1.read_preference
Primary()
>>> from pymongo import ReadPreference
... | [
"def",
"with_options",
"(",
"self",
",",
"codec_options",
"=",
"None",
",",
"read_preference",
"=",
"None",
",",
"write_concern",
"=",
"None",
",",
"read_concern",
"=",
"None",
")",
":",
"return",
"Collection",
"(",
"self",
".",
"__database",
",",
"self",
... | Get a clone of this collection changing the specified settings.
>>> coll1.read_preference
Primary()
>>> from pymongo import ReadPreference
>>> coll2 = coll1.with_options(read_preference=ReadPreference.SECONDARY)
>>> coll1.read_preference
Primary()
>... | [
"Get",
"a",
"clone",
"of",
"this",
"collection",
"changing",
"the",
"specified",
"settings",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L300-L338 | train | Returns a new instance of this collection with the specified settings. | Pu7Z6IJCgH3a,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/collection.py | Collection.initialize_unordered_bulk_op | def initialize_unordered_bulk_op(self, bypass_document_validation=False):
"""**DEPRECATED** - Initialize an unordered batch of write operations.
Operations will be performed on the server in arbitrary order,
possibly in parallel. All operations will be attempted.
:Parameters:
... | python | def initialize_unordered_bulk_op(self, bypass_document_validation=False):
"""**DEPRECATED** - Initialize an unordered batch of write operations.
Operations will be performed on the server in arbitrary order,
possibly in parallel. All operations will be attempted.
:Parameters:
... | [
"def",
"initialize_unordered_bulk_op",
"(",
"self",
",",
"bypass_document_validation",
"=",
"False",
")",
":",
"warnings",
".",
"warn",
"(",
"\"initialize_unordered_bulk_op is deprecated\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"return",
"BulkOpe... | **DEPRECATED** - Initialize an unordered batch of write operations.
Operations will be performed on the server in arbitrary order,
possibly in parallel. All operations will be attempted.
:Parameters:
- `bypass_document_validation`: (optional) If ``True``, allows the
write... | [
"**",
"DEPRECATED",
"**",
"-",
"Initialize",
"an",
"unordered",
"batch",
"of",
"write",
"operations",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L340-L369 | train | Initialize an unordered batch of write operations. | Pu7Z6IJCgH3a,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/collection.py | Collection.initialize_ordered_bulk_op | def initialize_ordered_bulk_op(self, bypass_document_validation=False):
"""**DEPRECATED** - Initialize an ordered batch of write operations.
Operations will be performed on the server serially, in the
order provided. If an error occurs all remaining operations
are aborted.
:Par... | python | def initialize_ordered_bulk_op(self, bypass_document_validation=False):
"""**DEPRECATED** - Initialize an ordered batch of write operations.
Operations will be performed on the server serially, in the
order provided. If an error occurs all remaining operations
are aborted.
:Par... | [
"def",
"initialize_ordered_bulk_op",
"(",
"self",
",",
"bypass_document_validation",
"=",
"False",
")",
":",
"warnings",
".",
"warn",
"(",
"\"initialize_ordered_bulk_op is deprecated\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"return",
"BulkOperati... | **DEPRECATED** - Initialize an ordered batch of write operations.
Operations will be performed on the server serially, in the
order provided. If an error occurs all remaining operations
are aborted.
:Parameters:
- `bypass_document_validation`: (optional) If ``True``, allows t... | [
"**",
"DEPRECATED",
"**",
"-",
"Initialize",
"an",
"ordered",
"batch",
"of",
"write",
"operations",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L371-L401 | train | Initialize an ordered bulk operation. | Pu7Z6IJCgH3a,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/collection.py | Collection.bulk_write | def bulk_write(self, requests, ordered=True,
bypass_document_validation=False):
"""Send a batch of write operations to the server.
Requests are passed as a list of write operation instances (
:class:`~pymongo.operations.InsertOne`,
:class:`~pymongo.operations.UpdateOn... | python | def bulk_write(self, requests, ordered=True,
bypass_document_validation=False):
"""Send a batch of write operations to the server.
Requests are passed as a list of write operation instances (
:class:`~pymongo.operations.InsertOne`,
:class:`~pymongo.operations.UpdateOn... | [
"def",
"bulk_write",
"(",
"self",
",",
"requests",
",",
"ordered",
"=",
"True",
",",
"bypass_document_validation",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"requests",
",",
"list",
")",
":",
"raise",
"TypeError",
"(",
"\"requests must be a list\... | Send a batch of write operations to the server.
Requests are passed as a list of write operation instances (
:class:`~pymongo.operations.InsertOne`,
:class:`~pymongo.operations.UpdateOne`,
:class:`~pymongo.operations.UpdateMany`,
:class:`~pymongo.operations.ReplaceOne`,
... | [
"Send",
"a",
"batch",
"of",
"write",
"operations",
"to",
"the",
"server",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L403-L478 | train | Send a batch of write operations to the server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection._insert | def _insert(self, sock_info, docs, ordered=True, check_keys=True,
manipulate=False, write_concern=None, op_id=None,
bypass_doc_val=False):
"""Internal insert helper."""
if isinstance(docs, collections.Mapping):
return self._insert_one(
sock_inf... | python | def _insert(self, sock_info, docs, ordered=True, check_keys=True,
manipulate=False, write_concern=None, op_id=None,
bypass_doc_val=False):
"""Internal insert helper."""
if isinstance(docs, collections.Mapping):
return self._insert_one(
sock_inf... | [
"def",
"_insert",
"(",
"self",
",",
"sock_info",
",",
"docs",
",",
"ordered",
"=",
"True",
",",
"check_keys",
"=",
"True",
",",
"manipulate",
"=",
"False",
",",
"write_concern",
"=",
"None",
",",
"op_id",
"=",
"None",
",",
"bypass_doc_val",
"=",
"False",... | Internal insert helper. | [
"Internal",
"insert",
"helper",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L568-L630 | train | Internal insert helper. | Pu7Z6IJCgH3a,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/collection.py | Collection.insert_one | def insert_one(self, document, bypass_document_validation=False):
"""Insert a single document.
>>> db.test.count({'x': 1})
0
>>> result = db.test.insert_one({'x': 1})
>>> result.inserted_id
ObjectId('54f112defba522406c9cc208')
>>> db.test.find_one({'x... | python | def insert_one(self, document, bypass_document_validation=False):
"""Insert a single document.
>>> db.test.count({'x': 1})
0
>>> result = db.test.insert_one({'x': 1})
>>> result.inserted_id
ObjectId('54f112defba522406c9cc208')
>>> db.test.find_one({'x... | [
"def",
"insert_one",
"(",
"self",
",",
"document",
",",
"bypass_document_validation",
"=",
"False",
")",
":",
"common",
".",
"validate_is_document_type",
"(",
"\"document\"",
",",
"document",
")",
"if",
"not",
"(",
"isinstance",
"(",
"document",
",",
"RawBSONDoc... | Insert a single document.
>>> db.test.count({'x': 1})
0
>>> result = db.test.insert_one({'x': 1})
>>> result.inserted_id
ObjectId('54f112defba522406c9cc208')
>>> db.test.find_one({'x': 1})
{u'x': 1, u'_id': ObjectId('54f112defba522406c9cc208')}
... | [
"Insert",
"a",
"single",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L632-L671 | train | Insert a single document into the 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/collection.py | Collection.insert_many | def insert_many(self, documents, ordered=True,
bypass_document_validation=False):
"""Insert an iterable of documents.
>>> db.test.count()
0
>>> result = db.test.insert_many([{'x': i} for i in range(2)])
>>> result.inserted_ids
[ObjectId('54f... | python | def insert_many(self, documents, ordered=True,
bypass_document_validation=False):
"""Insert an iterable of documents.
>>> db.test.count()
0
>>> result = db.test.insert_many([{'x': i} for i in range(2)])
>>> result.inserted_ids
[ObjectId('54f... | [
"def",
"insert_many",
"(",
"self",
",",
"documents",
",",
"ordered",
"=",
"True",
",",
"bypass_document_validation",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"documents",
",",
"collections",
".",
"Iterable",
")",
"or",
"not",
"documents",
":",... | Insert an iterable of documents.
>>> db.test.count()
0
>>> result = db.test.insert_many([{'x': i} for i in range(2)])
>>> result.inserted_ids
[ObjectId('54f113fffba522406c9cc20e'), ObjectId('54f113fffba522406c9cc20f')]
>>> db.test.count()
2
... | [
"Insert",
"an",
"iterable",
"of",
"documents",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L673-L725 | train | Insert a list of documents into the 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/collection.py | Collection.replace_one | def replace_one(self, filter, replacement, upsert=False,
bypass_document_validation=False, collation=None):
"""Replace a single document matching the filter.
>>> for doc in db.test.find({}):
... print(doc)
...
{u'x': 1, u'_id': ObjectId('54f4c5bef... | python | def replace_one(self, filter, replacement, upsert=False,
bypass_document_validation=False, collation=None):
"""Replace a single document matching the filter.
>>> for doc in db.test.find({}):
... print(doc)
...
{u'x': 1, u'_id': ObjectId('54f4c5bef... | [
"def",
"replace_one",
"(",
"self",
",",
"filter",
",",
"replacement",
",",
"upsert",
"=",
"False",
",",
"bypass_document_validation",
"=",
"False",
",",
"collation",
"=",
"None",
")",
":",
"common",
".",
"validate_is_mapping",
"(",
"\"filter\"",
",",
"filter",... | Replace a single document matching the filter.
>>> for doc in db.test.find({}):
... print(doc)
...
{u'x': 1, u'_id': ObjectId('54f4c5befba5220aa4d6dee7')}
>>> result = db.test.replace_one({'x': 1}, {'y': 1})
>>> result.matched_count
1
... | [
"Replace",
"a",
"single",
"document",
"matching",
"the",
"filter",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L787-L850 | train | Replace a single document matching the filter. | Pu7Z6IJCgH3a,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/collection.py | Collection.update_one | def update_one(self, filter, update, upsert=False,
bypass_document_validation=False,
collation=None):
"""Update a single document matching the filter.
>>> for doc in db.test.find():
... print(doc)
...
{u'x': 1, u'_id': 0}
... | python | def update_one(self, filter, update, upsert=False,
bypass_document_validation=False,
collation=None):
"""Update a single document matching the filter.
>>> for doc in db.test.find():
... print(doc)
...
{u'x': 1, u'_id': 0}
... | [
"def",
"update_one",
"(",
"self",
",",
"filter",
",",
"update",
",",
"upsert",
"=",
"False",
",",
"bypass_document_validation",
"=",
"False",
",",
"collation",
"=",
"None",
")",
":",
"common",
".",
"validate_is_mapping",
"(",
"\"filter\"",
",",
"filter",
")"... | Update a single document matching the filter.
>>> for doc in db.test.find():
... print(doc)
...
{u'x': 1, u'_id': 0}
{u'x': 1, u'_id': 1}
{u'x': 1, u'_id': 2}
>>> result = db.test.update_one({'x': 1}, {'$inc': {'x': 3}})
>>> result.mat... | [
"Update",
"a",
"single",
"document",
"matching",
"the",
"filter",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L852-L908 | train | Update a single document matching the filter. | Pu7Z6IJCgH3a,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/collection.py | Collection.delete_one | def delete_one(self, filter, collation=None):
"""Delete a single document matching the filter.
>>> db.test.count({'x': 1})
3
>>> result = db.test.delete_one({'x': 1})
>>> result.deleted_count
1
>>> db.test.count({'x': 1})
2
:Paramet... | python | def delete_one(self, filter, collation=None):
"""Delete a single document matching the filter.
>>> db.test.count({'x': 1})
3
>>> result = db.test.delete_one({'x': 1})
>>> result.deleted_count
1
>>> db.test.count({'x': 1})
2
:Paramet... | [
"def",
"delete_one",
"(",
"self",
",",
"filter",
",",
"collation",
"=",
"None",
")",
":",
"with",
"self",
".",
"_socket_for_writes",
"(",
")",
"as",
"sock_info",
":",
"return",
"DeleteResult",
"(",
"self",
".",
"_delete",
"(",
"sock_info",
",",
"filter",
... | Delete a single document matching the filter.
>>> db.test.count({'x': 1})
3
>>> result = db.test.delete_one({'x': 1})
>>> result.deleted_count
1
>>> db.test.count({'x': 1})
2
:Parameters:
- `filter`: A query that matches the docum... | [
"Delete",
"a",
"single",
"document",
"matching",
"the",
"filter",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1019-L1047 | train | Delete a single document matching the filter. | Pu7Z6IJCgH3a,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/collection.py | Collection.delete_many | def delete_many(self, filter, collation=None):
"""Delete one or more documents matching the filter.
>>> db.test.count({'x': 1})
3
>>> result = db.test.delete_many({'x': 1})
>>> result.deleted_count
3
>>> db.test.count({'x': 1})
0
:P... | python | def delete_many(self, filter, collation=None):
"""Delete one or more documents matching the filter.
>>> db.test.count({'x': 1})
3
>>> result = db.test.delete_many({'x': 1})
>>> result.deleted_count
3
>>> db.test.count({'x': 1})
0
:P... | [
"def",
"delete_many",
"(",
"self",
",",
"filter",
",",
"collation",
"=",
"None",
")",
":",
"with",
"self",
".",
"_socket_for_writes",
"(",
")",
"as",
"sock_info",
":",
"return",
"DeleteResult",
"(",
"self",
".",
"_delete",
"(",
"sock_info",
",",
"filter",
... | Delete one or more documents matching the filter.
>>> db.test.count({'x': 1})
3
>>> result = db.test.delete_many({'x': 1})
>>> result.deleted_count
3
>>> db.test.count({'x': 1})
0
:Parameters:
- `filter`: A query that matches the ... | [
"Delete",
"one",
"or",
"more",
"documents",
"matching",
"the",
"filter",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1049-L1077 | train | Delete one or more documents matching the filter. | Pu7Z6IJCgH3a,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/collection.py | Collection.find_one | def find_one(self, filter=None, *args, **kwargs):
"""Get a single document from the database.
All arguments to :meth:`find` are also valid arguments for
:meth:`find_one`, although any `limit` argument will be
ignored. Returns a single document, or ``None`` if no matching
documen... | python | def find_one(self, filter=None, *args, **kwargs):
"""Get a single document from the database.
All arguments to :meth:`find` are also valid arguments for
:meth:`find_one`, although any `limit` argument will be
ignored. Returns a single document, or ``None`` if no matching
documen... | [
"def",
"find_one",
"(",
"self",
",",
"filter",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"(",
"filter",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"filter",
",",
"collections",
".",
"Mapping",
")",
")",
":",... | Get a single document from the database.
All arguments to :meth:`find` are also valid arguments for
:meth:`find_one`, although any `limit` argument will be
ignored. Returns a single document, or ``None`` if no matching
document is found.
The :meth:`find_one` method obeys the :a... | [
"Get",
"a",
"single",
"document",
"from",
"the",
"database",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1079-L1111 | train | Return a single document from the 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/collection.py | Collection.parallel_scan | def parallel_scan(self, num_cursors, **kwargs):
"""Scan this entire collection in parallel.
Returns a list of up to ``num_cursors`` cursors that can be iterated
concurrently. As long as the collection is not modified during
scanning, each document appears once in one of the cursors resu... | python | def parallel_scan(self, num_cursors, **kwargs):
"""Scan this entire collection in parallel.
Returns a list of up to ``num_cursors`` cursors that can be iterated
concurrently. As long as the collection is not modified during
scanning, each document appears once in one of the cursors resu... | [
"def",
"parallel_scan",
"(",
"self",
",",
"num_cursors",
",",
"*",
"*",
"kwargs",
")",
":",
"cmd",
"=",
"SON",
"(",
"[",
"(",
"'parallelCollectionScan'",
",",
"self",
".",
"__name",
")",
",",
"(",
"'numCursors'",
",",
"num_cursors",
")",
"]",
")",
"cmd... | Scan this entire collection in parallel.
Returns a list of up to ``num_cursors`` cursors that can be iterated
concurrently. As long as the collection is not modified during
scanning, each document appears once in one of the cursors result
sets.
For example, to process each docu... | [
"Scan",
"this",
"entire",
"collection",
"in",
"parallel",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1281-L1340 | train | This method scans this entire collection in parallel. | Pu7Z6IJCgH3a,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/collection.py | Collection._count | def _count(self, cmd, collation=None):
"""Internal count helper."""
with self._socket_for_reads() as (sock_info, slave_ok):
res = self._command(
sock_info, cmd, slave_ok,
allowable_errors=["ns missing"],
codec_options=self.__write_response_code... | python | def _count(self, cmd, collation=None):
"""Internal count helper."""
with self._socket_for_reads() as (sock_info, slave_ok):
res = self._command(
sock_info, cmd, slave_ok,
allowable_errors=["ns missing"],
codec_options=self.__write_response_code... | [
"def",
"_count",
"(",
"self",
",",
"cmd",
",",
"collation",
"=",
"None",
")",
":",
"with",
"self",
".",
"_socket_for_reads",
"(",
")",
"as",
"(",
"sock_info",
",",
"slave_ok",
")",
":",
"res",
"=",
"self",
".",
"_command",
"(",
"sock_info",
",",
"cmd... | Internal count helper. | [
"Internal",
"count",
"helper",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1342-L1353 | train | Internal count helper. | Pu7Z6IJCgH3a,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/collection.py | Collection.count | def count(self, filter=None, **kwargs):
"""Get the number of documents in this collection.
All optional count parameters should be passed as keyword arguments
to this method. Valid options include:
- `hint` (string or list of tuples): The index to use. Specify either
the ... | python | def count(self, filter=None, **kwargs):
"""Get the number of documents in this collection.
All optional count parameters should be passed as keyword arguments
to this method. Valid options include:
- `hint` (string or list of tuples): The index to use. Specify either
the ... | [
"def",
"count",
"(",
"self",
",",
"filter",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cmd",
"=",
"SON",
"(",
"[",
"(",
"\"count\"",
",",
"self",
".",
"__name",
")",
"]",
")",
"if",
"filter",
"is",
"not",
"None",
":",
"if",
"\"query\"",
"... | Get the number of documents in this collection.
All optional count parameters should be passed as keyword arguments
to this method. Valid options include:
- `hint` (string or list of tuples): The index to use. Specify either
the index name as a string or the index specification a... | [
"Get",
"the",
"number",
"of",
"documents",
"in",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1355-L1394 | train | Returns the number of documents in this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.create_indexes | def create_indexes(self, indexes):
"""Create one or more indexes on this collection.
>>> from pymongo import IndexModel, ASCENDING, DESCENDING
>>> index1 = IndexModel([("hello", DESCENDING),
... ("world", ASCENDING)], name="hello_world")
>>> index2 =... | python | def create_indexes(self, indexes):
"""Create one or more indexes on this collection.
>>> from pymongo import IndexModel, ASCENDING, DESCENDING
>>> index1 = IndexModel([("hello", DESCENDING),
... ("world", ASCENDING)], name="hello_world")
>>> index2 =... | [
"def",
"create_indexes",
"(",
"self",
",",
"indexes",
")",
":",
"if",
"not",
"isinstance",
"(",
"indexes",
",",
"list",
")",
":",
"raise",
"TypeError",
"(",
"\"indexes must be a list\"",
")",
"names",
"=",
"[",
"]",
"def",
"gen_indexes",
"(",
")",
":",
"... | Create one or more indexes on this collection.
>>> from pymongo import IndexModel, ASCENDING, DESCENDING
>>> index1 = IndexModel([("hello", DESCENDING),
... ("world", ASCENDING)], name="hello_world")
>>> index2 = IndexModel([("goodbye", DESCENDING)])
... | [
"Create",
"one",
"or",
"more",
"indexes",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1396-L1444 | train | Create one or more indexes on this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.__create_index | def __create_index(self, keys, index_options):
"""Internal create index helper.
:Parameters:
- `keys`: a list of tuples [(key, type), (key, type), ...]
- `index_options`: a dict of index options.
"""
index_doc = helpers._index_document(keys)
index = {"key": i... | python | def __create_index(self, keys, index_options):
"""Internal create index helper.
:Parameters:
- `keys`: a list of tuples [(key, type), (key, type), ...]
- `index_options`: a dict of index options.
"""
index_doc = helpers._index_document(keys)
index = {"key": i... | [
"def",
"__create_index",
"(",
"self",
",",
"keys",
",",
"index_options",
")",
":",
"index_doc",
"=",
"helpers",
".",
"_index_document",
"(",
"keys",
")",
"index",
"=",
"{",
"\"key\"",
":",
"index_doc",
"}",
"collation",
"=",
"validate_collation_or_none",
"(",
... | Internal create index helper.
:Parameters:
- `keys`: a list of tuples [(key, type), (key, type), ...]
- `index_options`: a dict of index options. | [
"Internal",
"create",
"index",
"helper",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1446-L1481 | train | Internal method to create an index. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.create_index | def create_index(self, keys, **kwargs):
"""Creates an index on this collection.
Takes either a single key or a list of (key, direction) pairs.
The key(s) must be an instance of :class:`basestring`
(:class:`str` in python 3), and the direction(s) must be one of
(:data:`~pymongo.A... | python | def create_index(self, keys, **kwargs):
"""Creates an index on this collection.
Takes either a single key or a list of (key, direction) pairs.
The key(s) must be an instance of :class:`basestring`
(:class:`str` in python 3), and the direction(s) must be one of
(:data:`~pymongo.A... | [
"def",
"create_index",
"(",
"self",
",",
"keys",
",",
"*",
"*",
"kwargs",
")",
":",
"keys",
"=",
"helpers",
".",
"_index_list",
"(",
"keys",
")",
"name",
"=",
"kwargs",
".",
"setdefault",
"(",
"\"name\"",
",",
"helpers",
".",
"_gen_index_name",
"(",
"k... | Creates an index on this collection.
Takes either a single key or a list of (key, direction) pairs.
The key(s) must be an instance of :class:`basestring`
(:class:`str` in python 3), and the direction(s) must be one of
(:data:`~pymongo.ASCENDING`, :data:`~pymongo.DESCENDING`,
:da... | [
"Creates",
"an",
"index",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1483-L1572 | train | Creates an index on the collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.ensure_index | def ensure_index(self, key_or_list, cache_for=300, **kwargs):
"""**DEPRECATED** - Ensures that an index exists on this collection.
.. versionchanged:: 3.0
**DEPRECATED**
"""
warnings.warn("ensure_index is deprecated. Use create_index instead.",
Deprecat... | python | def ensure_index(self, key_or_list, cache_for=300, **kwargs):
"""**DEPRECATED** - Ensures that an index exists on this collection.
.. versionchanged:: 3.0
**DEPRECATED**
"""
warnings.warn("ensure_index is deprecated. Use create_index instead.",
Deprecat... | [
"def",
"ensure_index",
"(",
"self",
",",
"key_or_list",
",",
"cache_for",
"=",
"300",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"\"ensure_index is deprecated. Use create_index instead.\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"... | **DEPRECATED** - Ensures that an index exists on this collection.
.. versionchanged:: 3.0
**DEPRECATED** | [
"**",
"DEPRECATED",
"**",
"-",
"Ensures",
"that",
"an",
"index",
"exists",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1574-L1608 | train | Ensures that an index exists on this 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/pymongo/collection.py | Collection.drop_indexes | def drop_indexes(self):
"""Drops all indexes on this collection.
Can be used on non-existant collections or collections with no indexes.
Raises OperationFailure on an error.
.. note:: The :attr:`~pymongo.collection.Collection.write_concern` of
this collection is automaticall... | python | def drop_indexes(self):
"""Drops all indexes on this collection.
Can be used on non-existant collections or collections with no indexes.
Raises OperationFailure on an error.
.. note:: The :attr:`~pymongo.collection.Collection.write_concern` of
this collection is automaticall... | [
"def",
"drop_indexes",
"(",
"self",
")",
":",
"self",
".",
"__database",
".",
"client",
".",
"_purge_index",
"(",
"self",
".",
"__database",
".",
"name",
",",
"self",
".",
"__name",
")",
"self",
".",
"drop_index",
"(",
"\"*\"",
")"
] | Drops all indexes on this collection.
Can be used on non-existant collections or collections with no indexes.
Raises OperationFailure on an error.
.. note:: The :attr:`~pymongo.collection.Collection.write_concern` of
this collection is automatically applied to this operation when us... | [
"Drops",
"all",
"indexes",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1610-L1626 | train | Drops all indexes on this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.drop_index | def drop_index(self, index_or_name):
"""Drops the specified index on this collection.
Can be used on non-existant collections or collections with no
indexes. Raises OperationFailure on an error (e.g. trying to
drop an index that does not exist). `index_or_name`
can be either an... | python | def drop_index(self, index_or_name):
"""Drops the specified index on this collection.
Can be used on non-existant collections or collections with no
indexes. Raises OperationFailure on an error (e.g. trying to
drop an index that does not exist). `index_or_name`
can be either an... | [
"def",
"drop_index",
"(",
"self",
",",
"index_or_name",
")",
":",
"name",
"=",
"index_or_name",
"if",
"isinstance",
"(",
"index_or_name",
",",
"list",
")",
":",
"name",
"=",
"helpers",
".",
"_gen_index_name",
"(",
"index_or_name",
")",
"if",
"not",
"isinstan... | Drops the specified index on this collection.
Can be used on non-existant collections or collections with no
indexes. Raises OperationFailure on an error (e.g. trying to
drop an index that does not exist). `index_or_name`
can be either an index name (as returned by `create_index`),
... | [
"Drops",
"the",
"specified",
"index",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1628-L1673 | train | Drops the specified index on this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.reindex | def reindex(self):
"""Rebuilds all indexes on this collection.
.. warning:: reindex blocks all other operations (indexes
are built in the foreground) and will be slow for large
collections.
.. versionchanged:: 3.4
Apply this collection's write concern automatic... | python | def reindex(self):
"""Rebuilds all indexes on this collection.
.. warning:: reindex blocks all other operations (indexes
are built in the foreground) and will be slow for large
collections.
.. versionchanged:: 3.4
Apply this collection's write concern automatic... | [
"def",
"reindex",
"(",
"self",
")",
":",
"cmd",
"=",
"SON",
"(",
"[",
"(",
"\"reIndex\"",
",",
"self",
".",
"__name",
")",
"]",
")",
"with",
"self",
".",
"_socket_for_writes",
"(",
")",
"as",
"sock_info",
":",
"return",
"self",
".",
"_command",
"(",
... | Rebuilds all indexes on this collection.
.. warning:: reindex blocks all other operations (indexes
are built in the foreground) and will be slow for large
collections.
.. versionchanged:: 3.4
Apply this collection's write concern automatically to this operation
... | [
"Rebuilds",
"all",
"indexes",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1675-L1695 | train | Rebuilds all indexes on this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.list_indexes | def list_indexes(self):
"""Get a cursor over the index documents for this collection.
>>> for index in db.test.list_indexes():
... print(index)
...
SON([(u'v', 1), (u'key', SON([(u'_id', 1)])),
(u'name', u'_id_'), (u'ns', u'test.test')])
:Retu... | python | def list_indexes(self):
"""Get a cursor over the index documents for this collection.
>>> for index in db.test.list_indexes():
... print(index)
...
SON([(u'v', 1), (u'key', SON([(u'_id', 1)])),
(u'name', u'_id_'), (u'ns', u'test.test')])
:Retu... | [
"def",
"list_indexes",
"(",
"self",
")",
":",
"codec_options",
"=",
"CodecOptions",
"(",
"SON",
")",
"coll",
"=",
"self",
".",
"with_options",
"(",
"codec_options",
")",
"with",
"self",
".",
"_socket_for_primary_reads",
"(",
")",
"as",
"(",
"sock_info",
",",... | Get a cursor over the index documents for this collection.
>>> for index in db.test.list_indexes():
... print(index)
...
SON([(u'v', 1), (u'key', SON([(u'_id', 1)])),
(u'name', u'_id_'), (u'ns', u'test.test')])
:Returns:
An instance of :clas... | [
"Get",
"a",
"cursor",
"over",
"the",
"index",
"documents",
"for",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1697-L1744 | train | Get a cursor over the index documents for this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.options | def options(self):
"""Get the options set on this collection.
Returns a dictionary of options and their values - see
:meth:`~pymongo.database.Database.create_collection` for more
information on the possible options. Returns an empty
dictionary if the collection has not been crea... | python | def options(self):
"""Get the options set on this collection.
Returns a dictionary of options and their values - see
:meth:`~pymongo.database.Database.create_collection` for more
information on the possible options. Returns an empty
dictionary if the collection has not been crea... | [
"def",
"options",
"(",
"self",
")",
":",
"with",
"self",
".",
"_socket_for_primary_reads",
"(",
")",
"as",
"(",
"sock_info",
",",
"slave_ok",
")",
":",
"if",
"sock_info",
".",
"max_wire_version",
">",
"2",
":",
"criteria",
"=",
"{",
"\"name\"",
":",
"sel... | Get the options set on this collection.
Returns a dictionary of options and their values - see
:meth:`~pymongo.database.Database.create_collection` for more
information on the possible options. Returns an empty
dictionary if the collection has not been created yet. | [
"Get",
"the",
"options",
"set",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1773-L1802 | train | Get the options set on this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.aggregate | def aggregate(self, pipeline, **kwargs):
"""Perform an aggregation using the aggregation framework on this
collection.
All optional aggregate parameters should be passed as keyword arguments
to this method. Valid options include, but are not limited to:
- `allowDiskUse` (bool... | python | def aggregate(self, pipeline, **kwargs):
"""Perform an aggregation using the aggregation framework on this
collection.
All optional aggregate parameters should be passed as keyword arguments
to this method. Valid options include, but are not limited to:
- `allowDiskUse` (bool... | [
"def",
"aggregate",
"(",
"self",
",",
"pipeline",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"pipeline",
",",
"list",
")",
":",
"raise",
"TypeError",
"(",
"\"pipeline must be a list\"",
")",
"if",
"\"explain\"",
"in",
"kwargs",
":",... | Perform an aggregation using the aggregation framework on this
collection.
All optional aggregate parameters should be passed as keyword arguments
to this method. Valid options include, but are not limited to:
- `allowDiskUse` (bool): Enables writing to temporary files. When set
... | [
"Perform",
"an",
"aggregation",
"using",
"the",
"aggregation",
"framework",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1804-L1934 | train | Perform an aggregate operation on the specified collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.rename | def rename(self, new_name, **kwargs):
"""Rename this collection.
If operating in auth mode, client must be authorized as an
admin to perform this operation. Raises :class:`TypeError` if
`new_name` is not an instance of :class:`basestring`
(:class:`str` in python 3). Raises :clas... | python | def rename(self, new_name, **kwargs):
"""Rename this collection.
If operating in auth mode, client must be authorized as an
admin to perform this operation. Raises :class:`TypeError` if
`new_name` is not an instance of :class:`basestring`
(:class:`str` in python 3). Raises :clas... | [
"def",
"rename",
"(",
"self",
",",
"new_name",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"new_name",
",",
"string_type",
")",
":",
"raise",
"TypeError",
"(",
"\"new_name must be an \"",
"\"instance of %s\"",
"%",
"(",
"string_type",
... | Rename this collection.
If operating in auth mode, client must be authorized as an
admin to perform this operation. Raises :class:`TypeError` if
`new_name` is not an instance of :class:`basestring`
(:class:`str` in python 3). Raises :class:`~pymongo.errors.InvalidName`
if `new_n... | [
"Rename",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L1975-L2016 | train | Rename this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.distinct | def distinct(self, key, filter=None, **kwargs):
"""Get a list of distinct values for `key` among all documents
in this collection.
Raises :class:`TypeError` if `key` is not an instance of
:class:`basestring` (:class:`str` in python 3).
All optional distinct parameters should be... | python | def distinct(self, key, filter=None, **kwargs):
"""Get a list of distinct values for `key` among all documents
in this collection.
Raises :class:`TypeError` if `key` is not an instance of
:class:`basestring` (:class:`str` in python 3).
All optional distinct parameters should be... | [
"def",
"distinct",
"(",
"self",
",",
"key",
",",
"filter",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"key",
",",
"string_type",
")",
":",
"raise",
"TypeError",
"(",
"\"key must be an \"",
"\"instance of %s\"",
"%",
"... | Get a list of distinct values for `key` among all documents
in this collection.
Raises :class:`TypeError` if `key` is not an instance of
:class:`basestring` (:class:`str` in python 3).
All optional distinct parameters should be passed as keyword arguments
to this method. Valid ... | [
"Get",
"a",
"list",
"of",
"distinct",
"values",
"for",
"key",
"among",
"all",
"documents",
"in",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2018-L2062 | train | Get a list of distinct values for key among all documents in this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.map_reduce | def map_reduce(self, map, reduce, out, full_response=False, **kwargs):
"""Perform a map/reduce operation on this collection.
If `full_response` is ``False`` (default) returns a
:class:`~pymongo.collection.Collection` instance containing
the results of the operation. Otherwise, returns t... | python | def map_reduce(self, map, reduce, out, full_response=False, **kwargs):
"""Perform a map/reduce operation on this collection.
If `full_response` is ``False`` (default) returns a
:class:`~pymongo.collection.Collection` instance containing
the results of the operation. Otherwise, returns t... | [
"def",
"map_reduce",
"(",
"self",
",",
"map",
",",
"reduce",
",",
"out",
",",
"full_response",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"out",
",",
"(",
"string_type",
",",
"collections",
".",
"Mapping",
")",
"... | Perform a map/reduce operation on this collection.
If `full_response` is ``False`` (default) returns a
:class:`~pymongo.collection.Collection` instance containing
the results of the operation. Otherwise, returns the full
response from the server to the `map reduce command`_.
:P... | [
"Perform",
"a",
"map",
"/",
"reduce",
"operation",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2064-L2151 | train | Perform a mapReduce operation on this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.inline_map_reduce | def inline_map_reduce(self, map, reduce, full_response=False, **kwargs):
"""Perform an inline map/reduce operation on this collection.
Perform the map/reduce operation on the server in RAM. A result
collection is not created. The result set is returned as a list
of documents.
I... | python | def inline_map_reduce(self, map, reduce, full_response=False, **kwargs):
"""Perform an inline map/reduce operation on this collection.
Perform the map/reduce operation on the server in RAM. A result
collection is not created. The result set is returned as a list
of documents.
I... | [
"def",
"inline_map_reduce",
"(",
"self",
",",
"map",
",",
"reduce",
",",
"full_response",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"cmd",
"=",
"SON",
"(",
"[",
"(",
"\"mapreduce\"",
",",
"self",
".",
"__name",
")",
",",
"(",
"\"map\"",
",",
... | Perform an inline map/reduce operation on this collection.
Perform the map/reduce operation on the server in RAM. A result
collection is not created. The result set is returned as a list
of documents.
If `full_response` is ``False`` (default) returns the
result documents in a l... | [
"Perform",
"an",
"inline",
"map",
"/",
"reduce",
"operation",
"on",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2153-L2200 | train | Perform an inline map reduce operation on this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.__find_and_modify | def __find_and_modify(self, filter, projection, sort, upsert=None,
return_document=ReturnDocument.BEFORE, **kwargs):
"""Internal findAndModify helper."""
common.validate_is_mapping("filter", filter)
if not isinstance(return_document, bool):
raise ValueError(... | python | def __find_and_modify(self, filter, projection, sort, upsert=None,
return_document=ReturnDocument.BEFORE, **kwargs):
"""Internal findAndModify helper."""
common.validate_is_mapping("filter", filter)
if not isinstance(return_document, bool):
raise ValueError(... | [
"def",
"__find_and_modify",
"(",
"self",
",",
"filter",
",",
"projection",
",",
"sort",
",",
"upsert",
"=",
"None",
",",
"return_document",
"=",
"ReturnDocument",
".",
"BEFORE",
",",
"*",
"*",
"kwargs",
")",
":",
"common",
".",
"validate_is_mapping",
"(",
... | Internal findAndModify helper. | [
"Internal",
"findAndModify",
"helper",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2202-L2232 | train | Internal findAndModify helper. | Pu7Z6IJCgH3a,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/collection.py | Collection.find_one_and_replace | def find_one_and_replace(self, filter, replacement,
projection=None, sort=None, upsert=False,
return_document=ReturnDocument.BEFORE, **kwargs):
"""Finds a single document and replaces it, returning either the
original or the replaced document.
... | python | def find_one_and_replace(self, filter, replacement,
projection=None, sort=None, upsert=False,
return_document=ReturnDocument.BEFORE, **kwargs):
"""Finds a single document and replaces it, returning either the
original or the replaced document.
... | [
"def",
"find_one_and_replace",
"(",
"self",
",",
"filter",
",",
"replacement",
",",
"projection",
"=",
"None",
",",
"sort",
"=",
"None",
",",
"upsert",
"=",
"False",
",",
"return_document",
"=",
"ReturnDocument",
".",
"BEFORE",
",",
"*",
"*",
"kwargs",
")"... | Finds a single document and replaces it, returning either the
original or the replaced document.
The :meth:`find_one_and_replace` method differs from
:meth:`find_one_and_update` by replacing the document matched by
*filter*, rather than modifying the existing document.
>>> fo... | [
"Finds",
"a",
"single",
"document",
"and",
"replaces",
"it",
"returning",
"either",
"the",
"original",
"or",
"the",
"replaced",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2293-L2357 | train | Find a single document and replaces it with replacement. | Pu7Z6IJCgH3a,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/collection.py | Collection.find_one_and_update | def find_one_and_update(self, filter, update,
projection=None, sort=None, upsert=False,
return_document=ReturnDocument.BEFORE, **kwargs):
"""Finds a single document and updates it, returning either the
original or the updated document.
>... | python | def find_one_and_update(self, filter, update,
projection=None, sort=None, upsert=False,
return_document=ReturnDocument.BEFORE, **kwargs):
"""Finds a single document and updates it, returning either the
original or the updated document.
>... | [
"def",
"find_one_and_update",
"(",
"self",
",",
"filter",
",",
"update",
",",
"projection",
"=",
"None",
",",
"sort",
"=",
"None",
",",
"upsert",
"=",
"False",
",",
"return_document",
"=",
"ReturnDocument",
".",
"BEFORE",
",",
"*",
"*",
"kwargs",
")",
":... | Finds a single document and updates it, returning either the
original or the updated document.
>>> db.test.find_one_and_update(
... {'_id': 665}, {'$inc': {'count': 1}, '$set': {'done': True}})
{u'_id': 665, u'done': False, u'count': 25}}
By default :meth:`find_one_and... | [
"Finds",
"a",
"single",
"document",
"and",
"updates",
"it",
"returning",
"either",
"the",
"original",
"or",
"the",
"updated",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2359-L2454 | train | Find a single document and update it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.save | def save(self, to_save, manipulate=True, check_keys=True, **kwargs):
"""Save a document in this collection.
**DEPRECATED** - Use :meth:`insert_one` or :meth:`replace_one` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
... | python | def save(self, to_save, manipulate=True, check_keys=True, **kwargs):
"""Save a document in this collection.
**DEPRECATED** - Use :meth:`insert_one` or :meth:`replace_one` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
... | [
"def",
"save",
"(",
"self",
",",
"to_save",
",",
"manipulate",
"=",
"True",
",",
"check_keys",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"\"save is deprecated. Use insert_one or replace_one \"",
"\"instead\"",
",",
"Deprecatio... | Save a document in this collection.
**DEPRECATED** - Use :meth:`insert_one` or :meth:`replace_one` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
operations. | [
"Save",
"a",
"document",
"in",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2456-L2482 | train | Save a document in this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.insert | def insert(self, doc_or_docs, manipulate=True,
check_keys=True, continue_on_error=False, **kwargs):
"""Insert a document(s) into this collection.
**DEPRECATED** - Use :meth:`insert_one` or :meth:`insert_many` instead.
.. versionchanged:: 3.0
Removed the `safe` paramet... | python | def insert(self, doc_or_docs, manipulate=True,
check_keys=True, continue_on_error=False, **kwargs):
"""Insert a document(s) into this collection.
**DEPRECATED** - Use :meth:`insert_one` or :meth:`insert_many` instead.
.. versionchanged:: 3.0
Removed the `safe` paramet... | [
"def",
"insert",
"(",
"self",
",",
"doc_or_docs",
",",
"manipulate",
"=",
"True",
",",
"check_keys",
"=",
"True",
",",
"continue_on_error",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"\"insert is deprecated. Use insert_one o... | Insert a document(s) into this collection.
**DEPRECATED** - Use :meth:`insert_one` or :meth:`insert_many` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
operations. | [
"Insert",
"a",
"document",
"(",
"s",
")",
"into",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2484-L2501 | train | Insert a set of documents into this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.update | def update(self, spec, document, upsert=False, manipulate=False,
multi=False, check_keys=True, **kwargs):
"""Update a document(s) in this collection.
**DEPRECATED** - Use :meth:`replace_one`, :meth:`update_one`, or
:meth:`update_many` instead.
.. versionchanged:: 3.0
... | python | def update(self, spec, document, upsert=False, manipulate=False,
multi=False, check_keys=True, **kwargs):
"""Update a document(s) in this collection.
**DEPRECATED** - Use :meth:`replace_one`, :meth:`update_one`, or
:meth:`update_many` instead.
.. versionchanged:: 3.0
... | [
"def",
"update",
"(",
"self",
",",
"spec",
",",
"document",
",",
"upsert",
"=",
"False",
",",
"manipulate",
"=",
"False",
",",
"multi",
"=",
"False",
",",
"check_keys",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"... | Update a document(s) in this collection.
**DEPRECATED** - Use :meth:`replace_one`, :meth:`update_one`, or
:meth:`update_many` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
operations. | [
"Update",
"a",
"document",
"(",
"s",
")",
"in",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2503-L2535 | train | Update a document in this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.remove | def remove(self, spec_or_id=None, multi=True, **kwargs):
"""Remove a document(s) from this collection.
**DEPRECATED** - Use :meth:`delete_one` or :meth:`delete_many` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
opera... | python | def remove(self, spec_or_id=None, multi=True, **kwargs):
"""Remove a document(s) from this collection.
**DEPRECATED** - Use :meth:`delete_one` or :meth:`delete_many` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
opera... | [
"def",
"remove",
"(",
"self",
",",
"spec_or_id",
"=",
"None",
",",
"multi",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"\"remove is deprecated. Use delete_one or delete_many \"",
"\"instead.\"",
",",
"DeprecationWarning",
",",
... | Remove a document(s) from this collection.
**DEPRECATED** - Use :meth:`delete_one` or :meth:`delete_many` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
operations. | [
"Remove",
"a",
"document",
"(",
"s",
")",
"from",
"this",
"collection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2537-L2558 | train | Remove a document from this collection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py | Collection.find_and_modify | def find_and_modify(self, query={}, update=None,
upsert=False, sort=None, full_response=False,
manipulate=False, **kwargs):
"""Update and return an object.
**DEPRECATED** - Use :meth:`find_one_and_delete`,
:meth:`find_one_and_replace`, or :meth:`f... | python | def find_and_modify(self, query={}, update=None,
upsert=False, sort=None, full_response=False,
manipulate=False, **kwargs):
"""Update and return an object.
**DEPRECATED** - Use :meth:`find_one_and_delete`,
:meth:`find_one_and_replace`, or :meth:`f... | [
"def",
"find_and_modify",
"(",
"self",
",",
"query",
"=",
"{",
"}",
",",
"update",
"=",
"None",
",",
"upsert",
"=",
"False",
",",
"sort",
"=",
"None",
",",
"full_response",
"=",
"False",
",",
"manipulate",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
... | Update and return an object.
**DEPRECATED** - Use :meth:`find_one_and_delete`,
:meth:`find_one_and_replace`, or :meth:`find_one_and_update` instead. | [
"Update",
"and",
"return",
"an",
"object",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/collection.py#L2560-L2634 | train | Find and modify a set of items in the 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/bson/regex.py | Regex.from_native | def from_native(cls, regex):
"""Convert a Python regular expression into a ``Regex`` instance.
Note that in Python 3, a regular expression compiled from a
:class:`str` has the ``re.UNICODE`` flag set. If it is undesirable
to store this flag in a BSON regular expression, unset it first::... | python | def from_native(cls, regex):
"""Convert a Python regular expression into a ``Regex`` instance.
Note that in Python 3, a regular expression compiled from a
:class:`str` has the ``re.UNICODE`` flag set. If it is undesirable
to store this flag in a BSON regular expression, unset it first::... | [
"def",
"from_native",
"(",
"cls",
",",
"regex",
")",
":",
"if",
"not",
"isinstance",
"(",
"regex",
",",
"RE_TYPE",
")",
":",
"raise",
"TypeError",
"(",
"\"regex must be a compiled regular expression, not %s\"",
"%",
"type",
"(",
"regex",
")",
")",
"return",
"R... | Convert a Python regular expression into a ``Regex`` instance.
Note that in Python 3, a regular expression compiled from a
:class:`str` has the ``re.UNICODE`` flag set. If it is undesirable
to store this flag in a BSON regular expression, unset it first::
>>> pattern = re.compile('.*... | [
"Convert",
"a",
"Python",
"regular",
"expression",
"into",
"a",
"Regex",
"instance",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/regex.py#L47-L76 | train | Convert a Python regular expression into a Regex 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/bson/__init__.py | _get_int | def _get_int(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON int32 to python int."""
end = position + 4
return _UNPACK_INT(data[position:end])[0], end | python | def _get_int(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON int32 to python int."""
end = position + 4
return _UNPACK_INT(data[position:end])[0], end | [
"def",
"_get_int",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"dummy1",
",",
"dummy2",
")",
":",
"end",
"=",
"position",
"+",
"4",
"return",
"_UNPACK_INT",
"(",
"data",
"[",
"position",
":",
"end",
"]",
")",
"[",
"0",
"]",
",",
"end"
] | Decode a BSON int32 to python int. | [
"Decode",
"a",
"BSON",
"int32",
"to",
"python",
"int",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L105-L108 | train | Decode a BSON 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/__init__.py | _get_float | def _get_float(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON double to python float."""
end = position + 8
return _UNPACK_FLOAT(data[position:end])[0], end | python | def _get_float(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON double to python float."""
end = position + 8
return _UNPACK_FLOAT(data[position:end])[0], end | [
"def",
"_get_float",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"dummy1",
",",
"dummy2",
")",
":",
"end",
"=",
"position",
"+",
"8",
"return",
"_UNPACK_FLOAT",
"(",
"data",
"[",
"position",
":",
"end",
"]",
")",
"[",
"0",
"]",
",",
"end"
] | Decode a BSON double to python float. | [
"Decode",
"a",
"BSON",
"double",
"to",
"python",
"float",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L118-L121 | train | Decode a BSON 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/__init__.py | _get_object | def _get_object(data, position, obj_end, opts, dummy):
"""Decode a BSON subdocument to opts.document_class or bson.dbref.DBRef."""
obj_size = _UNPACK_INT(data[position:position + 4])[0]
end = position + obj_size - 1
if data[end:position + obj_size] != b"\x00":
raise InvalidBSON("bad eoo")
if... | python | def _get_object(data, position, obj_end, opts, dummy):
"""Decode a BSON subdocument to opts.document_class or bson.dbref.DBRef."""
obj_size = _UNPACK_INT(data[position:position + 4])[0]
end = position + obj_size - 1
if data[end:position + obj_size] != b"\x00":
raise InvalidBSON("bad eoo")
if... | [
"def",
"_get_object",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"dummy",
")",
":",
"obj_size",
"=",
"_UNPACK_INT",
"(",
"data",
"[",
"position",
":",
"position",
"+",
"4",
"]",
")",
"[",
"0",
"]",
"end",
"=",
"position",
"+",
... | Decode a BSON subdocument to opts.document_class or bson.dbref.DBRef. | [
"Decode",
"a",
"BSON",
"subdocument",
"to",
"opts",
".",
"document_class",
"or",
"bson",
".",
"dbref",
".",
"DBRef",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L137-L155 | train | Decode a BSON subdocument to opts. document_class or 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/__init__.py | _get_array | def _get_array(data, position, obj_end, opts, element_name):
"""Decode a BSON array to python list."""
size = _UNPACK_INT(data[position:position + 4])[0]
end = position + size - 1
if data[end:end + 1] != b"\x00":
raise InvalidBSON("bad eoo")
position += 4
end -= 1
result = []
#... | python | def _get_array(data, position, obj_end, opts, element_name):
"""Decode a BSON array to python list."""
size = _UNPACK_INT(data[position:position + 4])[0]
end = position + size - 1
if data[end:end + 1] != b"\x00":
raise InvalidBSON("bad eoo")
position += 4
end -= 1
result = []
#... | [
"def",
"_get_array",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"element_name",
")",
":",
"size",
"=",
"_UNPACK_INT",
"(",
"data",
"[",
"position",
":",
"position",
"+",
"4",
"]",
")",
"[",
"0",
"]",
"end",
"=",
"position",
"+",
... | Decode a BSON array to python list. | [
"Decode",
"a",
"BSON",
"array",
"to",
"python",
"list",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L158-L187 | train | Decode a BSON array to python list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/__init__.py | _get_binary | def _get_binary(data, position, obj_end, opts, dummy1):
"""Decode a BSON binary to bson.binary.Binary or python UUID."""
length, subtype = _UNPACK_LENGTH_SUBTYPE(data[position:position + 5])
position += 5
if subtype == 2:
length2 = _UNPACK_INT(data[position:position + 4])[0]
position += ... | python | def _get_binary(data, position, obj_end, opts, dummy1):
"""Decode a BSON binary to bson.binary.Binary or python UUID."""
length, subtype = _UNPACK_LENGTH_SUBTYPE(data[position:position + 5])
position += 5
if subtype == 2:
length2 = _UNPACK_INT(data[position:position + 4])[0]
position += ... | [
"def",
"_get_binary",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"dummy1",
")",
":",
"length",
",",
"subtype",
"=",
"_UNPACK_LENGTH_SUBTYPE",
"(",
"data",
"[",
"position",
":",
"position",
"+",
"5",
"]",
")",
"position",
"+=",
"5",
... | Decode a BSON binary to bson.binary.Binary or python UUID. | [
"Decode",
"a",
"BSON",
"binary",
"to",
"bson",
".",
"binary",
".",
"Binary",
"or",
"python",
"UUID",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L190-L221 | train | Decode a BSON binary to bson. binary. Binary or python UUID. | Pu7Z6IJCgH3a,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/__init__.py | _get_oid | def _get_oid(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON ObjectId to bson.objectid.ObjectId."""
end = position + 12
return ObjectId(data[position:end]), end | python | def _get_oid(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON ObjectId to bson.objectid.ObjectId."""
end = position + 12
return ObjectId(data[position:end]), end | [
"def",
"_get_oid",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"dummy1",
",",
"dummy2",
")",
":",
"end",
"=",
"position",
"+",
"12",
"return",
"ObjectId",
"(",
"data",
"[",
"position",
":",
"end",
"]",
")",
",",
"end"
] | Decode a BSON ObjectId to bson.objectid.ObjectId. | [
"Decode",
"a",
"BSON",
"ObjectId",
"to",
"bson",
".",
"objectid",
".",
"ObjectId",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L224-L227 | train | Decode a BSON ObjectId to bson. objectid. ObjectId. | Pu7Z6IJCgH3a,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/__init__.py | _get_boolean | def _get_boolean(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON true/false to python True/False."""
end = position + 1
boolean_byte = data[position:end]
if boolean_byte == b'\x00':
return False, end
elif boolean_byte == b'\x01':
return True, end
raise InvalidBSON('inva... | python | def _get_boolean(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON true/false to python True/False."""
end = position + 1
boolean_byte = data[position:end]
if boolean_byte == b'\x00':
return False, end
elif boolean_byte == b'\x01':
return True, end
raise InvalidBSON('inva... | [
"def",
"_get_boolean",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"dummy1",
",",
"dummy2",
")",
":",
"end",
"=",
"position",
"+",
"1",
"boolean_byte",
"=",
"data",
"[",
"position",
":",
"end",
"]",
"if",
"boolean_byte",
"==",
"b'\\x00'",
":",
"r... | Decode a BSON true/false to python True/False. | [
"Decode",
"a",
"BSON",
"true",
"/",
"false",
"to",
"python",
"True",
"/",
"False",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L230-L238 | train | Decode a BSON boolean to python 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/bson/__init__.py | _get_date | def _get_date(data, position, dummy0, opts, dummy1):
"""Decode a BSON datetime to python datetime.datetime."""
end = position + 8
millis = _UNPACK_LONG(data[position:end])[0]
return _millis_to_datetime(millis, opts), end | python | def _get_date(data, position, dummy0, opts, dummy1):
"""Decode a BSON datetime to python datetime.datetime."""
end = position + 8
millis = _UNPACK_LONG(data[position:end])[0]
return _millis_to_datetime(millis, opts), end | [
"def",
"_get_date",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"opts",
",",
"dummy1",
")",
":",
"end",
"=",
"position",
"+",
"8",
"millis",
"=",
"_UNPACK_LONG",
"(",
"data",
"[",
"position",
":",
"end",
"]",
")",
"[",
"0",
"]",
"return",
"_m... | Decode a BSON datetime to python datetime.datetime. | [
"Decode",
"a",
"BSON",
"datetime",
"to",
"python",
"datetime",
".",
"datetime",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L241-L245 | train | Decode a BSON 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/__init__.py | _get_code | def _get_code(data, position, obj_end, opts, element_name):
"""Decode a BSON code to bson.code.Code."""
code, position = _get_string(data, position, obj_end, opts, element_name)
return Code(code), position | python | def _get_code(data, position, obj_end, opts, element_name):
"""Decode a BSON code to bson.code.Code."""
code, position = _get_string(data, position, obj_end, opts, element_name)
return Code(code), position | [
"def",
"_get_code",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"element_name",
")",
":",
"code",
",",
"position",
"=",
"_get_string",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"element_name",
")",
"return",
"Cod... | Decode a BSON code to bson.code.Code. | [
"Decode",
"a",
"BSON",
"code",
"to",
"bson",
".",
"code",
".",
"Code",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L248-L251 | train | Decode a BSON 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/__init__.py | _get_code_w_scope | def _get_code_w_scope(data, position, obj_end, opts, element_name):
"""Decode a BSON code_w_scope to bson.code.Code."""
code_end = position + _UNPACK_INT(data[position:position + 4])[0]
code, position = _get_string(
data, position + 4, code_end, opts, element_name)
scope, position = _get_object(... | python | def _get_code_w_scope(data, position, obj_end, opts, element_name):
"""Decode a BSON code_w_scope to bson.code.Code."""
code_end = position + _UNPACK_INT(data[position:position + 4])[0]
code, position = _get_string(
data, position + 4, code_end, opts, element_name)
scope, position = _get_object(... | [
"def",
"_get_code_w_scope",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"element_name",
")",
":",
"code_end",
"=",
"position",
"+",
"_UNPACK_INT",
"(",
"data",
"[",
"position",
":",
"position",
"+",
"4",
"]",
")",
"[",
"0",
"]",
"co... | Decode a BSON code_w_scope to bson.code.Code. | [
"Decode",
"a",
"BSON",
"code_w_scope",
"to",
"bson",
".",
"code",
".",
"Code",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L254-L262 | train | Decode a BSON code_w_scope 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/__init__.py | _get_ref | def _get_ref(data, position, obj_end, opts, element_name):
"""Decode (deprecated) BSON DBPointer to bson.dbref.DBRef."""
collection, position = _get_string(
data, position, obj_end, opts, element_name)
oid, position = _get_oid(data, position, obj_end, opts, element_name)
return DBRef(collection,... | python | def _get_ref(data, position, obj_end, opts, element_name):
"""Decode (deprecated) BSON DBPointer to bson.dbref.DBRef."""
collection, position = _get_string(
data, position, obj_end, opts, element_name)
oid, position = _get_oid(data, position, obj_end, opts, element_name)
return DBRef(collection,... | [
"def",
"_get_ref",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"element_name",
")",
":",
"collection",
",",
"position",
"=",
"_get_string",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
",",
"element_name",
")",
"oid",
",... | Decode (deprecated) BSON DBPointer to bson.dbref.DBRef. | [
"Decode",
"(",
"deprecated",
")",
"BSON",
"DBPointer",
"to",
"bson",
".",
"dbref",
".",
"DBRef",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L273-L278 | train | Decode a BSON 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/__init__.py | _get_timestamp | def _get_timestamp(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON timestamp to bson.timestamp.Timestamp."""
end = position + 8
inc, timestamp = _UNPACK_TIMESTAMP(data[position:end])
return Timestamp(timestamp, inc), end | python | def _get_timestamp(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON timestamp to bson.timestamp.Timestamp."""
end = position + 8
inc, timestamp = _UNPACK_TIMESTAMP(data[position:end])
return Timestamp(timestamp, inc), end | [
"def",
"_get_timestamp",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"dummy1",
",",
"dummy2",
")",
":",
"end",
"=",
"position",
"+",
"8",
"inc",
",",
"timestamp",
"=",
"_UNPACK_TIMESTAMP",
"(",
"data",
"[",
"position",
":",
"end",
"]",
")",
"retu... | Decode a BSON timestamp to bson.timestamp.Timestamp. | [
"Decode",
"a",
"BSON",
"timestamp",
"to",
"bson",
".",
"timestamp",
".",
"Timestamp",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L281-L285 | train | Decode a BSON timestamp to bson. timestamp. Timestamp. | Pu7Z6IJCgH3a,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/__init__.py | _get_int64 | def _get_int64(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON int64 to bson.int64.Int64."""
end = position + 8
return Int64(_UNPACK_LONG(data[position:end])[0]), end | python | def _get_int64(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON int64 to bson.int64.Int64."""
end = position + 8
return Int64(_UNPACK_LONG(data[position:end])[0]), end | [
"def",
"_get_int64",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"dummy1",
",",
"dummy2",
")",
":",
"end",
"=",
"position",
"+",
"8",
"return",
"Int64",
"(",
"_UNPACK_LONG",
"(",
"data",
"[",
"position",
":",
"end",
"]",
")",
"[",
"0",
"]",
"... | Decode a BSON int64 to bson.int64.Int64. | [
"Decode",
"a",
"BSON",
"int64",
"to",
"bson",
".",
"int64",
".",
"Int64",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L288-L291 | train | Decode a BSON 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/__init__.py | _get_decimal128 | def _get_decimal128(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON decimal128 to bson.decimal128.Decimal128."""
end = position + 16
return Decimal128.from_bid(data[position:end]), end | python | def _get_decimal128(data, position, dummy0, dummy1, dummy2):
"""Decode a BSON decimal128 to bson.decimal128.Decimal128."""
end = position + 16
return Decimal128.from_bid(data[position:end]), end | [
"def",
"_get_decimal128",
"(",
"data",
",",
"position",
",",
"dummy0",
",",
"dummy1",
",",
"dummy2",
")",
":",
"end",
"=",
"position",
"+",
"16",
"return",
"Decimal128",
".",
"from_bid",
"(",
"data",
"[",
"position",
":",
"end",
"]",
")",
",",
"end"
] | Decode a BSON decimal128 to bson.decimal128.Decimal128. | [
"Decode",
"a",
"BSON",
"decimal128",
"to",
"bson",
".",
"decimal128",
".",
"Decimal128",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L294-L297 | train | Decode a BSON 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/__init__.py | _element_to_dict | def _element_to_dict(data, position, obj_end, opts):
"""Decode a single key, value pair."""
element_type = data[position:position + 1]
position += 1
element_name, position = _get_c_string(data, position, opts)
try:
value, position = _ELEMENT_GETTER[element_type](data, position,
... | python | def _element_to_dict(data, position, obj_end, opts):
"""Decode a single key, value pair."""
element_type = data[position:position + 1]
position += 1
element_name, position = _get_c_string(data, position, opts)
try:
value, position = _ELEMENT_GETTER[element_type](data, position,
... | [
"def",
"_element_to_dict",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
")",
":",
"element_type",
"=",
"data",
"[",
"position",
":",
"position",
"+",
"1",
"]",
"position",
"+=",
"1",
"element_name",
",",
"position",
"=",
"_get_c_string",
"(",... | Decode a single key, value pair. | [
"Decode",
"a",
"single",
"key",
"value",
"pair",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L329-L340 | train | Decode a single key value 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/bson/__init__.py | _elements_to_dict | def _elements_to_dict(data, position, obj_end, opts):
"""Decode a BSON document."""
result = opts.document_class()
pos = position
for key, value, pos in _iterate_elements(data, position, obj_end, opts):
result[key] = value
if pos != obj_end:
raise InvalidBSON('bad object or element l... | python | def _elements_to_dict(data, position, obj_end, opts):
"""Decode a BSON document."""
result = opts.document_class()
pos = position
for key, value, pos in _iterate_elements(data, position, obj_end, opts):
result[key] = value
if pos != obj_end:
raise InvalidBSON('bad object or element l... | [
"def",
"_elements_to_dict",
"(",
"data",
",",
"position",
",",
"obj_end",
",",
"opts",
")",
":",
"result",
"=",
"opts",
".",
"document_class",
"(",
")",
"pos",
"=",
"position",
"for",
"key",
",",
"value",
",",
"pos",
"in",
"_iterate_elements",
"(",
"data... | Decode a BSON document. | [
"Decode",
"a",
"BSON",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L352-L360 | train | Decode a BSON 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/bson/__init__.py | gen_list_name | def gen_list_name():
"""Generate "keys" for encoded lists in the sequence
b"0\x00", b"1\x00", b"2\x00", ...
The first 1000 keys are returned from a pre-built cache. All
subsequent keys are generated on the fly.
"""
for name in _LIST_NAMES:
yield name
counter = itertools.count(1000)... | python | def gen_list_name():
"""Generate "keys" for encoded lists in the sequence
b"0\x00", b"1\x00", b"2\x00", ...
The first 1000 keys are returned from a pre-built cache. All
subsequent keys are generated on the fly.
"""
for name in _LIST_NAMES:
yield name
counter = itertools.count(1000)... | [
"def",
"gen_list_name",
"(",
")",
":",
"for",
"name",
"in",
"_LIST_NAMES",
":",
"yield",
"name",
"counter",
"=",
"itertools",
".",
"count",
"(",
"1000",
")",
"while",
"True",
":",
"yield",
"b",
"(",
"str",
"(",
"next",
"(",
"counter",
")",
")",
")",
... | Generate "keys" for encoded lists in the sequence
b"0\x00", b"1\x00", b"2\x00", ...
The first 1000 keys are returned from a pre-built cache. All
subsequent keys are generated on the fly. | [
"Generate",
"keys",
"for",
"encoded",
"lists",
"in",
"the",
"sequence",
"b",
"0",
"\\",
"x00",
"b",
"1",
"\\",
"x00",
"b",
"2",
"\\",
"x00",
"..."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L395-L407 | train | Generate the list name for the current 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/bson/__init__.py | _make_c_string_check | def _make_c_string_check(string):
"""Make a 'C' string, checking for embedded NUL characters."""
if isinstance(string, bytes):
if b"\x00" in string:
raise InvalidDocument("BSON keys / regex patterns must not "
"contain a NUL character")
try:
... | python | def _make_c_string_check(string):
"""Make a 'C' string, checking for embedded NUL characters."""
if isinstance(string, bytes):
if b"\x00" in string:
raise InvalidDocument("BSON keys / regex patterns must not "
"contain a NUL character")
try:
... | [
"def",
"_make_c_string_check",
"(",
"string",
")",
":",
"if",
"isinstance",
"(",
"string",
",",
"bytes",
")",
":",
"if",
"b\"\\x00\"",
"in",
"string",
":",
"raise",
"InvalidDocument",
"(",
"\"BSON keys / regex patterns must not \"",
"\"contain a NUL character\"",
")",... | Make a 'C' string, checking for embedded NUL characters. | [
"Make",
"a",
"C",
"string",
"checking",
"for",
"embedded",
"NUL",
"characters",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L410-L426 | train | Make a C string checking for embedded NUL characters. | Pu7Z6IJCgH3a,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/__init__.py | _make_c_string | def _make_c_string(string):
"""Make a 'C' string."""
if isinstance(string, bytes):
try:
_utf_8_decode(string, None, True)
return string + b"\x00"
except UnicodeError:
raise InvalidStringData("strings in documents must be valid "
... | python | def _make_c_string(string):
"""Make a 'C' string."""
if isinstance(string, bytes):
try:
_utf_8_decode(string, None, True)
return string + b"\x00"
except UnicodeError:
raise InvalidStringData("strings in documents must be valid "
... | [
"def",
"_make_c_string",
"(",
"string",
")",
":",
"if",
"isinstance",
"(",
"string",
",",
"bytes",
")",
":",
"try",
":",
"_utf_8_decode",
"(",
"string",
",",
"None",
",",
"True",
")",
"return",
"string",
"+",
"b\"\\x00\"",
"except",
"UnicodeError",
":",
... | Make a 'C' string. | [
"Make",
"a",
"C",
"string",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L429-L439 | train | Make a C 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/__init__.py | _encode_dbref | def _encode_dbref(name, value, check_keys, opts):
"""Encode bson.dbref.DBRef."""
buf = bytearray(b"\x03" + name + b"\x00\x00\x00\x00")
begin = len(buf) - 4
buf += _name_value_to_bson(b"$ref\x00",
value.collection, check_keys, opts)
buf += _name_value_to_bson(b"$id\x00... | python | def _encode_dbref(name, value, check_keys, opts):
"""Encode bson.dbref.DBRef."""
buf = bytearray(b"\x03" + name + b"\x00\x00\x00\x00")
begin = len(buf) - 4
buf += _name_value_to_bson(b"$ref\x00",
value.collection, check_keys, opts)
buf += _name_value_to_bson(b"$id\x00... | [
"def",
"_encode_dbref",
"(",
"name",
",",
"value",
",",
"check_keys",
",",
"opts",
")",
":",
"buf",
"=",
"bytearray",
"(",
"b\"\\x03\"",
"+",
"name",
"+",
"b\"\\x00\\x00\\x00\\x00\"",
")",
"begin",
"=",
"len",
"(",
"buf",
")",
"-",
"4",
"buf",
"+=",
"_... | Encode bson.dbref.DBRef. | [
"Encode",
"bson",
".",
"dbref",
".",
"DBRef",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L485-L502 | train | Encode a 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/__init__.py | _encode_list | def _encode_list(name, value, check_keys, opts):
"""Encode a list/tuple."""
lname = gen_list_name()
data = b"".join([_name_value_to_bson(next(lname), item,
check_keys, opts)
for item in value])
return b"\x04" + name + _PACK_INT(len(data) + 5)... | python | def _encode_list(name, value, check_keys, opts):
"""Encode a list/tuple."""
lname = gen_list_name()
data = b"".join([_name_value_to_bson(next(lname), item,
check_keys, opts)
for item in value])
return b"\x04" + name + _PACK_INT(len(data) + 5)... | [
"def",
"_encode_list",
"(",
"name",
",",
"value",
",",
"check_keys",
",",
"opts",
")",
":",
"lname",
"=",
"gen_list_name",
"(",
")",
"data",
"=",
"b\"\"",
".",
"join",
"(",
"[",
"_name_value_to_bson",
"(",
"next",
"(",
"lname",
")",
",",
"item",
",",
... | Encode a list/tuple. | [
"Encode",
"a",
"list",
"/",
"tuple",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L505-L511 | train | Encode a list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/__init__.py | _encode_text | def _encode_text(name, value, dummy0, dummy1):
"""Encode a python unicode (python 2.x) / str (python 3.x)."""
value = _utf_8_encode(value)[0]
return b"\x02" + name + _PACK_INT(len(value) + 1) + value + b"\x00" | python | def _encode_text(name, value, dummy0, dummy1):
"""Encode a python unicode (python 2.x) / str (python 3.x)."""
value = _utf_8_encode(value)[0]
return b"\x02" + name + _PACK_INT(len(value) + 1) + value + b"\x00" | [
"def",
"_encode_text",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"value",
"=",
"_utf_8_encode",
"(",
"value",
")",
"[",
"0",
"]",
"return",
"b\"\\x02\"",
"+",
"name",
"+",
"_PACK_INT",
"(",
"len",
"(",
"value",
")",
"+",
"1",... | Encode a python unicode (python 2.x) / str (python 3.x). | [
"Encode",
"a",
"python",
"unicode",
"(",
"python",
"2",
".",
"x",
")",
"/",
"str",
"(",
"python",
"3",
".",
"x",
")",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L514-L517 | train | Encode a text field. | Pu7Z6IJCgH3a,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/__init__.py | _encode_binary | def _encode_binary(name, value, dummy0, dummy1):
"""Encode bson.binary.Binary."""
subtype = value.subtype
if subtype == 2:
value = _PACK_INT(len(value)) + value
return b"\x05" + name + _PACK_LENGTH_SUBTYPE(len(value), subtype) + value | python | def _encode_binary(name, value, dummy0, dummy1):
"""Encode bson.binary.Binary."""
subtype = value.subtype
if subtype == 2:
value = _PACK_INT(len(value)) + value
return b"\x05" + name + _PACK_LENGTH_SUBTYPE(len(value), subtype) + value | [
"def",
"_encode_binary",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"subtype",
"=",
"value",
".",
"subtype",
"if",
"subtype",
"==",
"2",
":",
"value",
"=",
"_PACK_INT",
"(",
"len",
"(",
"value",
")",
")",
"+",
"value",
"return... | Encode bson.binary.Binary. | [
"Encode",
"bson",
".",
"binary",
".",
"Binary",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L520-L525 | train | Encode bson. binary. Binary. | Pu7Z6IJCgH3a,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/__init__.py | _encode_uuid | def _encode_uuid(name, value, dummy, opts):
"""Encode uuid.UUID."""
uuid_representation = opts.uuid_representation
# Python Legacy Common Case
if uuid_representation == OLD_UUID_SUBTYPE:
return b"\x05" + name + b'\x10\x00\x00\x00\x03' + value.bytes
# Java Legacy
elif uuid_representation ... | python | def _encode_uuid(name, value, dummy, opts):
"""Encode uuid.UUID."""
uuid_representation = opts.uuid_representation
# Python Legacy Common Case
if uuid_representation == OLD_UUID_SUBTYPE:
return b"\x05" + name + b'\x10\x00\x00\x00\x03' + value.bytes
# Java Legacy
elif uuid_representation ... | [
"def",
"_encode_uuid",
"(",
"name",
",",
"value",
",",
"dummy",
",",
"opts",
")",
":",
"uuid_representation",
"=",
"opts",
".",
"uuid_representation",
"# Python Legacy Common Case",
"if",
"uuid_representation",
"==",
"OLD_UUID_SUBTYPE",
":",
"return",
"b\"\\x05\"",
... | Encode uuid.UUID. | [
"Encode",
"uuid",
".",
"UUID",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L528-L545 | train | Encode uuid. UUID. | Pu7Z6IJCgH3a,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/__init__.py | _encode_bool | def _encode_bool(name, value, dummy0, dummy1):
"""Encode a python boolean (True/False)."""
return b"\x08" + name + (value and b"\x01" or b"\x00") | python | def _encode_bool(name, value, dummy0, dummy1):
"""Encode a python boolean (True/False)."""
return b"\x08" + name + (value and b"\x01" or b"\x00") | [
"def",
"_encode_bool",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"return",
"b\"\\x08\"",
"+",
"name",
"+",
"(",
"value",
"and",
"b\"\\x01\"",
"or",
"b\"\\x00\"",
")"
] | Encode a python boolean (True/False). | [
"Encode",
"a",
"python",
"boolean",
"(",
"True",
"/",
"False",
")",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L553-L555 | train | Encode a python boolean. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/bson/__init__.py | _encode_datetime | def _encode_datetime(name, value, dummy0, dummy1):
"""Encode datetime.datetime."""
millis = _datetime_to_millis(value)
return b"\x09" + name + _PACK_LONG(millis) | python | def _encode_datetime(name, value, dummy0, dummy1):
"""Encode datetime.datetime."""
millis = _datetime_to_millis(value)
return b"\x09" + name + _PACK_LONG(millis) | [
"def",
"_encode_datetime",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"millis",
"=",
"_datetime_to_millis",
"(",
"value",
")",
"return",
"b\"\\x09\"",
"+",
"name",
"+",
"_PACK_LONG",
"(",
"millis",
")"
] | Encode datetime.datetime. | [
"Encode",
"datetime",
".",
"datetime",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L558-L561 | train | Encode 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/__init__.py | _encode_regex | def _encode_regex(name, value, dummy0, dummy1):
"""Encode a python regex or bson.regex.Regex."""
flags = value.flags
# Python 2 common case
if flags == 0:
return b"\x0B" + name + _make_c_string_check(value.pattern) + b"\x00"
# Python 3 common case
elif flags == re.UNICODE:
return... | python | def _encode_regex(name, value, dummy0, dummy1):
"""Encode a python regex or bson.regex.Regex."""
flags = value.flags
# Python 2 common case
if flags == 0:
return b"\x0B" + name + _make_c_string_check(value.pattern) + b"\x00"
# Python 3 common case
elif flags == re.UNICODE:
return... | [
"def",
"_encode_regex",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"flags",
"=",
"value",
".",
"flags",
"# Python 2 common case",
"if",
"flags",
"==",
"0",
":",
"return",
"b\"\\x0B\"",
"+",
"name",
"+",
"_make_c_string_check",
"(",
... | Encode a python regex or bson.regex.Regex. | [
"Encode",
"a",
"python",
"regex",
"or",
"bson",
".",
"regex",
".",
"Regex",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L569-L593 | train | Encode a python regex or 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/__init__.py | _encode_int | def _encode_int(name, value, dummy0, dummy1):
"""Encode a python int."""
if -2147483648 <= value <= 2147483647:
return b"\x10" + name + _PACK_INT(value)
else:
try:
return b"\x12" + name + _PACK_LONG(value)
except struct.error:
raise OverflowError("BSON can onl... | python | def _encode_int(name, value, dummy0, dummy1):
"""Encode a python int."""
if -2147483648 <= value <= 2147483647:
return b"\x10" + name + _PACK_INT(value)
else:
try:
return b"\x12" + name + _PACK_LONG(value)
except struct.error:
raise OverflowError("BSON can onl... | [
"def",
"_encode_int",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"if",
"-",
"2147483648",
"<=",
"value",
"<=",
"2147483647",
":",
"return",
"b\"\\x10\"",
"+",
"name",
"+",
"_PACK_INT",
"(",
"value",
")",
"else",
":",
"try",
":",... | Encode a python int. | [
"Encode",
"a",
"python",
"int",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L607-L615 | train | Encode a 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/__init__.py | _encode_timestamp | def _encode_timestamp(name, value, dummy0, dummy1):
"""Encode bson.timestamp.Timestamp."""
return b"\x11" + name + _PACK_TIMESTAMP(value.inc, value.time) | python | def _encode_timestamp(name, value, dummy0, dummy1):
"""Encode bson.timestamp.Timestamp."""
return b"\x11" + name + _PACK_TIMESTAMP(value.inc, value.time) | [
"def",
"_encode_timestamp",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"return",
"b\"\\x11\"",
"+",
"name",
"+",
"_PACK_TIMESTAMP",
"(",
"value",
".",
"inc",
",",
"value",
".",
"time",
")"
] | Encode bson.timestamp.Timestamp. | [
"Encode",
"bson",
".",
"timestamp",
".",
"Timestamp",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L618-L620 | train | Encode bson. timestamp. Timestamp. | Pu7Z6IJCgH3a,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/__init__.py | _encode_long | def _encode_long(name, value, dummy0, dummy1):
"""Encode a python long (python 2.x)"""
try:
return b"\x12" + name + _PACK_LONG(value)
except struct.error:
raise OverflowError("BSON can only handle up to 8-byte ints") | python | def _encode_long(name, value, dummy0, dummy1):
"""Encode a python long (python 2.x)"""
try:
return b"\x12" + name + _PACK_LONG(value)
except struct.error:
raise OverflowError("BSON can only handle up to 8-byte ints") | [
"def",
"_encode_long",
"(",
"name",
",",
"value",
",",
"dummy0",
",",
"dummy1",
")",
":",
"try",
":",
"return",
"b\"\\x12\"",
"+",
"name",
"+",
"_PACK_LONG",
"(",
"value",
")",
"except",
"struct",
".",
"error",
":",
"raise",
"OverflowError",
"(",
"\"BSON... | Encode a python long (python 2.x) | [
"Encode",
"a",
"python",
"long",
"(",
"python",
"2",
".",
"x",
")"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L623-L628 | train | Encode a python long. | Pu7Z6IJCgH3a,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/__init__.py | _name_value_to_bson | def _name_value_to_bson(name, value, check_keys, opts):
"""Encode a single name, value pair."""
# First see if the type is already cached. KeyError will only ever
# happen once per subtype.
try:
return _ENCODERS[type(value)](name, value, check_keys, opts)
except KeyError:
pass
... | python | def _name_value_to_bson(name, value, check_keys, opts):
"""Encode a single name, value pair."""
# First see if the type is already cached. KeyError will only ever
# happen once per subtype.
try:
return _ENCODERS[type(value)](name, value, check_keys, opts)
except KeyError:
pass
... | [
"def",
"_name_value_to_bson",
"(",
"name",
",",
"value",
",",
"check_keys",
",",
"opts",
")",
":",
"# First see if the type is already cached. KeyError will only ever",
"# happen once per subtype.",
"try",
":",
"return",
"_ENCODERS",
"[",
"type",
"(",
"value",
")",
"]",... | Encode a single name, value pair. | [
"Encode",
"a",
"single",
"name",
"value",
"pair",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L698-L728 | train | Encode a single name value 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/bson/__init__.py | _element_to_bson | def _element_to_bson(key, value, check_keys, opts):
"""Encode a single key, value pair."""
if not isinstance(key, string_type):
raise InvalidDocument("documents must have only string keys, "
"key was %r" % (key,))
if check_keys:
if key.startswith("$"):
... | python | def _element_to_bson(key, value, check_keys, opts):
"""Encode a single key, value pair."""
if not isinstance(key, string_type):
raise InvalidDocument("documents must have only string keys, "
"key was %r" % (key,))
if check_keys:
if key.startswith("$"):
... | [
"def",
"_element_to_bson",
"(",
"key",
",",
"value",
",",
"check_keys",
",",
"opts",
")",
":",
"if",
"not",
"isinstance",
"(",
"key",
",",
"string_type",
")",
":",
"raise",
"InvalidDocument",
"(",
"\"documents must have only string keys, \"",
"\"key was %r\"",
"%"... | Encode a single key, value pair. | [
"Encode",
"a",
"single",
"key",
"value",
"pair",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L731-L743 | train | Encode a single key value 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/bson/__init__.py | _dict_to_bson | def _dict_to_bson(doc, check_keys, opts, top_level=True):
"""Encode a document to BSON."""
if _raw_document_class(doc):
return doc.raw
try:
elements = []
if top_level and "_id" in doc:
elements.append(_name_value_to_bson(b"_id\x00", doc["_id"],
... | python | def _dict_to_bson(doc, check_keys, opts, top_level=True):
"""Encode a document to BSON."""
if _raw_document_class(doc):
return doc.raw
try:
elements = []
if top_level and "_id" in doc:
elements.append(_name_value_to_bson(b"_id\x00", doc["_id"],
... | [
"def",
"_dict_to_bson",
"(",
"doc",
",",
"check_keys",
",",
"opts",
",",
"top_level",
"=",
"True",
")",
":",
"if",
"_raw_document_class",
"(",
"doc",
")",
":",
"return",
"doc",
".",
"raw",
"try",
":",
"elements",
"=",
"[",
"]",
"if",
"top_level",
"and"... | Encode a document to BSON. | [
"Encode",
"a",
"document",
"to",
"BSON",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L746-L763 | train | Encode a dictionary to BSON. | Pu7Z6IJCgH3a,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/__init__.py | _millis_to_datetime | def _millis_to_datetime(millis, opts):
"""Convert milliseconds since epoch UTC to datetime."""
diff = ((millis % 1000) + 1000) % 1000
seconds = (millis - diff) / 1000
micros = diff * 1000
if opts.tz_aware:
dt = EPOCH_AWARE + datetime.timedelta(seconds=seconds,
... | python | def _millis_to_datetime(millis, opts):
"""Convert milliseconds since epoch UTC to datetime."""
diff = ((millis % 1000) + 1000) % 1000
seconds = (millis - diff) / 1000
micros = diff * 1000
if opts.tz_aware:
dt = EPOCH_AWARE + datetime.timedelta(seconds=seconds,
... | [
"def",
"_millis_to_datetime",
"(",
"millis",
",",
"opts",
")",
":",
"diff",
"=",
"(",
"(",
"millis",
"%",
"1000",
")",
"+",
"1000",
")",
"%",
"1000",
"seconds",
"=",
"(",
"millis",
"-",
"diff",
")",
"/",
"1000",
"micros",
"=",
"diff",
"*",
"1000",
... | Convert milliseconds since epoch UTC to datetime. | [
"Convert",
"milliseconds",
"since",
"epoch",
"UTC",
"to",
"datetime",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L768-L781 | train | Convert milliseconds since epoch UTC to 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/__init__.py | decode_all | def decode_all(data, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode BSON data to multiple documents.
`data` must be a string of concatenated, valid, BSON-encoded
documents.
:Parameters:
- `data`: BSON data
- `codec_options` (optional): An instance of
:class:`~bson.codec_options.Co... | python | def decode_all(data, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode BSON data to multiple documents.
`data` must be a string of concatenated, valid, BSON-encoded
documents.
:Parameters:
- `data`: BSON data
- `codec_options` (optional): An instance of
:class:`~bson.codec_options.Co... | [
"def",
"decode_all",
"(",
"data",
",",
"codec_options",
"=",
"DEFAULT_CODEC_OPTIONS",
")",
":",
"if",
"not",
"isinstance",
"(",
"codec_options",
",",
"CodecOptions",
")",
":",
"raise",
"_CODEC_OPTIONS_TYPE_ERROR",
"docs",
"=",
"[",
"]",
"position",
"=",
"0",
"... | Decode BSON data to multiple documents.
`data` must be a string of concatenated, valid, BSON-encoded
documents.
:Parameters:
- `data`: BSON data
- `codec_options` (optional): An instance of
:class:`~bson.codec_options.CodecOptions`.
.. versionchanged:: 3.0
Removed `compile_... | [
"Decode",
"BSON",
"data",
"to",
"multiple",
"documents",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L796-L856 | train | Decode all documents in a BSON string into a list of documents. | Pu7Z6IJCgH3a,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/__init__.py | decode_iter | def decode_iter(data, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode BSON data to multiple documents as a generator.
Works similarly to the decode_all function, but yields one document at a
time.
`data` must be a string of concatenated, valid, BSON-encoded
documents.
:Parameters:
- `da... | python | def decode_iter(data, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode BSON data to multiple documents as a generator.
Works similarly to the decode_all function, but yields one document at a
time.
`data` must be a string of concatenated, valid, BSON-encoded
documents.
:Parameters:
- `da... | [
"def",
"decode_iter",
"(",
"data",
",",
"codec_options",
"=",
"DEFAULT_CODEC_OPTIONS",
")",
":",
"if",
"not",
"isinstance",
"(",
"codec_options",
",",
"CodecOptions",
")",
":",
"raise",
"_CODEC_OPTIONS_TYPE_ERROR",
"position",
"=",
"0",
"end",
"=",
"len",
"(",
... | Decode BSON data to multiple documents as a generator.
Works similarly to the decode_all function, but yields one document at a
time.
`data` must be a string of concatenated, valid, BSON-encoded
documents.
:Parameters:
- `data`: BSON data
- `codec_options` (optional): An instance of
... | [
"Decode",
"BSON",
"data",
"to",
"multiple",
"documents",
"as",
"a",
"generator",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L863-L893 | train | Decode a BSON string into a generator of _BSONDicts. | Pu7Z6IJCgH3a,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/__init__.py | decode_file_iter | def decode_file_iter(file_obj, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode bson data from a file to multiple documents as a generator.
Works similarly to the decode_all function, but reads from the file object
in chunks and parses bson in chunks, yielding one document at a time.
:Parameters:
... | python | def decode_file_iter(file_obj, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode bson data from a file to multiple documents as a generator.
Works similarly to the decode_all function, but reads from the file object
in chunks and parses bson in chunks, yielding one document at a time.
:Parameters:
... | [
"def",
"decode_file_iter",
"(",
"file_obj",
",",
"codec_options",
"=",
"DEFAULT_CODEC_OPTIONS",
")",
":",
"while",
"True",
":",
"# Read size of next object.",
"size_data",
"=",
"file_obj",
".",
"read",
"(",
"4",
")",
"if",
"len",
"(",
"size_data",
")",
"==",
"... | Decode bson data from a file to multiple documents as a generator.
Works similarly to the decode_all function, but reads from the file object
in chunks and parses bson in chunks, yielding one document at a time.
:Parameters:
- `file_obj`: A file object containing BSON data.
- `codec_options` (... | [
"Decode",
"bson",
"data",
"from",
"a",
"file",
"to",
"multiple",
"documents",
"as",
"a",
"generator",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L896-L922 | train | Decode a file into multiple documents as a generator. | Pu7Z6IJCgH3a,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/__init__.py | is_valid | def is_valid(bson):
"""Check that the given string represents valid :class:`BSON` data.
Raises :class:`TypeError` if `bson` is not an instance of
:class:`str` (:class:`bytes` in python 3). Returns ``True``
if `bson` is valid :class:`BSON`, ``False`` otherwise.
:Parameters:
- `bson`: the data... | python | def is_valid(bson):
"""Check that the given string represents valid :class:`BSON` data.
Raises :class:`TypeError` if `bson` is not an instance of
:class:`str` (:class:`bytes` in python 3). Returns ``True``
if `bson` is valid :class:`BSON`, ``False`` otherwise.
:Parameters:
- `bson`: the data... | [
"def",
"is_valid",
"(",
"bson",
")",
":",
"if",
"not",
"isinstance",
"(",
"bson",
",",
"bytes",
")",
":",
"raise",
"TypeError",
"(",
"\"BSON data must be an instance of a subclass of bytes\"",
")",
"try",
":",
"_bson_to_dict",
"(",
"bson",
",",
"DEFAULT_CODEC_OPTI... | Check that the given string represents valid :class:`BSON` data.
Raises :class:`TypeError` if `bson` is not an instance of
:class:`str` (:class:`bytes` in python 3). Returns ``True``
if `bson` is valid :class:`BSON`, ``False`` otherwise.
:Parameters:
- `bson`: the data to be validated | [
"Check",
"that",
"the",
"given",
"string",
"represents",
"valid",
":",
"class",
":",
"BSON",
"data",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L925-L942 | train | Check that the given string represents valid BSON 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 | tokumx/datadog_checks/tokumx/vendor/bson/__init__.py | BSON.encode | def encode(cls, document, check_keys=False,
codec_options=DEFAULT_CODEC_OPTIONS):
"""Encode a document to a new :class:`BSON` instance.
A document can be any mapping type (like :class:`dict`).
Raises :class:`TypeError` if `document` is not a mapping type,
or contains key... | python | def encode(cls, document, check_keys=False,
codec_options=DEFAULT_CODEC_OPTIONS):
"""Encode a document to a new :class:`BSON` instance.
A document can be any mapping type (like :class:`dict`).
Raises :class:`TypeError` if `document` is not a mapping type,
or contains key... | [
"def",
"encode",
"(",
"cls",
",",
"document",
",",
"check_keys",
"=",
"False",
",",
"codec_options",
"=",
"DEFAULT_CODEC_OPTIONS",
")",
":",
"if",
"not",
"isinstance",
"(",
"codec_options",
",",
"CodecOptions",
")",
":",
"raise",
"_CODEC_OPTIONS_TYPE_ERROR",
"re... | Encode a document to a new :class:`BSON` instance.
A document can be any mapping type (like :class:`dict`).
Raises :class:`TypeError` if `document` is not a mapping type,
or contains keys that are not instances of
:class:`basestring` (:class:`str` in python 3). Raises
:class:`~... | [
"Encode",
"a",
"document",
"to",
"a",
"new",
":",
"class",
":",
"BSON",
"instance",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L950-L976 | train | Encode a dictionary into a new BSON 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.