id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
16,700 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.rget | def rget(self, key, replica_index=None, quiet=None):
"""Get an item from a replica node
:param string key: The key to fetch
:param int replica_index: The replica index to fetch.
If this is ``None`` then this method will return once any
replica responds. Use :attr:`config... | python | def rget(self, key, replica_index=None, quiet=None):
"""Get an item from a replica node
:param string key: The key to fetch
:param int replica_index: The replica index to fetch.
If this is ``None`` then this method will return once any
replica responds. Use :attr:`config... | [
"def",
"rget",
"(",
"self",
",",
"key",
",",
"replica_index",
"=",
"None",
",",
"quiet",
"=",
"None",
")",
":",
"if",
"replica_index",
"is",
"not",
"None",
":",
"return",
"_Base",
".",
"_rgetix",
"(",
"self",
",",
"key",
",",
"replica",
"=",
"replica... | Get an item from a replica node
:param string key: The key to fetch
:param int replica_index: The replica index to fetch.
If this is ``None`` then this method will return once any
replica responds. Use :attr:`configured_replica_count` to
figure out the upper bound fo... | [
"Get",
"an",
"item",
"from",
"a",
"replica",
"node"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L1354-L1379 |
16,701 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.query | def query(self, design, view, use_devmode=False, **kwargs):
"""
Query a pre-defined MapReduce view, passing parameters.
This method executes a view on the cluster. It accepts various
parameters for the view and returns an iterable object
(specifically, a :class:`~.View`).
... | python | def query(self, design, view, use_devmode=False, **kwargs):
"""
Query a pre-defined MapReduce view, passing parameters.
This method executes a view on the cluster. It accepts various
parameters for the view and returns an iterable object
(specifically, a :class:`~.View`).
... | [
"def",
"query",
"(",
"self",
",",
"design",
",",
"view",
",",
"use_devmode",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"design",
"=",
"self",
".",
"_mk_devmode",
"(",
"design",
",",
"use_devmode",
")",
"itercls",
"=",
"kwargs",
".",
"pop",
"("... | Query a pre-defined MapReduce view, passing parameters.
This method executes a view on the cluster. It accepts various
parameters for the view and returns an iterable object
(specifically, a :class:`~.View`).
:param string design: The design document
:param string view: The vie... | [
"Query",
"a",
"pre",
"-",
"defined",
"MapReduce",
"view",
"passing",
"parameters",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L1435-L1477 |
16,702 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.n1ql_query | def n1ql_query(self, query, *args, **kwargs):
"""
Execute a N1QL query.
This method is mainly a wrapper around the :class:`~.N1QLQuery`
and :class:`~.N1QLRequest` objects, which contain the inputs
and outputs of the query.
Using an explicit :class:`~.N1QLQuery`::
... | python | def n1ql_query(self, query, *args, **kwargs):
"""
Execute a N1QL query.
This method is mainly a wrapper around the :class:`~.N1QLQuery`
and :class:`~.N1QLRequest` objects, which contain the inputs
and outputs of the query.
Using an explicit :class:`~.N1QLQuery`::
... | [
"def",
"n1ql_query",
"(",
"self",
",",
"query",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"query",
",",
"N1QLQuery",
")",
":",
"query",
"=",
"N1QLQuery",
"(",
"query",
")",
"itercls",
"=",
"kwargs",
".",
"... | Execute a N1QL query.
This method is mainly a wrapper around the :class:`~.N1QLQuery`
and :class:`~.N1QLRequest` objects, which contain the inputs
and outputs of the query.
Using an explicit :class:`~.N1QLQuery`::
query = N1QLQuery(
'SELECT airportname FROM... | [
"Execute",
"a",
"N1QL",
"query",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L1479-L1517 |
16,703 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.analytics_query | def analytics_query(self, query, host, *args, **kwargs):
"""
Execute an Analytics query.
This method is mainly a wrapper around the :class:`~.AnalyticsQuery`
and :class:`~.AnalyticsRequest` objects, which contain the inputs
and outputs of the query.
Using an explicit :c... | python | def analytics_query(self, query, host, *args, **kwargs):
"""
Execute an Analytics query.
This method is mainly a wrapper around the :class:`~.AnalyticsQuery`
and :class:`~.AnalyticsRequest` objects, which contain the inputs
and outputs of the query.
Using an explicit :c... | [
"def",
"analytics_query",
"(",
"self",
",",
"query",
",",
"host",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"query",
",",
"AnalyticsQuery",
")",
":",
"query",
"=",
"AnalyticsQuery",
"(",
"query",
",",
"*",
"... | Execute an Analytics query.
This method is mainly a wrapper around the :class:`~.AnalyticsQuery`
and :class:`~.AnalyticsRequest` objects, which contain the inputs
and outputs of the query.
Using an explicit :class:`~.AnalyticsQuery`::
query = AnalyticsQuery(
... | [
"Execute",
"an",
"Analytics",
"query",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L1519-L1554 |
16,704 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.search | def search(self, index, query, **kwargs):
"""
Perform full-text searches
.. versionadded:: 2.0.9
.. warning::
The full-text search API is experimental and subject to change
:param str index: Name of the index to query
:param couchbase.fulltext.SearchQuery ... | python | def search(self, index, query, **kwargs):
"""
Perform full-text searches
.. versionadded:: 2.0.9
.. warning::
The full-text search API is experimental and subject to change
:param str index: Name of the index to query
:param couchbase.fulltext.SearchQuery ... | [
"def",
"search",
"(",
"self",
",",
"index",
",",
"query",
",",
"*",
"*",
"kwargs",
")",
":",
"itercls",
"=",
"kwargs",
".",
"pop",
"(",
"'itercls'",
",",
"_FTS",
".",
"SearchRequest",
")",
"iterargs",
"=",
"itercls",
".",
"mk_kwargs",
"(",
"kwargs",
... | Perform full-text searches
.. versionadded:: 2.0.9
.. warning::
The full-text search API is experimental and subject to change
:param str index: Name of the index to query
:param couchbase.fulltext.SearchQuery query: Query to issue
:param couchbase.fulltext.Params... | [
"Perform",
"full",
"-",
"text",
"searches"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L1559-L1588 |
16,705 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.is_ssl | def is_ssl(self):
"""
Read-only boolean property indicating whether SSL is used for
this connection.
If this property is true, then all communication between this
object and the Couchbase cluster is encrypted using SSL.
See :meth:`__init__` for more information on conne... | python | def is_ssl(self):
"""
Read-only boolean property indicating whether SSL is used for
this connection.
If this property is true, then all communication between this
object and the Couchbase cluster is encrypted using SSL.
See :meth:`__init__` for more information on conne... | [
"def",
"is_ssl",
"(",
"self",
")",
":",
"mode",
"=",
"self",
".",
"_cntl",
"(",
"op",
"=",
"_LCB",
".",
"LCB_CNTL_SSL_MODE",
",",
"value_type",
"=",
"'int'",
")",
"return",
"mode",
"&",
"_LCB",
".",
"LCB_SSL_ENABLED",
"!=",
"0"
] | Read-only boolean property indicating whether SSL is used for
this connection.
If this property is true, then all communication between this
object and the Couchbase cluster is encrypted using SSL.
See :meth:`__init__` for more information on connection options. | [
"Read",
"-",
"only",
"boolean",
"property",
"indicating",
"whether",
"SSL",
"is",
"used",
"for",
"this",
"connection",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L1740-L1751 |
16,706 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.flush | def flush(self):
"""
Clears the bucket's contents.
.. note::
This functionality requires that the flush option be
enabled for the bucket by the cluster administrator. You
can enable flush on the bucket using the administrative
console (See http:/... | python | def flush(self):
"""
Clears the bucket's contents.
.. note::
This functionality requires that the flush option be
enabled for the bucket by the cluster administrator. You
can enable flush on the bucket using the administrative
console (See http:/... | [
"def",
"flush",
"(",
"self",
")",
":",
"path",
"=",
"'/pools/default/buckets/{0}/controller/doFlush'",
"path",
"=",
"path",
".",
"format",
"(",
"self",
".",
"bucket",
")",
"return",
"self",
".",
"_http_request",
"(",
"type",
"=",
"_LCB",
".",
"LCB_HTTP_TYPE_MA... | Clears the bucket's contents.
.. note::
This functionality requires that the flush option be
enabled for the bucket by the cluster administrator. You
can enable flush on the bucket using the administrative
console (See http://docs.couchbase.com/admin/admin/UI/ui... | [
"Clears",
"the",
"bucket",
"s",
"contents",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2070-L2095 |
16,707 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.map_add | def map_add(self, key, mapkey, value, create=False, **kwargs):
"""
Set a value for a key in a map.
.. warning::
The functionality of the various `map_*`, `list_*`, `queue_*`
and `set_*` functions are considered experimental and are included
in the library to... | python | def map_add(self, key, mapkey, value, create=False, **kwargs):
"""
Set a value for a key in a map.
.. warning::
The functionality of the various `map_*`, `list_*`, `queue_*`
and `set_*` functions are considered experimental and are included
in the library to... | [
"def",
"map_add",
"(",
"self",
",",
"key",
",",
"mapkey",
",",
"value",
",",
"create",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"op",
"=",
"SD",
".",
"upsert",
"(",
"mapkey",
",",
"value",
")",
"sdres",
"=",
"self",
".",
"mutate_in",
"(",... | Set a value for a key in a map.
.. warning::
The functionality of the various `map_*`, `list_*`, `queue_*`
and `set_*` functions are considered experimental and are included
in the library to demonstrate new functionality.
They may change in the future or be rem... | [
"Set",
"a",
"value",
"for",
"a",
"key",
"in",
"a",
"map",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2111-L2144 |
16,708 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.map_get | def map_get(self, key, mapkey):
"""
Retrieve a value from a map.
:param str key: The document ID
:param str mapkey: Key within the map to retrieve
:return: :class:`~.ValueResult`
:raise: :exc:`IndexError` if the mapkey does not exist
:raise: :cb_exc:`NotFoundErro... | python | def map_get(self, key, mapkey):
"""
Retrieve a value from a map.
:param str key: The document ID
:param str mapkey: Key within the map to retrieve
:return: :class:`~.ValueResult`
:raise: :exc:`IndexError` if the mapkey does not exist
:raise: :cb_exc:`NotFoundErro... | [
"def",
"map_get",
"(",
"self",
",",
"key",
",",
"mapkey",
")",
":",
"op",
"=",
"SD",
".",
"get",
"(",
"mapkey",
")",
"sdres",
"=",
"self",
".",
"lookup_in",
"(",
"key",
",",
"op",
")",
"return",
"self",
".",
"_wrap_dsop",
"(",
"sdres",
",",
"True... | Retrieve a value from a map.
:param str key: The document ID
:param str mapkey: Key within the map to retrieve
:return: :class:`~.ValueResult`
:raise: :exc:`IndexError` if the mapkey does not exist
:raise: :cb_exc:`NotFoundError` if the document does not exist.
.. seeal... | [
"Retrieve",
"a",
"value",
"from",
"a",
"map",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2147-L2161 |
16,709 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.map_remove | def map_remove(self, key, mapkey, **kwargs):
"""
Remove an item from a map.
:param str key: The document ID
:param str mapkey: The key in the map
:param kwargs: See :meth:`mutate_in` for options
:raise: :exc:`IndexError` if the mapkey does not exist
:raise: :cb_e... | python | def map_remove(self, key, mapkey, **kwargs):
"""
Remove an item from a map.
:param str key: The document ID
:param str mapkey: The key in the map
:param kwargs: See :meth:`mutate_in` for options
:raise: :exc:`IndexError` if the mapkey does not exist
:raise: :cb_e... | [
"def",
"map_remove",
"(",
"self",
",",
"key",
",",
"mapkey",
",",
"*",
"*",
"kwargs",
")",
":",
"op",
"=",
"SD",
".",
"remove",
"(",
"mapkey",
")",
"sdres",
"=",
"self",
".",
"mutate_in",
"(",
"key",
",",
"op",
",",
"*",
"*",
"kwargs",
")",
"re... | Remove an item from a map.
:param str key: The document ID
:param str mapkey: The key in the map
:param kwargs: See :meth:`mutate_in` for options
:raise: :exc:`IndexError` if the mapkey does not exist
:raise: :cb_exc:`NotFoundError` if the document does not exist.
.. Re... | [
"Remove",
"an",
"item",
"from",
"a",
"map",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2164-L2182 |
16,710 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.map_size | def map_size(self, key):
"""
Get the number of items in the map.
:param str key: The document ID of the map
:return int: The number of items in the map
:raise: :cb_exc:`NotFoundError` if the document does not exist.
.. seealso:: :meth:`map_add`
"""
# TOD... | python | def map_size(self, key):
"""
Get the number of items in the map.
:param str key: The document ID of the map
:return int: The number of items in the map
:raise: :cb_exc:`NotFoundError` if the document does not exist.
.. seealso:: :meth:`map_add`
"""
# TOD... | [
"def",
"map_size",
"(",
"self",
",",
"key",
")",
":",
"# TODO: This should use get_count, but we need to check for compat",
"# with server version (i.e. >= 4.6) first; otherwise it just",
"# disconnects.",
"rv",
"=",
"self",
".",
"get",
"(",
"key",
")",
"return",
"len",
"("... | Get the number of items in the map.
:param str key: The document ID of the map
:return int: The number of items in the map
:raise: :cb_exc:`NotFoundError` if the document does not exist.
.. seealso:: :meth:`map_add` | [
"Get",
"the",
"number",
"of",
"items",
"in",
"the",
"map",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2185-L2200 |
16,711 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.list_append | def list_append(self, key, value, create=False, **kwargs):
"""
Add an item to the end of a list.
:param str key: The document ID of the list
:param value: The value to append
:param create: Whether the list should be created if it does not
exist. Note that this op... | python | def list_append(self, key, value, create=False, **kwargs):
"""
Add an item to the end of a list.
:param str key: The document ID of the list
:param value: The value to append
:param create: Whether the list should be created if it does not
exist. Note that this op... | [
"def",
"list_append",
"(",
"self",
",",
"key",
",",
"value",
",",
"create",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"op",
"=",
"SD",
".",
"array_append",
"(",
"''",
",",
"value",
")",
"sdres",
"=",
"self",
".",
"mutate_in",
"(",
"key",
"... | Add an item to the end of a list.
:param str key: The document ID of the list
:param value: The value to append
:param create: Whether the list should be created if it does not
exist. Note that this option only works on servers >= 4.6
:param kwargs: Additional arguments t... | [
"Add",
"an",
"item",
"to",
"the",
"end",
"of",
"a",
"list",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2203-L2225 |
16,712 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.list_prepend | def list_prepend(self, key, value, create=False, **kwargs):
"""
Add an item to the beginning of a list.
:param str key: Document ID
:param value: Value to prepend
:param bool create:
Whether the list should be created if it does not exist
:param kwargs: Addit... | python | def list_prepend(self, key, value, create=False, **kwargs):
"""
Add an item to the beginning of a list.
:param str key: Document ID
:param value: Value to prepend
:param bool create:
Whether the list should be created if it does not exist
:param kwargs: Addit... | [
"def",
"list_prepend",
"(",
"self",
",",
"key",
",",
"value",
",",
"create",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"op",
"=",
"SD",
".",
"array_prepend",
"(",
"''",
",",
"value",
")",
"sdres",
"=",
"self",
".",
"mutate_in",
"(",
"key",
... | Add an item to the beginning of a list.
:param str key: Document ID
:param value: Value to prepend
:param bool create:
Whether the list should be created if it does not exist
:param kwargs: Additional arguments to :meth:`mutate_in`.
:return: :class:`OperationResult`.... | [
"Add",
"an",
"item",
"to",
"the",
"beginning",
"of",
"a",
"list",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2228-L2248 |
16,713 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.list_set | def list_set(self, key, index, value, **kwargs):
"""
Sets an item within a list at a given position.
:param key: The key of the document
:param index: The position to replace
:param value: The value to be inserted
:param kwargs: Additional arguments to :meth:`mutate_in`
... | python | def list_set(self, key, index, value, **kwargs):
"""
Sets an item within a list at a given position.
:param key: The key of the document
:param index: The position to replace
:param value: The value to be inserted
:param kwargs: Additional arguments to :meth:`mutate_in`
... | [
"def",
"list_set",
"(",
"self",
",",
"key",
",",
"index",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"op",
"=",
"SD",
".",
"replace",
"(",
"'[{0}]'",
".",
"format",
"(",
"index",
")",
",",
"value",
")",
"sdres",
"=",
"self",
".",
"mutate_in... | Sets an item within a list at a given position.
:param key: The key of the document
:param index: The position to replace
:param value: The value to be inserted
:param kwargs: Additional arguments to :meth:`mutate_in`
:return: :class:`OperationResult`
:raise: :cb_exc:`No... | [
"Sets",
"an",
"item",
"within",
"a",
"list",
"at",
"a",
"given",
"position",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2251-L2273 |
16,714 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.set_add | def set_add(self, key, value, create=False, **kwargs):
"""
Add an item to a set if the item does not yet exist.
:param key: The document ID
:param value: Value to add
:param create: Create the set if it does not exist
:param kwargs: Arguments to :meth:`mutate_in`
... | python | def set_add(self, key, value, create=False, **kwargs):
"""
Add an item to a set if the item does not yet exist.
:param key: The document ID
:param value: Value to add
:param create: Create the set if it does not exist
:param kwargs: Arguments to :meth:`mutate_in`
... | [
"def",
"set_add",
"(",
"self",
",",
"key",
",",
"value",
",",
"create",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"op",
"=",
"SD",
".",
"array_addunique",
"(",
"''",
",",
"value",
")",
"try",
":",
"sdres",
"=",
"self",
".",
"mutate_in",
"(... | Add an item to a set if the item does not yet exist.
:param key: The document ID
:param value: Value to add
:param create: Create the set if it does not exist
:param kwargs: Arguments to :meth:`mutate_in`
:return: A :class:`~.OperationResult` if the item was added,
:rais... | [
"Add",
"an",
"item",
"to",
"a",
"set",
"if",
"the",
"item",
"does",
"not",
"yet",
"exist",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2276-L2295 |
16,715 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.set_remove | def set_remove(self, key, value, **kwargs):
"""
Remove an item from a set.
:param key: The docuent ID
:param value: Value to remove
:param kwargs: Arguments to :meth:`mutate_in`
:return: A :class:`OperationResult` if the item was removed, false
otherwise... | python | def set_remove(self, key, value, **kwargs):
"""
Remove an item from a set.
:param key: The docuent ID
:param value: Value to remove
:param kwargs: Arguments to :meth:`mutate_in`
:return: A :class:`OperationResult` if the item was removed, false
otherwise... | [
"def",
"set_remove",
"(",
"self",
",",
"key",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"while",
"True",
":",
"rv",
"=",
"self",
".",
"get",
"(",
"key",
")",
"try",
":",
"ix",
"=",
"rv",
".",
"value",
".",
"index",
"(",
"value",
")",
"... | Remove an item from a set.
:param key: The docuent ID
:param value: Value to remove
:param kwargs: Arguments to :meth:`mutate_in`
:return: A :class:`OperationResult` if the item was removed, false
otherwise
:raise: :cb_exc:`NotFoundError` if the set does not exi... | [
"Remove",
"an",
"item",
"from",
"a",
"set",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2298-L2320 |
16,716 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.list_remove | def list_remove(self, key, index, **kwargs):
"""
Remove the element at a specific index from a list.
:param key: The document ID of the list
:param index: The index to remove
:param kwargs: Arguments to :meth:`mutate_in`
:return: :class:`OperationResult`
:raise: ... | python | def list_remove(self, key, index, **kwargs):
"""
Remove the element at a specific index from a list.
:param key: The document ID of the list
:param index: The index to remove
:param kwargs: Arguments to :meth:`mutate_in`
:return: :class:`OperationResult`
:raise: ... | [
"def",
"list_remove",
"(",
"self",
",",
"key",
",",
"index",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"map_remove",
"(",
"key",
",",
"'[{0}]'",
".",
"format",
"(",
"index",
")",
",",
"*",
"*",
"kwargs",
")"
] | Remove the element at a specific index from a list.
:param key: The document ID of the list
:param index: The index to remove
:param kwargs: Arguments to :meth:`mutate_in`
:return: :class:`OperationResult`
:raise: :exc:`IndexError` if the index does not exist
:raise: :cb... | [
"Remove",
"the",
"element",
"at",
"a",
"specific",
"index",
"from",
"a",
"list",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2358-L2369 |
16,717 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.queue_push | def queue_push(self, key, value, create=False, **kwargs):
"""
Add an item to the end of a queue.
:param key: The document ID of the queue
:param value: The item to add to the queue
:param create: Whether the queue should be created if it does not exist
:param kwargs: Arg... | python | def queue_push(self, key, value, create=False, **kwargs):
"""
Add an item to the end of a queue.
:param key: The document ID of the queue
:param value: The item to add to the queue
:param create: Whether the queue should be created if it does not exist
:param kwargs: Arg... | [
"def",
"queue_push",
"(",
"self",
",",
"key",
",",
"value",
",",
"create",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"list_prepend",
"(",
"key",
",",
"value",
",",
"*",
"*",
"kwargs",
")"
] | Add an item to the end of a queue.
:param key: The document ID of the queue
:param value: The item to add to the queue
:param create: Whether the queue should be created if it does not exist
:param kwargs: Arguments to pass to :meth:`mutate_in`
:return: :class:`OperationResult`
... | [
"Add",
"an",
"item",
"to",
"the",
"end",
"of",
"a",
"queue",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2383-L2403 |
16,718 | couchbase/couchbase-python-client | couchbase/bucket.py | Bucket.queue_pop | def queue_pop(self, key, **kwargs):
"""
Remove and return the first item queue.
:param key: The document ID
:param kwargs: Arguments passed to :meth:`mutate_in`
:return: A :class:`ValueResult`
:raise: :cb_exc:`QueueEmpty` if there are no items in the queue.
:rais... | python | def queue_pop(self, key, **kwargs):
"""
Remove and return the first item queue.
:param key: The document ID
:param kwargs: Arguments passed to :meth:`mutate_in`
:return: A :class:`ValueResult`
:raise: :cb_exc:`QueueEmpty` if there are no items in the queue.
:rais... | [
"def",
"queue_pop",
"(",
"self",
",",
"key",
",",
"*",
"*",
"kwargs",
")",
":",
"while",
"True",
":",
"try",
":",
"itm",
"=",
"self",
".",
"list_get",
"(",
"key",
",",
"-",
"1",
")",
"except",
"IndexError",
":",
"raise",
"E",
".",
"QueueEmpty",
"... | Remove and return the first item queue.
:param key: The document ID
:param kwargs: Arguments passed to :meth:`mutate_in`
:return: A :class:`ValueResult`
:raise: :cb_exc:`QueueEmpty` if there are no items in the queue.
:raise: :cb_exc:`NotFoundError` if the queue does not exist. | [
"Remove",
"and",
"return",
"the",
"first",
"item",
"queue",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucket.py#L2406-L2429 |
16,719 | couchbase/couchbase-python-client | couchbase/asynchronous/rowsbase.py | AsyncRowsBase._callback | def _callback(self, mres):
"""
This is invoked as the row callback.
If 'rows' is true, then we are a row callback, otherwise
the request has ended and it's time to collect the other data
"""
try:
rows = self._process_payload(self.raw.rows)
if rows:... | python | def _callback(self, mres):
"""
This is invoked as the row callback.
If 'rows' is true, then we are a row callback, otherwise
the request has ended and it's time to collect the other data
"""
try:
rows = self._process_payload(self.raw.rows)
if rows:... | [
"def",
"_callback",
"(",
"self",
",",
"mres",
")",
":",
"try",
":",
"rows",
"=",
"self",
".",
"_process_payload",
"(",
"self",
".",
"raw",
".",
"rows",
")",
"if",
"rows",
":",
"self",
".",
"on_rows",
"(",
"rows",
")",
"if",
"self",
".",
"raw",
".... | This is invoked as the row callback.
If 'rows' is true, then we are a row callback, otherwise
the request has ended and it's time to collect the other data | [
"This",
"is",
"invoked",
"as",
"the",
"row",
"callback",
".",
"If",
"rows",
"is",
"true",
"then",
"we",
"are",
"a",
"row",
"callback",
"otherwise",
"the",
"request",
"has",
"ended",
"and",
"it",
"s",
"time",
"to",
"collect",
"the",
"other",
"data"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/asynchronous/rowsbase.py#L66-L80 |
16,720 | couchbase/couchbase-python-client | examples/item.py | Player.create | def create(cls, name, email, cb):
"""
Create the basic structure of a player
"""
it = cls(name, create_structure=True)
it.value['email'] = email
# In an actual application you'd probably want to use 'add',
# but since this app might be run multiple times, you don... | python | def create(cls, name, email, cb):
"""
Create the basic structure of a player
"""
it = cls(name, create_structure=True)
it.value['email'] = email
# In an actual application you'd probably want to use 'add',
# but since this app might be run multiple times, you don... | [
"def",
"create",
"(",
"cls",
",",
"name",
",",
"email",
",",
"cb",
")",
":",
"it",
"=",
"cls",
"(",
"name",
",",
"create_structure",
"=",
"True",
")",
"it",
".",
"value",
"[",
"'email'",
"]",
"=",
"email",
"# In an actual application you'd probably want to... | Create the basic structure of a player | [
"Create",
"the",
"basic",
"structure",
"of",
"a",
"player"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/examples/item.py#L32-L43 |
16,721 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager._doc_rev | def _doc_rev(self, res):
"""
Returns the rev id from the header
"""
jstr = res.headers['X-Couchbase-Meta']
jobj = json.loads(jstr)
return jobj['rev'] | python | def _doc_rev(self, res):
"""
Returns the rev id from the header
"""
jstr = res.headers['X-Couchbase-Meta']
jobj = json.loads(jstr)
return jobj['rev'] | [
"def",
"_doc_rev",
"(",
"self",
",",
"res",
")",
":",
"jstr",
"=",
"res",
".",
"headers",
"[",
"'X-Couchbase-Meta'",
"]",
"jobj",
"=",
"json",
".",
"loads",
"(",
"jstr",
")",
"return",
"jobj",
"[",
"'rev'",
"]"
] | Returns the rev id from the header | [
"Returns",
"the",
"rev",
"id",
"from",
"the",
"header"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L47-L53 |
16,722 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.design_create | def design_create(self, name, ddoc, use_devmode=True, syncwait=0):
"""
Store a design document
:param string name: The name of the design
:param ddoc: The actual contents of the design document
:type ddoc: string or dict
If ``ddoc`` is a string, it is passed, as-is,... | python | def design_create(self, name, ddoc, use_devmode=True, syncwait=0):
"""
Store a design document
:param string name: The name of the design
:param ddoc: The actual contents of the design document
:type ddoc: string or dict
If ``ddoc`` is a string, it is passed, as-is,... | [
"def",
"design_create",
"(",
"self",
",",
"name",
",",
"ddoc",
",",
"use_devmode",
"=",
"True",
",",
"syncwait",
"=",
"0",
")",
":",
"name",
"=",
"self",
".",
"_cb",
".",
"_mk_devmode",
"(",
"name",
",",
"use_devmode",
")",
"fqname",
"=",
"\"_design/{0... | Store a design document
:param string name: The name of the design
:param ddoc: The actual contents of the design document
:type ddoc: string or dict
If ``ddoc`` is a string, it is passed, as-is, to the server.
Otherwise it is serialized as JSON, and its ``_id`` field i... | [
"Store",
"a",
"design",
"document"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L130-L190 |
16,723 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.design_get | def design_get(self, name, use_devmode=True):
"""
Retrieve a design document
:param string name: The name of the design document
:param bool use_devmode: Whether this design document is still in
"development" mode
:return: A :class:`~couchbase.result.HttpResult` con... | python | def design_get(self, name, use_devmode=True):
"""
Retrieve a design document
:param string name: The name of the design document
:param bool use_devmode: Whether this design document is still in
"development" mode
:return: A :class:`~couchbase.result.HttpResult` con... | [
"def",
"design_get",
"(",
"self",
",",
"name",
",",
"use_devmode",
"=",
"True",
")",
":",
"name",
"=",
"self",
".",
"_mk_devmode",
"(",
"name",
",",
"use_devmode",
")",
"existing",
"=",
"self",
".",
"_http_request",
"(",
"type",
"=",
"_LCB",
".",
"LCB_... | Retrieve a design document
:param string name: The name of the design document
:param bool use_devmode: Whether this design document is still in
"development" mode
:return: A :class:`~couchbase.result.HttpResult` containing
a dict representing the format of the design d... | [
"Retrieve",
"a",
"design",
"document"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L192-L215 |
16,724 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.design_delete | def design_delete(self, name, use_devmode=True, syncwait=0):
"""
Delete a design document
:param string name: The name of the design document to delete
:param bool use_devmode: Whether the design to delete is a development
mode design doc.
:param float syncwait: Tim... | python | def design_delete(self, name, use_devmode=True, syncwait=0):
"""
Delete a design document
:param string name: The name of the design document to delete
:param bool use_devmode: Whether the design to delete is a development
mode design doc.
:param float syncwait: Tim... | [
"def",
"design_delete",
"(",
"self",
",",
"name",
",",
"use_devmode",
"=",
"True",
",",
"syncwait",
"=",
"0",
")",
":",
"name",
"=",
"self",
".",
"_mk_devmode",
"(",
"name",
",",
"use_devmode",
")",
"existing",
"=",
"None",
"if",
"syncwait",
":",
"try"... | Delete a design document
:param string name: The name of the design document to delete
:param bool use_devmode: Whether the design to delete is a development
mode design doc.
:param float syncwait: Timeout for operation verification. See
:meth:`design_create` for more i... | [
"Delete",
"a",
"design",
"document"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L249-L284 |
16,725 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.design_list | def design_list(self):
"""
List all design documents for the current bucket.
:return: A :class:`~couchbase.result.HttpResult` containing
a dict, with keys being the ID of the design document.
.. note::
This information is derived using the
``pools/d... | python | def design_list(self):
"""
List all design documents for the current bucket.
:return: A :class:`~couchbase.result.HttpResult` containing
a dict, with keys being the ID of the design document.
.. note::
This information is derived using the
``pools/d... | [
"def",
"design_list",
"(",
"self",
")",
":",
"ret",
"=",
"self",
".",
"_http_request",
"(",
"type",
"=",
"_LCB",
".",
"LCB_HTTP_TYPE_MANAGEMENT",
",",
"path",
"=",
"\"/pools/default/buckets/{0}/ddocs\"",
".",
"format",
"(",
"self",
".",
"_cb",
".",
"bucket",
... | List all design documents for the current bucket.
:return: A :class:`~couchbase.result.HttpResult` containing
a dict, with keys being the ID of the design document.
.. note::
This information is derived using the
``pools/default/buckets/<bucket>ddocs`` endpoint, bu... | [
"List",
"all",
"design",
"documents",
"for",
"the",
"current",
"bucket",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L286-L338 |
16,726 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.n1ql_index_create | def n1ql_index_create(self, ix, **kwargs):
"""
Create an index for use with N1QL.
:param str ix: The name of the index to create
:param bool defer: Whether the building of indexes should be
deferred. If creating multiple indexes on an existing
dataset, using the ... | python | def n1ql_index_create(self, ix, **kwargs):
"""
Create an index for use with N1QL.
:param str ix: The name of the index to create
:param bool defer: Whether the building of indexes should be
deferred. If creating multiple indexes on an existing
dataset, using the ... | [
"def",
"n1ql_index_create",
"(",
"self",
",",
"ix",
",",
"*",
"*",
"kwargs",
")",
":",
"defer",
"=",
"kwargs",
".",
"pop",
"(",
"'defer'",
",",
"False",
")",
"ignore_exists",
"=",
"kwargs",
".",
"pop",
"(",
"'ignore_exists'",
",",
"False",
")",
"primar... | Create an index for use with N1QL.
:param str ix: The name of the index to create
:param bool defer: Whether the building of indexes should be
deferred. If creating multiple indexes on an existing
dataset, using the `defer` option in conjunction with
:meth:`build_def... | [
"Create",
"an",
"index",
"for",
"use",
"with",
"N1QL",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L355-L412 |
16,727 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.n1ql_index_create_primary | def n1ql_index_create_primary(self, defer=False, ignore_exists=False):
"""
Create the primary index on the bucket.
Equivalent to::
n1ql_index_create('', primary=True, **kwargs)
:param bool defer:
:param bool ignore_exists:
.. seealso:: :meth:`create_index`... | python | def n1ql_index_create_primary(self, defer=False, ignore_exists=False):
"""
Create the primary index on the bucket.
Equivalent to::
n1ql_index_create('', primary=True, **kwargs)
:param bool defer:
:param bool ignore_exists:
.. seealso:: :meth:`create_index`... | [
"def",
"n1ql_index_create_primary",
"(",
"self",
",",
"defer",
"=",
"False",
",",
"ignore_exists",
"=",
"False",
")",
":",
"return",
"self",
".",
"n1ql_index_create",
"(",
"''",
",",
"defer",
"=",
"defer",
",",
"primary",
"=",
"True",
",",
"ignore_exists",
... | Create the primary index on the bucket.
Equivalent to::
n1ql_index_create('', primary=True, **kwargs)
:param bool defer:
:param bool ignore_exists:
.. seealso:: :meth:`create_index` | [
"Create",
"the",
"primary",
"index",
"on",
"the",
"bucket",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L414-L428 |
16,728 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.n1ql_index_drop | def n1ql_index_drop(self, ix, primary=False, **kwargs):
"""
Delete an index from the cluster.
:param str ix: the name of the index
:param bool primary: if this index is a primary index
:param bool ignore_missing: Do not raise an exception if the index
does not exist
... | python | def n1ql_index_drop(self, ix, primary=False, **kwargs):
"""
Delete an index from the cluster.
:param str ix: the name of the index
:param bool primary: if this index is a primary index
:param bool ignore_missing: Do not raise an exception if the index
does not exist
... | [
"def",
"n1ql_index_drop",
"(",
"self",
",",
"ix",
",",
"primary",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"info",
"=",
"self",
".",
"_mk_index_def",
"(",
"ix",
",",
"primary",
")",
"return",
"IxmgmtRequest",
"(",
"self",
".",
"_cb",
",",
"'d... | Delete an index from the cluster.
:param str ix: the name of the index
:param bool primary: if this index is a primary index
:param bool ignore_missing: Do not raise an exception if the index
does not exist
:raise: :exc:`~.NotFoundError` if the index does not exist and
... | [
"Delete",
"an",
"index",
"from",
"the",
"cluster",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L430-L442 |
16,729 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.n1ql_index_build_deferred | def n1ql_index_build_deferred(self, other_buckets=False):
"""
Instruct the server to begin building any previously deferred index
definitions.
This method will gather a list of all pending indexes in the cluster
(including those created using the `defer` option with
:met... | python | def n1ql_index_build_deferred(self, other_buckets=False):
"""
Instruct the server to begin building any previously deferred index
definitions.
This method will gather a list of all pending indexes in the cluster
(including those created using the `defer` option with
:met... | [
"def",
"n1ql_index_build_deferred",
"(",
"self",
",",
"other_buckets",
"=",
"False",
")",
":",
"info",
"=",
"N1qlIndex",
"(",
")",
"if",
"not",
"other_buckets",
":",
"info",
".",
"keyspace",
"=",
"self",
".",
"_cb",
".",
"bucket",
"return",
"IxmgmtRequest",
... | Instruct the server to begin building any previously deferred index
definitions.
This method will gather a list of all pending indexes in the cluster
(including those created using the `defer` option with
:meth:`create_index`) and start building them in an efficient manner.
:pa... | [
"Instruct",
"the",
"server",
"to",
"begin",
"building",
"any",
"previously",
"deferred",
"index",
"definitions",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L466-L497 |
16,730 | couchbase/couchbase-python-client | couchbase/bucketmanager.py | BucketManager.n1ql_index_watch | def n1ql_index_watch(self, indexes,
timeout=30, interval=0.2, watch_primary=False):
"""
Await completion of index building
This method will wait up to `timeout` seconds for every index in
`indexes` to have been built. It will poll the cluster every
`inte... | python | def n1ql_index_watch(self, indexes,
timeout=30, interval=0.2, watch_primary=False):
"""
Await completion of index building
This method will wait up to `timeout` seconds for every index in
`indexes` to have been built. It will poll the cluster every
`inte... | [
"def",
"n1ql_index_watch",
"(",
"self",
",",
"indexes",
",",
"timeout",
"=",
"30",
",",
"interval",
"=",
"0.2",
",",
"watch_primary",
"=",
"False",
")",
":",
"kwargs",
"=",
"{",
"'timeout_us'",
":",
"int",
"(",
"timeout",
"*",
"1000000",
")",
",",
"'in... | Await completion of index building
This method will wait up to `timeout` seconds for every index in
`indexes` to have been built. It will poll the cluster every
`interval` seconds.
:param list indexes: A list of indexes to check. This is returned by
:meth:`build_deferred_in... | [
"Await",
"completion",
"of",
"index",
"building"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/bucketmanager.py#L499-L528 |
16,731 | couchbase/couchbase-python-client | couchbase/views/params.py | QueryBase._set_range_common | def _set_range_common(self, k_sugar, k_start, k_end, value):
"""
Checks to see if the client-side convenience key is present, and if so
converts the sugar convenience key into its real server-side
equivalents.
:param string k_sugar: The client-side convenience key
:param... | python | def _set_range_common(self, k_sugar, k_start, k_end, value):
"""
Checks to see if the client-side convenience key is present, and if so
converts the sugar convenience key into its real server-side
equivalents.
:param string k_sugar: The client-side convenience key
:param... | [
"def",
"_set_range_common",
"(",
"self",
",",
"k_sugar",
",",
"k_start",
",",
"k_end",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"(",
"list",
",",
"tuple",
",",
"_Unspec",
")",
")",
":",
"raise",
"ArgumentError",
".",
"pyexc... | Checks to see if the client-side convenience key is present, and if so
converts the sugar convenience key into its real server-side
equivalents.
:param string k_sugar: The client-side convenience key
:param string k_start: The server-side key specifying the beginning of
the ... | [
"Checks",
"to",
"see",
"if",
"the",
"client",
"-",
"side",
"convenience",
"key",
"is",
"present",
"and",
"if",
"so",
"converts",
"the",
"sugar",
"convenience",
"key",
"into",
"its",
"real",
"server",
"-",
"side",
"equivalents",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/views/params.py#L276-L319 |
16,732 | couchbase/couchbase-python-client | couchbase/views/params.py | QueryBase.update | def update(self, copy=False, **params):
"""
Chained assignment operator.
This may be used to quickly assign extra parameters to the
:class:`Query` object.
Example::
q = Query(reduce=True, full_sec=True)
# Someplace later
v = View(design, v... | python | def update(self, copy=False, **params):
"""
Chained assignment operator.
This may be used to quickly assign extra parameters to the
:class:`Query` object.
Example::
q = Query(reduce=True, full_sec=True)
# Someplace later
v = View(design, v... | [
"def",
"update",
"(",
"self",
",",
"copy",
"=",
"False",
",",
"*",
"*",
"params",
")",
":",
"if",
"copy",
":",
"self",
"=",
"deepcopy",
"(",
"self",
")",
"for",
"k",
",",
"v",
"in",
"params",
".",
"items",
"(",
")",
":",
"if",
"not",
"hasattr",... | Chained assignment operator.
This may be used to quickly assign extra parameters to the
:class:`Query` object.
Example::
q = Query(reduce=True, full_sec=True)
# Someplace later
v = View(design, view, query=q.update(mapkey_range=["foo"]))
Its prim... | [
"Chained",
"assignment",
"operator",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/views/params.py#L362-L401 |
16,733 | couchbase/couchbase-python-client | couchbase/views/params.py | QueryBase.from_any | def from_any(cls, params, **ctor_opts):
"""
Creates a new Query object from input.
:param params: Parameter to convert to query
:type params: dict, string, or :class:`Query`
If ``params`` is a :class:`Query` object already, a deep copy is made
and a new :class:`Query` o... | python | def from_any(cls, params, **ctor_opts):
"""
Creates a new Query object from input.
:param params: Parameter to convert to query
:type params: dict, string, or :class:`Query`
If ``params`` is a :class:`Query` object already, a deep copy is made
and a new :class:`Query` o... | [
"def",
"from_any",
"(",
"cls",
",",
"params",
",",
"*",
"*",
"ctor_opts",
")",
":",
"if",
"isinstance",
"(",
"params",
",",
"cls",
")",
":",
"return",
"deepcopy",
"(",
"params",
")",
"elif",
"isinstance",
"(",
"params",
",",
"dict",
")",
":",
"ctor_o... | Creates a new Query object from input.
:param params: Parameter to convert to query
:type params: dict, string, or :class:`Query`
If ``params`` is a :class:`Query` object already, a deep copy is made
and a new :class:`Query` object is returned.
If ``params`` is a string, then ... | [
"Creates",
"a",
"new",
"Query",
"object",
"from",
"input",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/views/params.py#L404-L446 |
16,734 | couchbase/couchbase-python-client | couchbase/views/params.py | QueryBase.encoded | def encoded(self):
"""
Returns an encoded form of the query
"""
if not self._encoded:
self._encoded = self._encode()
if self._base_str:
return '&'.join((self._base_str, self._encoded))
else:
return self._encoded | python | def encoded(self):
"""
Returns an encoded form of the query
"""
if not self._encoded:
self._encoded = self._encode()
if self._base_str:
return '&'.join((self._base_str, self._encoded))
else:
return self._encoded | [
"def",
"encoded",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_encoded",
":",
"self",
".",
"_encoded",
"=",
"self",
".",
"_encode",
"(",
")",
"if",
"self",
".",
"_base_str",
":",
"return",
"'&'",
".",
"join",
"(",
"(",
"self",
".",
"_base_str... | Returns an encoded form of the query | [
"Returns",
"an",
"encoded",
"form",
"of",
"the",
"query"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/views/params.py#L475-L486 |
16,735 | couchbase/couchbase-python-client | txcouchbase/bucket.py | RawBucket.registerDeferred | def registerDeferred(self, event, d):
"""
Register a defer to be fired at the firing of a specific event.
:param string event: Currently supported values are `connect`. Another
value may be `_dtor` which will register an event to fire when this
object has been completely des... | python | def registerDeferred(self, event, d):
"""
Register a defer to be fired at the firing of a specific event.
:param string event: Currently supported values are `connect`. Another
value may be `_dtor` which will register an event to fire when this
object has been completely des... | [
"def",
"registerDeferred",
"(",
"self",
",",
"event",
",",
"d",
")",
":",
"try",
":",
"self",
".",
"_evq",
"[",
"event",
"]",
".",
"schedule",
"(",
"d",
")",
"except",
"KeyError",
":",
"raise",
"ValueError",
"(",
"\"No such event type\"",
",",
"event",
... | Register a defer to be fired at the firing of a specific event.
:param string event: Currently supported values are `connect`. Another
value may be `_dtor` which will register an event to fire when this
object has been completely destroyed.
:param event: The defered to fire when th... | [
"Register",
"a",
"defer",
"to",
"be",
"fired",
"at",
"the",
"firing",
"of",
"a",
"specific",
"event",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/txcouchbase/bucket.py#L149-L180 |
16,736 | couchbase/couchbase-python-client | txcouchbase/bucket.py | RawBucket.queryEx | def queryEx(self, viewcls, *args, **kwargs):
"""
Query a view, with the ``viewcls`` instance receiving events
of the query as they arrive.
:param type viewcls: A class (derived from :class:`AsyncViewBase`)
to instantiate
Other arguments are passed to the standard `que... | python | def queryEx(self, viewcls, *args, **kwargs):
"""
Query a view, with the ``viewcls`` instance receiving events
of the query as they arrive.
:param type viewcls: A class (derived from :class:`AsyncViewBase`)
to instantiate
Other arguments are passed to the standard `que... | [
"def",
"queryEx",
"(",
"self",
",",
"viewcls",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'itercls'",
"]",
"=",
"viewcls",
"o",
"=",
"super",
"(",
"AsyncBucket",
",",
"self",
")",
".",
"query",
"(",
"*",
"args",
",",
"*"... | Query a view, with the ``viewcls`` instance receiving events
of the query as they arrive.
:param type viewcls: A class (derived from :class:`AsyncViewBase`)
to instantiate
Other arguments are passed to the standard `query` method.
This functions exactly like the :meth:`~couc... | [
"Query",
"a",
"view",
"with",
"the",
"viewcls",
"instance",
"receiving",
"events",
"of",
"the",
"query",
"as",
"they",
"arrive",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/txcouchbase/bucket.py#L239-L261 |
16,737 | couchbase/couchbase-python-client | txcouchbase/bucket.py | RawBucket.n1qlQueryEx | def n1qlQueryEx(self, cls, *args, **kwargs):
"""
Execute a N1QL statement providing a custom handler for rows.
This method allows you to define your own subclass (of
:class:`~AsyncN1QLRequest`) which can handle rows as they are
received from the network.
:param cls: The... | python | def n1qlQueryEx(self, cls, *args, **kwargs):
"""
Execute a N1QL statement providing a custom handler for rows.
This method allows you to define your own subclass (of
:class:`~AsyncN1QLRequest`) which can handle rows as they are
received from the network.
:param cls: The... | [
"def",
"n1qlQueryEx",
"(",
"self",
",",
"cls",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'itercls'",
"]",
"=",
"cls",
"o",
"=",
"super",
"(",
"AsyncBucket",
",",
"self",
")",
".",
"n1ql_query",
"(",
"*",
"args",
",",
"*... | Execute a N1QL statement providing a custom handler for rows.
This method allows you to define your own subclass (of
:class:`~AsyncN1QLRequest`) which can handle rows as they are
received from the network.
:param cls: The subclass (not instance) to use
:param args: Positional a... | [
"Execute",
"a",
"N1QL",
"statement",
"providing",
"a",
"custom",
"handler",
"for",
"rows",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/txcouchbase/bucket.py#L291-L311 |
16,738 | couchbase/couchbase-python-client | txcouchbase/bucket.py | RawBucket.n1qlQueryAll | def n1qlQueryAll(self, *args, **kwargs):
"""
Execute a N1QL query, retrieving all rows.
This method returns a :class:`Deferred` object which is executed
with a :class:`~.N1QLRequest` object. The object may be iterated
over to yield the rows in the result set.
This metho... | python | def n1qlQueryAll(self, *args, **kwargs):
"""
Execute a N1QL query, retrieving all rows.
This method returns a :class:`Deferred` object which is executed
with a :class:`~.N1QLRequest` object. The object may be iterated
over to yield the rows in the result set.
This metho... | [
"def",
"n1qlQueryAll",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"connected",
":",
"cb",
"=",
"lambda",
"x",
":",
"self",
".",
"n1qlQueryAll",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"retu... | Execute a N1QL query, retrieving all rows.
This method returns a :class:`Deferred` object which is executed
with a :class:`~.N1QLRequest` object. The object may be iterated
over to yield the rows in the result set.
This method is similar to :meth:`~couchbase.bucket.Bucket.n1ql_query`
... | [
"Execute",
"a",
"N1QL",
"query",
"retrieving",
"all",
"rows",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/txcouchbase/bucket.py#L313-L345 |
16,739 | couchbase/couchbase-python-client | txcouchbase/bucket.py | Bucket._wrap | def _wrap(self, meth, *args, **kwargs):
"""
Calls a given method with the appropriate arguments, or defers such
a call until the instance has been connected
"""
if not self.connected:
return self._connectSchedule(self._wrap, meth, *args, **kwargs)
opres = met... | python | def _wrap(self, meth, *args, **kwargs):
"""
Calls a given method with the appropriate arguments, or defers such
a call until the instance has been connected
"""
if not self.connected:
return self._connectSchedule(self._wrap, meth, *args, **kwargs)
opres = met... | [
"def",
"_wrap",
"(",
"self",
",",
"meth",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"connected",
":",
"return",
"self",
".",
"_connectSchedule",
"(",
"self",
".",
"_wrap",
",",
"meth",
",",
"*",
"args",
",",
"... | Calls a given method with the appropriate arguments, or defers such
a call until the instance has been connected | [
"Calls",
"a",
"given",
"method",
"with",
"the",
"appropriate",
"arguments",
"or",
"defers",
"such",
"a",
"call",
"until",
"the",
"instance",
"has",
"been",
"connected"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/txcouchbase/bucket.py#L467-L476 |
16,740 | couchbase/couchbase-python-client | couchbase/transcoder.py | get_decode_format | def get_decode_format(flags):
"""
Returns a tuple of format, recognized
"""
c_flags = flags & FMT_COMMON_MASK
l_flags = flags & FMT_LEGACY_MASK
if c_flags:
if c_flags not in COMMON_FORMATS:
return FMT_BYTES, False
else:
return COMMON2UNIFIED[c_flags], Tru... | python | def get_decode_format(flags):
"""
Returns a tuple of format, recognized
"""
c_flags = flags & FMT_COMMON_MASK
l_flags = flags & FMT_LEGACY_MASK
if c_flags:
if c_flags not in COMMON_FORMATS:
return FMT_BYTES, False
else:
return COMMON2UNIFIED[c_flags], Tru... | [
"def",
"get_decode_format",
"(",
"flags",
")",
":",
"c_flags",
"=",
"flags",
"&",
"FMT_COMMON_MASK",
"l_flags",
"=",
"flags",
"&",
"FMT_LEGACY_MASK",
"if",
"c_flags",
":",
"if",
"c_flags",
"not",
"in",
"COMMON_FORMATS",
":",
"return",
"FMT_BYTES",
",",
"False"... | Returns a tuple of format, recognized | [
"Returns",
"a",
"tuple",
"of",
"format",
"recognized"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/transcoder.py#L43-L59 |
16,741 | couchbase/couchbase-python-client | couchbase/admin.py | Admin.bucket_create | def bucket_create(self, name, bucket_type='couchbase',
bucket_password='', replicas=0, ram_quota=1024,
flush_enabled=False):
"""
Create a new bucket
:param string name: The name of the bucket to create
:param string bucket_type: The type of bu... | python | def bucket_create(self, name, bucket_type='couchbase',
bucket_password='', replicas=0, ram_quota=1024,
flush_enabled=False):
"""
Create a new bucket
:param string name: The name of the bucket to create
:param string bucket_type: The type of bu... | [
"def",
"bucket_create",
"(",
"self",
",",
"name",
",",
"bucket_type",
"=",
"'couchbase'",
",",
"bucket_password",
"=",
"''",
",",
"replicas",
"=",
"0",
",",
"ram_quota",
"=",
"1024",
",",
"flush_enabled",
"=",
"False",
")",
":",
"params",
"=",
"{",
"'nam... | Create a new bucket
:param string name: The name of the bucket to create
:param string bucket_type: The type of bucket to create. This
can either be `couchbase` to create a couchbase style
bucket (which persists data and supports replication) or
`memcached` (which is... | [
"Create",
"a",
"new",
"bucket"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/admin.py#L162-L210 |
16,742 | couchbase/couchbase-python-client | couchbase/admin.py | Admin.wait_ready | def wait_ready(self, name, timeout=5.0, sleep_interval=0.2):
"""
Wait for a newly created bucket to be ready.
:param string name: the name to wait for
:param seconds timeout: the maximum amount of time to wait
:param seconds sleep_interval: the number of time to sleep
... | python | def wait_ready(self, name, timeout=5.0, sleep_interval=0.2):
"""
Wait for a newly created bucket to be ready.
:param string name: the name to wait for
:param seconds timeout: the maximum amount of time to wait
:param seconds sleep_interval: the number of time to sleep
... | [
"def",
"wait_ready",
"(",
"self",
",",
"name",
",",
"timeout",
"=",
"5.0",
",",
"sleep_interval",
"=",
"0.2",
")",
":",
"end",
"=",
"time",
"(",
")",
"+",
"timeout",
"while",
"True",
":",
"try",
":",
"info",
"=",
"self",
".",
"bucket_info",
"(",
"n... | Wait for a newly created bucket to be ready.
:param string name: the name to wait for
:param seconds timeout: the maximum amount of time to wait
:param seconds sleep_interval: the number of time to sleep
between each probe
:raise: :exc:`.CouchbaseError` on internal HTTP erro... | [
"Wait",
"for",
"a",
"newly",
"created",
"bucket",
"to",
"be",
"ready",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/admin.py#L241-L264 |
16,743 | couchbase/couchbase-python-client | couchbase/admin.py | Admin.bucket_update | def bucket_update(self, name, current, bucket_password=None, replicas=None,
ram_quota=None, flush_enabled=None):
"""
Update an existing bucket's settings.
:param string name: The name of the bucket to update
:param dict current: Current state of the bucket.
... | python | def bucket_update(self, name, current, bucket_password=None, replicas=None,
ram_quota=None, flush_enabled=None):
"""
Update an existing bucket's settings.
:param string name: The name of the bucket to update
:param dict current: Current state of the bucket.
... | [
"def",
"bucket_update",
"(",
"self",
",",
"name",
",",
"current",
",",
"bucket_password",
"=",
"None",
",",
"replicas",
"=",
"None",
",",
"ram_quota",
"=",
"None",
",",
"flush_enabled",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"current",
"=",
"c... | Update an existing bucket's settings.
:param string name: The name of the bucket to update
:param dict current: Current state of the bucket.
This can be retrieve from :meth:`bucket_info`
:param str bucket_password: Change the bucket's password
:param int replicas: The number... | [
"Update",
"an",
"existing",
"bucket",
"s",
"settings",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/admin.py#L266-L329 |
16,744 | couchbase/couchbase-python-client | couchbase/admin.py | Admin.users_get | def users_get(self, domain):
"""
Retrieve a list of users from the server.
:param AuthDomain domain: The authentication domain to retrieve users from.
:return: :class:`~.HttpResult`. The list of users can be obtained from
the returned object's `value` property.
"""
... | python | def users_get(self, domain):
"""
Retrieve a list of users from the server.
:param AuthDomain domain: The authentication domain to retrieve users from.
:return: :class:`~.HttpResult`. The list of users can be obtained from
the returned object's `value` property.
"""
... | [
"def",
"users_get",
"(",
"self",
",",
"domain",
")",
":",
"path",
"=",
"self",
".",
"_get_management_path",
"(",
"domain",
")",
"return",
"self",
".",
"http_request",
"(",
"path",
"=",
"path",
",",
"method",
"=",
"'GET'",
")"
] | Retrieve a list of users from the server.
:param AuthDomain domain: The authentication domain to retrieve users from.
:return: :class:`~.HttpResult`. The list of users can be obtained from
the returned object's `value` property. | [
"Retrieve",
"a",
"list",
"of",
"users",
"from",
"the",
"server",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/admin.py#L347-L357 |
16,745 | couchbase/couchbase-python-client | couchbase/admin.py | Admin.user_get | def user_get(self, domain, userid):
"""
Retrieve a user from the server
:param AuthDomain domain: The authentication domain for the user.
:param userid: The user ID.
:raise: :exc:`couchbase.exceptions.HTTPError` if the user does not exist.
:return: :class:`~.HttpResult`.... | python | def user_get(self, domain, userid):
"""
Retrieve a user from the server
:param AuthDomain domain: The authentication domain for the user.
:param userid: The user ID.
:raise: :exc:`couchbase.exceptions.HTTPError` if the user does not exist.
:return: :class:`~.HttpResult`.... | [
"def",
"user_get",
"(",
"self",
",",
"domain",
",",
"userid",
")",
":",
"path",
"=",
"self",
".",
"_get_management_path",
"(",
"domain",
",",
"userid",
")",
"return",
"self",
".",
"http_request",
"(",
"path",
"=",
"path",
",",
"method",
"=",
"'GET'",
"... | Retrieve a user from the server
:param AuthDomain domain: The authentication domain for the user.
:param userid: The user ID.
:raise: :exc:`couchbase.exceptions.HTTPError` if the user does not exist.
:return: :class:`~.HttpResult`. The user can be obtained from the
returned ... | [
"Retrieve",
"a",
"user",
"from",
"the",
"server"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/admin.py#L359-L371 |
16,746 | couchbase/couchbase-python-client | couchbase/admin.py | Admin.user_upsert | def user_upsert(self, domain, userid, password=None, roles=None, name=None):
"""
Upsert a user in the cluster
:param AuthDomain domain: The authentication domain for the user.
:param userid: The user ID
:param password: The user password
:param roles: A list of roles. A ... | python | def user_upsert(self, domain, userid, password=None, roles=None, name=None):
"""
Upsert a user in the cluster
:param AuthDomain domain: The authentication domain for the user.
:param userid: The user ID
:param password: The user password
:param roles: A list of roles. A ... | [
"def",
"user_upsert",
"(",
"self",
",",
"domain",
",",
"userid",
",",
"password",
"=",
"None",
",",
"roles",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"roles",
"or",
"not",
"isinstance",
"(",
"roles",
",",
"list",
")",
":",
"rai... | Upsert a user in the cluster
:param AuthDomain domain: The authentication domain for the user.
:param userid: The user ID
:param password: The user password
:param roles: A list of roles. A role can either be a simple string,
or a list of `(role, bucket)` pairs.
:par... | [
"Upsert",
"a",
"user",
"in",
"the",
"cluster"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/admin.py#L373-L429 |
16,747 | couchbase/couchbase-python-client | couchbase/connstr.py | convert_1x_args | def convert_1x_args(bucket, **kwargs):
"""
Converts arguments for 1.x constructors to their 2.x forms
"""
host = kwargs.pop('host', 'localhost')
port = kwargs.pop('port', None)
if not 'connstr' in kwargs and 'connection_string' not in kwargs:
kwargs['connection_string'] = _build_connstr(... | python | def convert_1x_args(bucket, **kwargs):
"""
Converts arguments for 1.x constructors to their 2.x forms
"""
host = kwargs.pop('host', 'localhost')
port = kwargs.pop('port', None)
if not 'connstr' in kwargs and 'connection_string' not in kwargs:
kwargs['connection_string'] = _build_connstr(... | [
"def",
"convert_1x_args",
"(",
"bucket",
",",
"*",
"*",
"kwargs",
")",
":",
"host",
"=",
"kwargs",
".",
"pop",
"(",
"'host'",
",",
"'localhost'",
")",
"port",
"=",
"kwargs",
".",
"pop",
"(",
"'port'",
",",
"None",
")",
"if",
"not",
"'connstr'",
"in",... | Converts arguments for 1.x constructors to their 2.x forms | [
"Converts",
"arguments",
"for",
"1",
".",
"x",
"constructors",
"to",
"their",
"2",
".",
"x",
"forms"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/connstr.py#L173-L181 |
16,748 | couchbase/couchbase-python-client | couchbase/connstr.py | ConnectionString.parse | def parse(cls, ss):
"""
Parses an existing connection string
This method will return a :class:`~.ConnectionString` object
which will allow further inspection on the input parameters.
:param string ss: The existing connection string
:return: A new :class:`~.ConnectionStr... | python | def parse(cls, ss):
"""
Parses an existing connection string
This method will return a :class:`~.ConnectionString` object
which will allow further inspection on the input parameters.
:param string ss: The existing connection string
:return: A new :class:`~.ConnectionStr... | [
"def",
"parse",
"(",
"cls",
",",
"ss",
")",
":",
"up",
"=",
"urlparse",
"(",
"ss",
")",
"path",
"=",
"up",
".",
"path",
"query",
"=",
"up",
".",
"query",
"if",
"'?'",
"in",
"path",
":",
"path",
",",
"_",
"=",
"up",
".",
"path",
".",
"split",
... | Parses an existing connection string
This method will return a :class:`~.ConnectionString` object
which will allow further inspection on the input parameters.
:param string ss: The existing connection string
:return: A new :class:`~.ConnectionString` object | [
"Parses",
"an",
"existing",
"connection",
"string"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/connstr.py#L76-L101 |
16,749 | couchbase/couchbase-python-client | couchbase/connstr.py | ConnectionString.encode | def encode(self):
"""
Encodes the current state of the object into a string.
:return: The encoded string
"""
opt_dict = {}
for k, v in self.options.items():
opt_dict[k] = v[0]
ss = '{0}://{1}'.format(self.scheme, ','.join(self.hosts))
if self... | python | def encode(self):
"""
Encodes the current state of the object into a string.
:return: The encoded string
"""
opt_dict = {}
for k, v in self.options.items():
opt_dict[k] = v[0]
ss = '{0}://{1}'.format(self.scheme, ','.join(self.hosts))
if self... | [
"def",
"encode",
"(",
"self",
")",
":",
"opt_dict",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"self",
".",
"options",
".",
"items",
"(",
")",
":",
"opt_dict",
"[",
"k",
"]",
"=",
"v",
"[",
"0",
"]",
"ss",
"=",
"'{0}://{1}'",
".",
"format",
"... | Encodes the current state of the object into a string.
:return: The encoded string | [
"Encodes",
"the",
"current",
"state",
"of",
"the",
"object",
"into",
"a",
"string",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/connstr.py#L126-L143 |
16,750 | couchbase/couchbase-python-client | couchbase/exceptions.py | CouchbaseError.rc_to_exctype | def rc_to_exctype(cls, rc):
"""
Map an error code to an exception
:param int rc: The error code received for an operation
:return: a subclass of :class:`CouchbaseError`
"""
try:
return _LCB_ERRNO_MAP[rc]
except KeyError:
newcls = _mk_lcbe... | python | def rc_to_exctype(cls, rc):
"""
Map an error code to an exception
:param int rc: The error code received for an operation
:return: a subclass of :class:`CouchbaseError`
"""
try:
return _LCB_ERRNO_MAP[rc]
except KeyError:
newcls = _mk_lcbe... | [
"def",
"rc_to_exctype",
"(",
"cls",
",",
"rc",
")",
":",
"try",
":",
"return",
"_LCB_ERRNO_MAP",
"[",
"rc",
"]",
"except",
"KeyError",
":",
"newcls",
"=",
"_mk_lcberr",
"(",
"rc",
")",
"_LCB_ERRNO_MAP",
"[",
"rc",
"]",
"=",
"newcls",
"return",
"newcls"
] | Map an error code to an exception
:param int rc: The error code received for an operation
:return: a subclass of :class:`CouchbaseError` | [
"Map",
"an",
"error",
"code",
"to",
"an",
"exception"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/exceptions.py#L91-L104 |
16,751 | couchbase/couchbase-python-client | couchbase/exceptions.py | CouchbaseError.split_results | def split_results(self):
"""
Convenience method to separate failed and successful results.
.. versionadded:: 2.0.0
This function will split the results of the failed operation
(see :attr:`.all_results`) into "good" and "bad" dictionaries.
The intent is for the applicat... | python | def split_results(self):
"""
Convenience method to separate failed and successful results.
.. versionadded:: 2.0.0
This function will split the results of the failed operation
(see :attr:`.all_results`) into "good" and "bad" dictionaries.
The intent is for the applicat... | [
"def",
"split_results",
"(",
"self",
")",
":",
"ret_ok",
",",
"ret_fail",
"=",
"{",
"}",
",",
"{",
"}",
"count",
"=",
"0",
"nokey_prefix",
"=",
"(",
"[",
"\"\"",
"]",
"+",
"sorted",
"(",
"filter",
"(",
"bool",
",",
"self",
".",
"all_results",
".",
... | Convenience method to separate failed and successful results.
.. versionadded:: 2.0.0
This function will split the results of the failed operation
(see :attr:`.all_results`) into "good" and "bad" dictionaries.
The intent is for the application to handle any successful
results ... | [
"Convenience",
"method",
"to",
"separate",
"failed",
"and",
"successful",
"results",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/exceptions.py#L162-L209 |
16,752 | couchbase/couchbase-python-client | couchbase/items.py | ItemOptionDict.add | def add(self, itm, **options):
"""
Convenience method to add an item together with a series of options.
:param itm: The item to add
:param options: keyword arguments which will be placed in the item's
option entry.
If the item already exists, it (and its options) wi... | python | def add(self, itm, **options):
"""
Convenience method to add an item together with a series of options.
:param itm: The item to add
:param options: keyword arguments which will be placed in the item's
option entry.
If the item already exists, it (and its options) wi... | [
"def",
"add",
"(",
"self",
",",
"itm",
",",
"*",
"*",
"options",
")",
":",
"if",
"not",
"options",
":",
"options",
"=",
"None",
"self",
".",
"_d",
"[",
"itm",
"]",
"=",
"options"
] | Convenience method to add an item together with a series of options.
:param itm: The item to add
:param options: keyword arguments which will be placed in the item's
option entry.
If the item already exists, it (and its options) will be overidden. Use
:attr:`dict` instead t... | [
"Convenience",
"method",
"to",
"add",
"an",
"item",
"together",
"with",
"a",
"series",
"of",
"options",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/items.py#L144-L158 |
16,753 | couchbase/couchbase-python-client | couchbase/deprecation.py | deprecate_module_attribute | def deprecate_module_attribute(mod, deprecated):
"""Return a wrapped object that warns about deprecated accesses"""
deprecated = set(deprecated)
class Wrapper(object):
def __getattr__(self, attr):
if attr in deprecated:
warnings.warn("Property %s is deprecated" % attr)
... | python | def deprecate_module_attribute(mod, deprecated):
"""Return a wrapped object that warns about deprecated accesses"""
deprecated = set(deprecated)
class Wrapper(object):
def __getattr__(self, attr):
if attr in deprecated:
warnings.warn("Property %s is deprecated" % attr)
... | [
"def",
"deprecate_module_attribute",
"(",
"mod",
",",
"deprecated",
")",
":",
"deprecated",
"=",
"set",
"(",
"deprecated",
")",
"class",
"Wrapper",
"(",
"object",
")",
":",
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
"in",
"de... | Return a wrapped object that warns about deprecated accesses | [
"Return",
"a",
"wrapped",
"object",
"that",
"warns",
"about",
"deprecated",
"accesses"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/deprecation.py#L4-L19 |
16,754 | couchbase/couchbase-python-client | couchbase/result.py | SubdocResult.get | def get(self, path_or_index, default=None):
"""
Get details about a given result
:param path_or_index: The path (or index) of the result to fetch.
:param default: If the given result does not exist, return this value
instead
:return: A tuple of `(error, value)`. If t... | python | def get(self, path_or_index, default=None):
"""
Get details about a given result
:param path_or_index: The path (or index) of the result to fetch.
:param default: If the given result does not exist, return this value
instead
:return: A tuple of `(error, value)`. If t... | [
"def",
"get",
"(",
"self",
",",
"path_or_index",
",",
"default",
"=",
"None",
")",
":",
"err",
",",
"value",
"=",
"self",
".",
"_resolve",
"(",
"path_or_index",
")",
"value",
"=",
"default",
"if",
"err",
"else",
"value",
"return",
"err",
",",
"value"
] | Get details about a given result
:param path_or_index: The path (or index) of the result to fetch.
:param default: If the given result does not exist, return this value
instead
:return: A tuple of `(error, value)`. If the entry does not exist
then `(err, default)` is ret... | [
"Get",
"details",
"about",
"a",
"given",
"result"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/result.py#L115-L133 |
16,755 | couchbase/couchbase-python-client | couchbase/asynchronous/bucket.py | AsyncBucket.query | def query(self, *args, **kwargs):
"""
Reimplemented from base class.
This method does not add additional functionality of the
base class' :meth:`~couchbase.bucket.Bucket.query` method (all the
functionality is encapsulated in the view class anyway). However it
does requi... | python | def query(self, *args, **kwargs):
"""
Reimplemented from base class.
This method does not add additional functionality of the
base class' :meth:`~couchbase.bucket.Bucket.query` method (all the
functionality is encapsulated in the view class anyway). However it
does requi... | [
"def",
"query",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"issubclass",
"(",
"kwargs",
".",
"get",
"(",
"'itercls'",
",",
"None",
")",
",",
"AsyncViewBase",
")",
":",
"raise",
"ArgumentError",
".",
"pyexc",
"(",
... | Reimplemented from base class.
This method does not add additional functionality of the
base class' :meth:`~couchbase.bucket.Bucket.query` method (all the
functionality is encapsulated in the view class anyway). However it
does require one additional keyword argument
:param cla... | [
"Reimplemented",
"from",
"base",
"class",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/asynchronous/bucket.py#L154-L171 |
16,756 | couchbase/couchbase-python-client | couchbase/subdocument.py | _gen_3spec | def _gen_3spec(op, path, xattr=False):
"""
Returns a Spec tuple suitable for passing to the underlying C extension.
This variant is called for operations that lack an input value.
:param str path: The path to fetch
:param bool xattr: Whether this is an extended attribute
:return: a spec suitabl... | python | def _gen_3spec(op, path, xattr=False):
"""
Returns a Spec tuple suitable for passing to the underlying C extension.
This variant is called for operations that lack an input value.
:param str path: The path to fetch
:param bool xattr: Whether this is an extended attribute
:return: a spec suitabl... | [
"def",
"_gen_3spec",
"(",
"op",
",",
"path",
",",
"xattr",
"=",
"False",
")",
":",
"flags",
"=",
"0",
"if",
"xattr",
":",
"flags",
"|=",
"_P",
".",
"SDSPEC_F_XATTR",
"return",
"Spec",
"(",
"op",
",",
"path",
",",
"flags",
")"
] | Returns a Spec tuple suitable for passing to the underlying C extension.
This variant is called for operations that lack an input value.
:param str path: The path to fetch
:param bool xattr: Whether this is an extended attribute
:return: a spec suitable for passing to the underlying C extension | [
"Returns",
"a",
"Spec",
"tuple",
"suitable",
"for",
"passing",
"to",
"the",
"underlying",
"C",
"extension",
".",
"This",
"variant",
"is",
"called",
"for",
"operations",
"that",
"lack",
"an",
"input",
"value",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/subdocument.py#L34-L46 |
16,757 | couchbase/couchbase-python-client | couchbase/subdocument.py | upsert | def upsert(path, value, create_parents=False, **kwargs):
"""
Create or replace a dictionary path.
:param path: The path to modify
:param value: The new value for the path. This should be a native Python
object which can be encoded into JSON (the SDK will do the encoding
for you).
:p... | python | def upsert(path, value, create_parents=False, **kwargs):
"""
Create or replace a dictionary path.
:param path: The path to modify
:param value: The new value for the path. This should be a native Python
object which can be encoded into JSON (the SDK will do the encoding
for you).
:p... | [
"def",
"upsert",
"(",
"path",
",",
"value",
",",
"create_parents",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gen_4spec",
"(",
"LCB_SDCMD_DICT_UPSERT",
",",
"path",
",",
"value",
",",
"create_path",
"=",
"create_parents",
",",
"*",
"*",
... | Create or replace a dictionary path.
:param path: The path to modify
:param value: The new value for the path. This should be a native Python
object which can be encoded into JSON (the SDK will do the encoding
for you).
:param create_parents: Whether intermediate parents should be created.
... | [
"Create",
"or",
"replace",
"a",
"dictionary",
"path",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/subdocument.py#L100-L129 |
16,758 | couchbase/couchbase-python-client | couchbase/subdocument.py | array_append | def array_append(path, *values, **kwargs):
"""
Add new values to the end of an array.
:param path: Path to the array. The path should contain the *array itself*
and not an element *within* the array
:param values: one or more values to append
:param create_parents: Create the array if it do... | python | def array_append(path, *values, **kwargs):
"""
Add new values to the end of an array.
:param path: Path to the array. The path should contain the *array itself*
and not an element *within* the array
:param values: one or more values to append
:param create_parents: Create the array if it do... | [
"def",
"array_append",
"(",
"path",
",",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gen_4spec",
"(",
"LCB_SDCMD_ARRAY_ADD_LAST",
",",
"path",
",",
"MultiValue",
"(",
"*",
"values",
")",
",",
"create_path",
"=",
"kwargs",
".",
"pop",
"(... | Add new values to the end of an array.
:param path: Path to the array. The path should contain the *array itself*
and not an element *within* the array
:param values: one or more values to append
:param create_parents: Create the array if it does not exist
.. note::
Specifying multipl... | [
"Add",
"new",
"values",
"to",
"the",
"end",
"of",
"an",
"array",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/subdocument.py#L157-L181 |
16,759 | couchbase/couchbase-python-client | couchbase/subdocument.py | array_prepend | def array_prepend(path, *values, **kwargs):
"""
Add new values to the beginning of an array.
:param path: Path to the array. The path should contain the *array itself*
and not an element *within* the array
:param values: one or more values to append
:param create_parents: Create the array i... | python | def array_prepend(path, *values, **kwargs):
"""
Add new values to the beginning of an array.
:param path: Path to the array. The path should contain the *array itself*
and not an element *within* the array
:param values: one or more values to append
:param create_parents: Create the array i... | [
"def",
"array_prepend",
"(",
"path",
",",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gen_4spec",
"(",
"LCB_SDCMD_ARRAY_ADD_FIRST",
",",
"path",
",",
"MultiValue",
"(",
"*",
"values",
")",
",",
"create_path",
"=",
"kwargs",
".",
"pop",
... | Add new values to the beginning of an array.
:param path: Path to the array. The path should contain the *array itself*
and not an element *within* the array
:param values: one or more values to append
:param create_parents: Create the array if it does not exist
This operation is only valid in... | [
"Add",
"new",
"values",
"to",
"the",
"beginning",
"of",
"an",
"array",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/subdocument.py#L184-L200 |
16,760 | couchbase/couchbase-python-client | couchbase/subdocument.py | array_insert | def array_insert(path, *values, **kwargs):
"""
Insert items at a given position within an array.
:param path: The path indicating where the item should be placed. The path
_should_ contain the desired position
:param values: Values to insert
This operation is only valid in :cb_bmeth:`mutat... | python | def array_insert(path, *values, **kwargs):
"""
Insert items at a given position within an array.
:param path: The path indicating where the item should be placed. The path
_should_ contain the desired position
:param values: Values to insert
This operation is only valid in :cb_bmeth:`mutat... | [
"def",
"array_insert",
"(",
"path",
",",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gen_4spec",
"(",
"LCB_SDCMD_ARRAY_INSERT",
",",
"path",
",",
"MultiValue",
"(",
"*",
"values",
")",
",",
"*",
"*",
"kwargs",
")"
] | Insert items at a given position within an array.
:param path: The path indicating where the item should be placed. The path
_should_ contain the desired position
:param values: Values to insert
This operation is only valid in :cb_bmeth:`mutate_in`.
.. seealso:: :func:`array_prepend`, :func:`... | [
"Insert",
"items",
"at",
"a",
"given",
"position",
"within",
"an",
"array",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/subdocument.py#L203-L216 |
16,761 | couchbase/couchbase-python-client | couchbase/subdocument.py | array_addunique | def array_addunique(path, value, create_parents=False, **kwargs):
"""
Add a new value to an array if the value does not exist.
:param path: The path to the array
:param value: Value to add to the array if it does not exist.
Currently the value is restricted to primitives: strings, numbers,
... | python | def array_addunique(path, value, create_parents=False, **kwargs):
"""
Add a new value to an array if the value does not exist.
:param path: The path to the array
:param value: Value to add to the array if it does not exist.
Currently the value is restricted to primitives: strings, numbers,
... | [
"def",
"array_addunique",
"(",
"path",
",",
"value",
",",
"create_parents",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gen_4spec",
"(",
"LCB_SDCMD_ARRAY_ADD_UNIQUE",
",",
"path",
",",
"value",
",",
"create_path",
"=",
"create_parents",
",",
... | Add a new value to an array if the value does not exist.
:param path: The path to the array
:param value: Value to add to the array if it does not exist.
Currently the value is restricted to primitives: strings, numbers,
booleans, and `None` values.
:param create_parents: Create the array i... | [
"Add",
"a",
"new",
"value",
"to",
"an",
"array",
"if",
"the",
"value",
"does",
"not",
"exist",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/subdocument.py#L219-L240 |
16,762 | couchbase/couchbase-python-client | couchbase/subdocument.py | counter | def counter(path, delta, create_parents=False, **kwargs):
"""
Increment or decrement a counter in a document.
:param path: Path to the counter
:param delta: Amount by which to modify the value. The delta
can be negative but not 0. It must be an integer (not a float)
as well.
:param ... | python | def counter(path, delta, create_parents=False, **kwargs):
"""
Increment or decrement a counter in a document.
:param path: Path to the counter
:param delta: Amount by which to modify the value. The delta
can be negative but not 0. It must be an integer (not a float)
as well.
:param ... | [
"def",
"counter",
"(",
"path",
",",
"delta",
",",
"create_parents",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"delta",
":",
"raise",
"ValueError",
"(",
"\"Delta must be positive or negative!\"",
")",
"return",
"_gen_4spec",
"(",
"LCB_SDCMD_... | Increment or decrement a counter in a document.
:param path: Path to the counter
:param delta: Amount by which to modify the value. The delta
can be negative but not 0. It must be an integer (not a float)
as well.
:param create_parents: Create the counter (and apply the modification) if it
... | [
"Increment",
"or",
"decrement",
"a",
"counter",
"in",
"a",
"document",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/subdocument.py#L243-L268 |
16,763 | couchbase/couchbase-python-client | couchbase/mutation_state.py | MutationState.add_results | def add_results(self, *rvs, **kwargs):
"""
Changes the state to reflect the mutation which yielded the given
result.
In order to use the result, the `fetch_mutation_tokens` option must
have been specified in the connection string, _and_ the result
must have been successf... | python | def add_results(self, *rvs, **kwargs):
"""
Changes the state to reflect the mutation which yielded the given
result.
In order to use the result, the `fetch_mutation_tokens` option must
have been specified in the connection string, _and_ the result
must have been successf... | [
"def",
"add_results",
"(",
"self",
",",
"*",
"rvs",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"rvs",
":",
"raise",
"MissingTokenError",
".",
"pyexc",
"(",
"message",
"=",
"'No results passed'",
")",
"for",
"rv",
"in",
"rvs",
":",
"mi",
"=",
"rv... | Changes the state to reflect the mutation which yielded the given
result.
In order to use the result, the `fetch_mutation_tokens` option must
have been specified in the connection string, _and_ the result
must have been successful.
:param rvs: One or more :class:`~.OperationRes... | [
"Changes",
"the",
"state",
"to",
"reflect",
"the",
"mutation",
"which",
"yielded",
"the",
"given",
"result",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/mutation_state.py#L111-L139 |
16,764 | couchbase/couchbase-python-client | couchbase/mutation_state.py | MutationState.add_all | def add_all(self, bucket, quiet=False):
"""
Ensures the query result is consistent with all prior
mutations performed by a given bucket.
Using this function is equivalent to keeping track of all
mutations performed by the given bucket, and passing them to
:meth:`~add_res... | python | def add_all(self, bucket, quiet=False):
"""
Ensures the query result is consistent with all prior
mutations performed by a given bucket.
Using this function is equivalent to keeping track of all
mutations performed by the given bucket, and passing them to
:meth:`~add_res... | [
"def",
"add_all",
"(",
"self",
",",
"bucket",
",",
"quiet",
"=",
"False",
")",
":",
"added",
"=",
"False",
"for",
"mt",
"in",
"bucket",
".",
"_mutinfo",
"(",
")",
":",
"added",
"=",
"True",
"self",
".",
"_add_scanvec",
"(",
"mt",
")",
"if",
"not",
... | Ensures the query result is consistent with all prior
mutations performed by a given bucket.
Using this function is equivalent to keeping track of all
mutations performed by the given bucket, and passing them to
:meth:`~add_result`
:param bucket: A :class:`~couchbase.bucket.Buc... | [
"Ensures",
"the",
"query",
"result",
"is",
"consistent",
"with",
"all",
"prior",
"mutations",
"performed",
"by",
"a",
"given",
"bucket",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/mutation_state.py#L141-L165 |
16,765 | couchbase/couchbase-python-client | couchbase/fulltext.py | _assign_kwargs | def _assign_kwargs(self, kwargs):
"""
Assigns all keyword arguments to a given instance, raising an exception
if one of the keywords is not already the name of a property.
"""
for k in kwargs:
if not hasattr(self, k):
raise AttributeError(k, 'Not valid for', self.__class__.__name... | python | def _assign_kwargs(self, kwargs):
"""
Assigns all keyword arguments to a given instance, raising an exception
if one of the keywords is not already the name of a property.
"""
for k in kwargs:
if not hasattr(self, k):
raise AttributeError(k, 'Not valid for', self.__class__.__name... | [
"def",
"_assign_kwargs",
"(",
"self",
",",
"kwargs",
")",
":",
"for",
"k",
"in",
"kwargs",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"k",
")",
":",
"raise",
"AttributeError",
"(",
"k",
",",
"'Not valid for'",
",",
"self",
".",
"__class__",
".",
... | Assigns all keyword arguments to a given instance, raising an exception
if one of the keywords is not already the name of a property. | [
"Assigns",
"all",
"keyword",
"arguments",
"to",
"a",
"given",
"instance",
"raising",
"an",
"exception",
"if",
"one",
"of",
"the",
"keywords",
"is",
"not",
"already",
"the",
"name",
"of",
"a",
"property",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/fulltext.py#L86-L94 |
16,766 | couchbase/couchbase-python-client | couchbase/fulltext.py | _mk_range_bucket | def _mk_range_bucket(name, n1, n2, r1, r2):
"""
Create a named range specification for encoding.
:param name: The name of the range as it should appear in the result
:param n1: The name of the lower bound of the range specifier
:param n2: The name of the upper bound of the range specified
:para... | python | def _mk_range_bucket(name, n1, n2, r1, r2):
"""
Create a named range specification for encoding.
:param name: The name of the range as it should appear in the result
:param n1: The name of the lower bound of the range specifier
:param n2: The name of the upper bound of the range specified
:para... | [
"def",
"_mk_range_bucket",
"(",
"name",
",",
"n1",
",",
"n2",
",",
"r1",
",",
"r2",
")",
":",
"d",
"=",
"{",
"}",
"if",
"r1",
"is",
"not",
"None",
":",
"d",
"[",
"n1",
"]",
"=",
"r1",
"if",
"r2",
"is",
"not",
"None",
":",
"d",
"[",
"n2",
... | Create a named range specification for encoding.
:param name: The name of the range as it should appear in the result
:param n1: The name of the lower bound of the range specifier
:param n2: The name of the upper bound of the range specified
:param r1: The value of the lower bound (user value)
:par... | [
"Create",
"a",
"named",
"range",
"specification",
"for",
"encoding",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/fulltext.py#L133-L157 |
16,767 | couchbase/couchbase-python-client | couchbase/fulltext.py | DateFacet.add_range | def add_range(self, name, start=None, end=None):
"""
Adds a date range to the given facet.
:param str name:
The name by which the results within the range can be accessed
:param str start: Lower date range. Should be in RFC 3339 format
:param str end: Upper date rang... | python | def add_range(self, name, start=None, end=None):
"""
Adds a date range to the given facet.
:param str name:
The name by which the results within the range can be accessed
:param str start: Lower date range. Should be in RFC 3339 format
:param str end: Upper date rang... | [
"def",
"add_range",
"(",
"self",
",",
"name",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
")",
":",
"self",
".",
"_ranges",
".",
"append",
"(",
"_mk_range_bucket",
"(",
"name",
",",
"'start'",
",",
"'end'",
",",
"start",
",",
"end",
")",
")... | Adds a date range to the given facet.
:param str name:
The name by which the results within the range can be accessed
:param str start: Lower date range. Should be in RFC 3339 format
:param str end: Upper date range.
:return: The `DateFacet` object, so calls to this method m... | [
"Adds",
"a",
"date",
"range",
"to",
"the",
"given",
"facet",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/fulltext.py#L170-L182 |
16,768 | couchbase/couchbase-python-client | couchbase/fulltext.py | NumericFacet.add_range | def add_range(self, name, min=None, max=None):
"""
Add a numeric range.
:param str name:
the name by which the range is accessed in the results
:param int | float min: Lower range bound
:param int | float max: Upper range bound
:return: This object; suitable ... | python | def add_range(self, name, min=None, max=None):
"""
Add a numeric range.
:param str name:
the name by which the range is accessed in the results
:param int | float min: Lower range bound
:param int | float max: Upper range bound
:return: This object; suitable ... | [
"def",
"add_range",
"(",
"self",
",",
"name",
",",
"min",
"=",
"None",
",",
"max",
"=",
"None",
")",
":",
"self",
".",
"_ranges",
".",
"append",
"(",
"_mk_range_bucket",
"(",
"name",
",",
"'min'",
",",
"'max'",
",",
"min",
",",
"max",
")",
")",
"... | Add a numeric range.
:param str name:
the name by which the range is accessed in the results
:param int | float min: Lower range bound
:param int | float max: Upper range bound
:return: This object; suitable for method chaining | [
"Add",
"a",
"numeric",
"range",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/fulltext.py#L197-L208 |
16,769 | couchbase/couchbase-python-client | couchbase/fulltext.py | SearchRequest.mk_kwargs | def mk_kwargs(cls, kwargs):
"""
Pop recognized arguments from a keyword list.
"""
ret = {}
kws = ['row_factory', 'body', 'parent']
for k in kws:
if k in kwargs:
ret[k] = kwargs.pop(k)
return ret | python | def mk_kwargs(cls, kwargs):
"""
Pop recognized arguments from a keyword list.
"""
ret = {}
kws = ['row_factory', 'body', 'parent']
for k in kws:
if k in kwargs:
ret[k] = kwargs.pop(k)
return ret | [
"def",
"mk_kwargs",
"(",
"cls",
",",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"kws",
"=",
"[",
"'row_factory'",
",",
"'body'",
",",
"'parent'",
"]",
"for",
"k",
"in",
"kws",
":",
"if",
"k",
"in",
"kwargs",
":",
"ret",
"[",
"k",
"]",
"=",
"kwar... | Pop recognized arguments from a keyword list. | [
"Pop",
"recognized",
"arguments",
"from",
"a",
"keyword",
"list",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/fulltext.py#L1115-L1125 |
16,770 | couchbase/couchbase-python-client | couchbase/n1ql.py | N1QLQuery._set_named_args | def _set_named_args(self, **kv):
"""
Set a named parameter in the query. The named field must
exist in the query itself.
:param kv: Key-Value pairs representing values within the
query. These values should be stripped of their leading
`$` identifier.
"""... | python | def _set_named_args(self, **kv):
"""
Set a named parameter in the query. The named field must
exist in the query itself.
:param kv: Key-Value pairs representing values within the
query. These values should be stripped of their leading
`$` identifier.
"""... | [
"def",
"_set_named_args",
"(",
"self",
",",
"*",
"*",
"kv",
")",
":",
"for",
"k",
"in",
"kv",
":",
"self",
".",
"_body",
"[",
"'${0}'",
".",
"format",
"(",
"k",
")",
"]",
"=",
"kv",
"[",
"k",
"]",
"return",
"self"
] | Set a named parameter in the query. The named field must
exist in the query itself.
:param kv: Key-Value pairs representing values within the
query. These values should be stripped of their leading
`$` identifier. | [
"Set",
"a",
"named",
"parameter",
"in",
"the",
"query",
".",
"The",
"named",
"field",
"must",
"exist",
"in",
"the",
"query",
"itself",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/n1ql.py#L134-L146 |
16,771 | couchbase/couchbase-python-client | couchbase/n1ql.py | N1QLQuery.consistent_with | def consistent_with(self, state):
"""
Indicate that the query should be consistent with one or more
mutations.
:param state: The state of the mutations it should be consistent
with.
:type state: :class:`~.couchbase.mutation_state.MutationState`
"""
if... | python | def consistent_with(self, state):
"""
Indicate that the query should be consistent with one or more
mutations.
:param state: The state of the mutations it should be consistent
with.
:type state: :class:`~.couchbase.mutation_state.MutationState`
"""
if... | [
"def",
"consistent_with",
"(",
"self",
",",
"state",
")",
":",
"if",
"self",
".",
"consistency",
"not",
"in",
"(",
"UNBOUNDED",
",",
"NOT_BOUNDED",
",",
"'at_plus'",
")",
":",
"raise",
"TypeError",
"(",
"'consistent_with not valid with other consistency options'",
... | Indicate that the query should be consistent with one or more
mutations.
:param state: The state of the mutations it should be consistent
with.
:type state: :class:`~.couchbase.mutation_state.MutationState` | [
"Indicate",
"that",
"the",
"query",
"should",
"be",
"consistent",
"with",
"one",
"or",
"more",
"mutations",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/n1ql.py#L194-L210 |
16,772 | couchbase/couchbase-python-client | couchbase/n1ql.py | N1QLQuery.timeout | def timeout(self):
"""
Optional per-query timeout. If set, this will limit the amount
of time in which the query can be executed and waited for.
.. note::
The effective timeout for the query will be either this property
or the value of :attr:`couchbase.bucket.Bu... | python | def timeout(self):
"""
Optional per-query timeout. If set, this will limit the amount
of time in which the query can be executed and waited for.
.. note::
The effective timeout for the query will be either this property
or the value of :attr:`couchbase.bucket.Bu... | [
"def",
"timeout",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"_body",
".",
"get",
"(",
"'timeout'",
",",
"'0s'",
")",
"value",
"=",
"value",
"[",
":",
"-",
"1",
"]",
"return",
"float",
"(",
"value",
")"
] | Optional per-query timeout. If set, this will limit the amount
of time in which the query can be executed and waited for.
.. note::
The effective timeout for the query will be either this property
or the value of :attr:`couchbase.bucket.Bucket.n1ql_timeout`
property... | [
"Optional",
"per",
"-",
"query",
"timeout",
".",
"If",
"set",
"this",
"will",
"limit",
"the",
"amount",
"of",
"time",
"in",
"which",
"the",
"query",
"can",
"be",
"executed",
"and",
"waited",
"for",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/n1ql.py#L247-L262 |
16,773 | couchbase/couchbase-python-client | couchbase/analytics.py | DeferredAnalyticsRequest._is_ready | def _is_ready(self):
"""
Return True if and only if final result has been received, optionally blocking
until this is the case, or the timeout is exceeded.
This is a synchronous implementation but an async one can
be added by subclassing this.
:return: True if ready, Fa... | python | def _is_ready(self):
"""
Return True if and only if final result has been received, optionally blocking
until this is the case, or the timeout is exceeded.
This is a synchronous implementation but an async one can
be added by subclassing this.
:return: True if ready, Fa... | [
"def",
"_is_ready",
"(",
"self",
")",
":",
"while",
"not",
"self",
".",
"finish_time",
"or",
"time",
".",
"time",
"(",
")",
"<",
"self",
".",
"finish_time",
":",
"result",
"=",
"self",
".",
"_poll_deferred",
"(",
")",
"if",
"result",
"==",
"'success'",... | Return True if and only if final result has been received, optionally blocking
until this is the case, or the timeout is exceeded.
This is a synchronous implementation but an async one can
be added by subclassing this.
:return: True if ready, False if not | [
"Return",
"True",
"if",
"and",
"only",
"if",
"final",
"result",
"has",
"been",
"received",
"optionally",
"blocking",
"until",
"this",
"is",
"the",
"case",
"or",
"the",
"timeout",
"is",
"exceeded",
"."
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase/analytics.py#L199-L217 |
16,774 | couchbase/couchbase-python-client | couchbase_version.py | VersionInfo.package_version | def package_version(self):
"""Returns the well formed PEP-440 version"""
vbase = self.base_version
if self.ncommits:
vbase += '.dev{0}+{1}'.format(self.ncommits, self.sha)
return vbase | python | def package_version(self):
"""Returns the well formed PEP-440 version"""
vbase = self.base_version
if self.ncommits:
vbase += '.dev{0}+{1}'.format(self.ncommits, self.sha)
return vbase | [
"def",
"package_version",
"(",
"self",
")",
":",
"vbase",
"=",
"self",
".",
"base_version",
"if",
"self",
".",
"ncommits",
":",
"vbase",
"+=",
"'.dev{0}+{1}'",
".",
"format",
"(",
"self",
".",
"ncommits",
",",
"self",
".",
"sha",
")",
"return",
"vbase"
] | Returns the well formed PEP-440 version | [
"Returns",
"the",
"well",
"formed",
"PEP",
"-",
"440",
"version"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/couchbase_version.py#L76-L81 |
16,775 | couchbase/couchbase-python-client | jenkins/pycbc-winbuild.py | download_and_bootstrap | def download_and_bootstrap(src, name, prereq=None):
"""
Download and install something if 'prerequisite' fails
"""
if prereq:
prereq_cmd = '{0} -c "{1}"'.format(PY_EXE, prereq)
rv = os.system(prereq_cmd)
if rv == 0:
return
ulp = urllib2.urlopen(src)
fp = open... | python | def download_and_bootstrap(src, name, prereq=None):
"""
Download and install something if 'prerequisite' fails
"""
if prereq:
prereq_cmd = '{0} -c "{1}"'.format(PY_EXE, prereq)
rv = os.system(prereq_cmd)
if rv == 0:
return
ulp = urllib2.urlopen(src)
fp = open... | [
"def",
"download_and_bootstrap",
"(",
"src",
",",
"name",
",",
"prereq",
"=",
"None",
")",
":",
"if",
"prereq",
":",
"prereq_cmd",
"=",
"'{0} -c \"{1}\"'",
".",
"format",
"(",
"PY_EXE",
",",
"prereq",
")",
"rv",
"=",
"os",
".",
"system",
"(",
"prereq_cmd... | Download and install something if 'prerequisite' fails | [
"Download",
"and",
"install",
"something",
"if",
"prerequisite",
"fails"
] | a7bada167785bf79a29c39f820d932a433a6a535 | https://github.com/couchbase/couchbase-python-client/blob/a7bada167785bf79a29c39f820d932a433a6a535/jenkins/pycbc-winbuild.py#L165-L181 |
16,776 | zheller/flake8-quotes | flake8_quotes/__init__.py | QuoteChecker._register_opt | def _register_opt(parser, *args, **kwargs):
"""
Handler to register an option for both Flake8 3.x and 2.x.
This is based on:
https://github.com/PyCQA/flake8/blob/3.0.0b2/docs/source/plugin-development/cross-compatibility.rst#option-handling-on-flake8-2-and-3
It only supports `p... | python | def _register_opt(parser, *args, **kwargs):
"""
Handler to register an option for both Flake8 3.x and 2.x.
This is based on:
https://github.com/PyCQA/flake8/blob/3.0.0b2/docs/source/plugin-development/cross-compatibility.rst#option-handling-on-flake8-2-and-3
It only supports `p... | [
"def",
"_register_opt",
"(",
"parser",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"# Flake8 3.x registration",
"parser",
".",
"add_option",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"(",
"optparse",
".",
"OptionError... | Handler to register an option for both Flake8 3.x and 2.x.
This is based on:
https://github.com/PyCQA/flake8/blob/3.0.0b2/docs/source/plugin-development/cross-compatibility.rst#option-handling-on-flake8-2-and-3
It only supports `parse_from_config` from the original function and it
uses... | [
"Handler",
"to",
"register",
"an",
"option",
"for",
"both",
"Flake8",
"3",
".",
"x",
"and",
"2",
".",
"x",
"."
] | 4afe69da02b89232cb71c57aafd384214a45a145 | https://github.com/zheller/flake8-quotes/blob/4afe69da02b89232cb71c57aafd384214a45a145/flake8_quotes/__init__.py#L78-L96 |
16,777 | eventbrite/pysoa | pysoa/utils.py | dict_to_hashable | def dict_to_hashable(d):
"""
Takes a dict and returns an immutable, hashable version of that dict that can be used as a key in dicts or as a
set value. Any two dicts passed in with the same content are guaranteed to return the same value. Any two dicts
passed in with different content are guaranteed to ... | python | def dict_to_hashable(d):
"""
Takes a dict and returns an immutable, hashable version of that dict that can be used as a key in dicts or as a
set value. Any two dicts passed in with the same content are guaranteed to return the same value. Any two dicts
passed in with different content are guaranteed to ... | [
"def",
"dict_to_hashable",
"(",
"d",
")",
":",
"return",
"frozenset",
"(",
"(",
"k",
",",
"tuple",
"(",
"v",
")",
"if",
"isinstance",
"(",
"v",
",",
"list",
")",
"else",
"(",
"dict_to_hashable",
"(",
"v",
")",
"if",
"isinstance",
"(",
"v",
",",
"di... | Takes a dict and returns an immutable, hashable version of that dict that can be used as a key in dicts or as a
set value. Any two dicts passed in with the same content are guaranteed to return the same value. Any two dicts
passed in with different content are guaranteed to return different values. Performs com... | [
"Takes",
"a",
"dict",
"and",
"returns",
"an",
"immutable",
"hashable",
"version",
"of",
"that",
"dict",
"that",
"can",
"be",
"used",
"as",
"a",
"key",
"in",
"dicts",
"or",
"as",
"a",
"set",
"value",
".",
"Any",
"two",
"dicts",
"passed",
"in",
"with",
... | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/utils.py#L12-L32 |
16,778 | eventbrite/pysoa | pysoa/server/action/introspection.py | IntrospectionAction.run | def run(self, request):
"""
Introspects all of the actions on the server and returns their documentation.
:param request: The request object
:type request: EnrichedActionRequest
:return: The response
"""
if request.body.get('action_name'):
return sel... | python | def run(self, request):
"""
Introspects all of the actions on the server and returns their documentation.
:param request: The request object
:type request: EnrichedActionRequest
:return: The response
"""
if request.body.get('action_name'):
return sel... | [
"def",
"run",
"(",
"self",
",",
"request",
")",
":",
"if",
"request",
".",
"body",
".",
"get",
"(",
"'action_name'",
")",
":",
"return",
"self",
".",
"_get_response_for_single_action",
"(",
"request",
".",
"body",
".",
"get",
"(",
"'action_name'",
")",
"... | Introspects all of the actions on the server and returns their documentation.
:param request: The request object
:type request: EnrichedActionRequest
:return: The response | [
"Introspects",
"all",
"of",
"the",
"actions",
"on",
"the",
"server",
"and",
"returns",
"their",
"documentation",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/action/introspection.py#L118-L130 |
16,779 | eventbrite/pysoa | pysoa/client/client.py | ServiceHandler._make_middleware_stack | def _make_middleware_stack(middleware, base):
"""
Given a list of in-order middleware callables `middleware`
and a base function `base`, chains them together so each middleware is
fed the function below, and returns the top level ready to call.
"""
for ware in reversed(mi... | python | def _make_middleware_stack(middleware, base):
"""
Given a list of in-order middleware callables `middleware`
and a base function `base`, chains them together so each middleware is
fed the function below, and returns the top level ready to call.
"""
for ware in reversed(mi... | [
"def",
"_make_middleware_stack",
"(",
"middleware",
",",
"base",
")",
":",
"for",
"ware",
"in",
"reversed",
"(",
"middleware",
")",
":",
"base",
"=",
"ware",
"(",
"base",
")",
"return",
"base"
] | Given a list of in-order middleware callables `middleware`
and a base function `base`, chains them together so each middleware is
fed the function below, and returns the top level ready to call. | [
"Given",
"a",
"list",
"of",
"in",
"-",
"order",
"middleware",
"callables",
"middleware",
"and",
"a",
"base",
"function",
"base",
"chains",
"them",
"together",
"so",
"each",
"middleware",
"is",
"fed",
"the",
"function",
"below",
"and",
"returns",
"the",
"top"... | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L71-L79 |
16,780 | eventbrite/pysoa | pysoa/client/client.py | ServiceHandler.send_request | def send_request(self, job_request, message_expiry_in_seconds=None):
"""
Send a JobRequest, and return a request ID.
The context and control_extra arguments may be used to include extra values in the
context and control headers, respectively.
:param job_request: The job request... | python | def send_request(self, job_request, message_expiry_in_seconds=None):
"""
Send a JobRequest, and return a request ID.
The context and control_extra arguments may be used to include extra values in the
context and control headers, respectively.
:param job_request: The job request... | [
"def",
"send_request",
"(",
"self",
",",
"job_request",
",",
"message_expiry_in_seconds",
"=",
"None",
")",
":",
"request_id",
"=",
"self",
".",
"request_counter",
"self",
".",
"request_counter",
"+=",
"1",
"meta",
"=",
"{",
"}",
"wrapper",
"=",
"self",
".",... | Send a JobRequest, and return a request ID.
The context and control_extra arguments may be used to include extra values in the
context and control headers, respectively.
:param job_request: The job request object to send
:type job_request: JobRequest
:param message_expiry_in_se... | [
"Send",
"a",
"JobRequest",
"and",
"return",
"a",
"request",
"ID",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L87-L117 |
16,781 | eventbrite/pysoa | pysoa/client/client.py | ServiceHandler.get_all_responses | def get_all_responses(self, receive_timeout_in_seconds=None):
"""
Receive all available responses from the transport as a generator.
:param receive_timeout_in_seconds: How long to block without receiving a message before raising
`MessageReceiveTimeout`... | python | def get_all_responses(self, receive_timeout_in_seconds=None):
"""
Receive all available responses from the transport as a generator.
:param receive_timeout_in_seconds: How long to block without receiving a message before raising
`MessageReceiveTimeout`... | [
"def",
"get_all_responses",
"(",
"self",
",",
"receive_timeout_in_seconds",
"=",
"None",
")",
":",
"wrapper",
"=",
"self",
".",
"_make_middleware_stack",
"(",
"[",
"m",
".",
"response",
"for",
"m",
"in",
"self",
".",
"middleware",
"]",
",",
"self",
".",
"_... | Receive all available responses from the transport as a generator.
:param receive_timeout_in_seconds: How long to block without receiving a message before raising
`MessageReceiveTimeout` (defaults to five seconds unless the settings are
... | [
"Receive",
"all",
"available",
"responses",
"from",
"the",
"transport",
"as",
"a",
"generator",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L127-L154 |
16,782 | eventbrite/pysoa | pysoa/client/client.py | Client.call_action | def call_action(self, service_name, action, body=None, **kwargs):
"""
Build and send a single job request with one action.
Returns the action response or raises an exception if the action response is an error (unless
`raise_action_errors` is passed as `False`) or if the job response is ... | python | def call_action(self, service_name, action, body=None, **kwargs):
"""
Build and send a single job request with one action.
Returns the action response or raises an exception if the action response is an error (unless
`raise_action_errors` is passed as `False`) or if the job response is ... | [
"def",
"call_action",
"(",
"self",
",",
"service_name",
",",
"action",
",",
"body",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"call_action_future",
"(",
"service_name",
",",
"action",
",",
"body",
",",
"*",
"*",
"kwargs",
"... | Build and send a single job request with one action.
Returns the action response or raises an exception if the action response is an error (unless
`raise_action_errors` is passed as `False`) or if the job response is an error (unless `raise_job_errors` is
passed as `False`).
:param ser... | [
"Build",
"and",
"send",
"a",
"single",
"job",
"request",
"with",
"one",
"action",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L348-L390 |
16,783 | eventbrite/pysoa | pysoa/client/client.py | Client.call_actions | def call_actions(
self,
service_name,
actions,
expansions=None,
raise_job_errors=True,
raise_action_errors=True,
timeout=None,
**kwargs
):
"""
Build and send a single job request with one or more actions.
Returns a list of acti... | python | def call_actions(
self,
service_name,
actions,
expansions=None,
raise_job_errors=True,
raise_action_errors=True,
timeout=None,
**kwargs
):
"""
Build and send a single job request with one or more actions.
Returns a list of acti... | [
"def",
"call_actions",
"(",
"self",
",",
"service_name",
",",
"actions",
",",
"expansions",
"=",
"None",
",",
"raise_job_errors",
"=",
"True",
",",
"raise_action_errors",
"=",
"True",
",",
"timeout",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return"... | Build and send a single job request with one or more actions.
Returns a list of action responses, one for each action in the same order as provided, or raises an exception
if any action response is an error (unless `raise_action_errors` is passed as `False`) or if the job response
is an error (... | [
"Build",
"and",
"send",
"a",
"single",
"job",
"request",
"with",
"one",
"or",
"more",
"actions",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L392-L451 |
16,784 | eventbrite/pysoa | pysoa/client/client.py | Client.call_actions_parallel | def call_actions_parallel(self, service_name, actions, **kwargs):
"""
Build and send multiple job requests to one service, each job with one action, to be executed in parallel, and
return once all responses have been received.
Returns a list of action responses, one for each action in t... | python | def call_actions_parallel(self, service_name, actions, **kwargs):
"""
Build and send multiple job requests to one service, each job with one action, to be executed in parallel, and
return once all responses have been received.
Returns a list of action responses, one for each action in t... | [
"def",
"call_actions_parallel",
"(",
"self",
",",
"service_name",
",",
"actions",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"call_actions_parallel_future",
"(",
"service_name",
",",
"actions",
",",
"*",
"*",
"kwargs",
")",
".",
"result",
"(",... | Build and send multiple job requests to one service, each job with one action, to be executed in parallel, and
return once all responses have been received.
Returns a list of action responses, one for each action in the same order as provided, or raises an exception
if any action response is an... | [
"Build",
"and",
"send",
"multiple",
"job",
"requests",
"to",
"one",
"service",
"each",
"job",
"with",
"one",
"action",
"to",
"be",
"executed",
"in",
"parallel",
"and",
"return",
"once",
"all",
"responses",
"have",
"been",
"received",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L453-L494 |
16,785 | eventbrite/pysoa | pysoa/client/client.py | Client.call_jobs_parallel | def call_jobs_parallel(
self,
jobs,
expansions=None,
raise_job_errors=True,
raise_action_errors=True,
catch_transport_errors=False,
timeout=None,
**kwargs
):
"""
Build and send multiple job requests to one or more services, each with on... | python | def call_jobs_parallel(
self,
jobs,
expansions=None,
raise_job_errors=True,
raise_action_errors=True,
catch_transport_errors=False,
timeout=None,
**kwargs
):
"""
Build and send multiple job requests to one or more services, each with on... | [
"def",
"call_jobs_parallel",
"(",
"self",
",",
"jobs",
",",
"expansions",
"=",
"None",
",",
"raise_job_errors",
"=",
"True",
",",
"raise_action_errors",
"=",
"True",
",",
"catch_transport_errors",
"=",
"False",
",",
"timeout",
"=",
"None",
",",
"*",
"*",
"kw... | Build and send multiple job requests to one or more services, each with one or more actions, to be executed in
parallel, and return once all responses have been received.
Returns a list of job responses, one for each job in the same order as provided, or raises an exception if any
job response ... | [
"Build",
"and",
"send",
"multiple",
"job",
"requests",
"to",
"one",
"or",
"more",
"services",
"each",
"with",
"one",
"or",
"more",
"actions",
"to",
"be",
"executed",
"in",
"parallel",
"and",
"return",
"once",
"all",
"responses",
"have",
"been",
"received",
... | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L496-L564 |
16,786 | eventbrite/pysoa | pysoa/client/client.py | Client.send_request | def send_request(
self,
service_name,
actions,
switches=None,
correlation_id=None,
continue_on_error=False,
context=None,
control_extra=None,
message_expiry_in_seconds=None,
suppress_response=False,
):
"""
Build and send... | python | def send_request(
self,
service_name,
actions,
switches=None,
correlation_id=None,
continue_on_error=False,
context=None,
control_extra=None,
message_expiry_in_seconds=None,
suppress_response=False,
):
"""
Build and send... | [
"def",
"send_request",
"(",
"self",
",",
"service_name",
",",
"actions",
",",
"switches",
"=",
"None",
",",
"correlation_id",
"=",
"None",
",",
"continue_on_error",
"=",
"False",
",",
"context",
"=",
"None",
",",
"control_extra",
"=",
"None",
",",
"message_e... | Build and send a JobRequest, and return a request ID.
The context and control_extra arguments may be used to include extra values in the
context and control headers, respectively.
:param service_name: The name of the service from which to receive responses
:type service_name: union[str... | [
"Build",
"and",
"send",
"a",
"JobRequest",
"and",
"return",
"a",
"request",
"ID",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L804-L866 |
16,787 | eventbrite/pysoa | pysoa/client/client.py | Client.get_all_responses | def get_all_responses(self, service_name, receive_timeout_in_seconds=None):
"""
Receive all available responses from the service as a generator.
:param service_name: The name of the service from which to receive responses
:type service_name: union[str, unicode]
:param receive_ti... | python | def get_all_responses(self, service_name, receive_timeout_in_seconds=None):
"""
Receive all available responses from the service as a generator.
:param service_name: The name of the service from which to receive responses
:type service_name: union[str, unicode]
:param receive_ti... | [
"def",
"get_all_responses",
"(",
"self",
",",
"service_name",
",",
"receive_timeout_in_seconds",
"=",
"None",
")",
":",
"handler",
"=",
"self",
".",
"_get_handler",
"(",
"service_name",
")",
"return",
"handler",
".",
"get_all_responses",
"(",
"receive_timeout_in_sec... | Receive all available responses from the service as a generator.
:param service_name: The name of the service from which to receive responses
:type service_name: union[str, unicode]
:param receive_timeout_in_seconds: How long to block without receiving a message before raising
... | [
"Receive",
"all",
"available",
"responses",
"from",
"the",
"service",
"as",
"a",
"generator",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/client/client.py#L868-L886 |
16,788 | eventbrite/pysoa | pysoa/server/autoreload.py | get_reloader | def get_reloader(main_module_name, watch_modules, signal_forks=False):
"""
Don't instantiate a reloader directly. Instead, call this method to get a reloader, and then call `main` on that
reloader.
See the documentation for `AbstractReloader.main` above to see how to call it.
:param main_module_na... | python | def get_reloader(main_module_name, watch_modules, signal_forks=False):
"""
Don't instantiate a reloader directly. Instead, call this method to get a reloader, and then call `main` on that
reloader.
See the documentation for `AbstractReloader.main` above to see how to call it.
:param main_module_na... | [
"def",
"get_reloader",
"(",
"main_module_name",
",",
"watch_modules",
",",
"signal_forks",
"=",
"False",
")",
":",
"if",
"USE_PY_INOTIFY",
":",
"return",
"_PyInotifyReloader",
"(",
"main_module_name",
",",
"watch_modules",
",",
"signal_forks",
")",
"return",
"_Polli... | Don't instantiate a reloader directly. Instead, call this method to get a reloader, and then call `main` on that
reloader.
See the documentation for `AbstractReloader.main` above to see how to call it.
:param main_module_name: The main module name (such as "example_service.standalone"). It should be the v... | [
"Don",
"t",
"instantiate",
"a",
"reloader",
"directly",
".",
"Instead",
"call",
"this",
"method",
"to",
"get",
"a",
"reloader",
"and",
"then",
"call",
"main",
"on",
"that",
"reloader",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/autoreload.py#L414-L438 |
16,789 | eventbrite/pysoa | pysoa/common/serializer/msgpack_serializer.py | MsgpackSerializer.ext_hook | def ext_hook(self, code, data):
"""
Decodes our custom extension types
"""
if code == self.EXT_DATETIME:
# Unpack datetime object from a big-endian signed 64-bit integer.
microseconds = self.STRUCT_DATETIME.unpack(data)[0]
return datetime.datetime.utcf... | python | def ext_hook(self, code, data):
"""
Decodes our custom extension types
"""
if code == self.EXT_DATETIME:
# Unpack datetime object from a big-endian signed 64-bit integer.
microseconds = self.STRUCT_DATETIME.unpack(data)[0]
return datetime.datetime.utcf... | [
"def",
"ext_hook",
"(",
"self",
",",
"code",
",",
"data",
")",
":",
"if",
"code",
"==",
"self",
".",
"EXT_DATETIME",
":",
"# Unpack datetime object from a big-endian signed 64-bit integer.",
"microseconds",
"=",
"self",
".",
"STRUCT_DATETIME",
".",
"unpack",
"(",
... | Decodes our custom extension types | [
"Decodes",
"our",
"custom",
"extension",
"types"
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/common/serializer/msgpack_serializer.py#L139-L163 |
16,790 | eventbrite/pysoa | pysoa/common/transport/local.py | LocalClientTransport.send_request_message | def send_request_message(self, request_id, meta, body, _=None):
"""
Receives a request from the client and handles and dispatches in in-thread. `message_expiry_in_seconds` is not
supported. Messages do not expire, as the server handles the request immediately in the same thread before
th... | python | def send_request_message(self, request_id, meta, body, _=None):
"""
Receives a request from the client and handles and dispatches in in-thread. `message_expiry_in_seconds` is not
supported. Messages do not expire, as the server handles the request immediately in the same thread before
th... | [
"def",
"send_request_message",
"(",
"self",
",",
"request_id",
",",
"meta",
",",
"body",
",",
"_",
"=",
"None",
")",
":",
"self",
".",
"_current_request",
"=",
"(",
"request_id",
",",
"meta",
",",
"body",
")",
"try",
":",
"self",
".",
"server",
".",
... | Receives a request from the client and handles and dispatches in in-thread. `message_expiry_in_seconds` is not
supported. Messages do not expire, as the server handles the request immediately in the same thread before
this method returns. This method blocks until the server has completed handling the re... | [
"Receives",
"a",
"request",
"from",
"the",
"client",
"and",
"handles",
"and",
"dispatches",
"in",
"in",
"-",
"thread",
".",
"message_expiry_in_seconds",
"is",
"not",
"supported",
".",
"Messages",
"do",
"not",
"expire",
"as",
"the",
"server",
"handles",
"the",
... | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/common/transport/local.py#L78-L88 |
16,791 | eventbrite/pysoa | pysoa/common/transport/local.py | LocalClientTransport.send_response_message | def send_response_message(self, request_id, meta, body):
"""
Add the response to the deque.
"""
self.response_messages.append((request_id, meta, body)) | python | def send_response_message(self, request_id, meta, body):
"""
Add the response to the deque.
"""
self.response_messages.append((request_id, meta, body)) | [
"def",
"send_response_message",
"(",
"self",
",",
"request_id",
",",
"meta",
",",
"body",
")",
":",
"self",
".",
"response_messages",
".",
"append",
"(",
"(",
"request_id",
",",
"meta",
",",
"body",
")",
")"
] | Add the response to the deque. | [
"Add",
"the",
"response",
"to",
"the",
"deque",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/common/transport/local.py#L103-L107 |
16,792 | eventbrite/pysoa | pysoa/server/action/status.py | StatusActionFactory | def StatusActionFactory(version, build=None, base_class=BaseStatusAction): # noqa
"""
A factory for creating a new status action class specific to a service.
:param version: The service version
:type version: union[str, unicode]
:param build: The optional service build identifier
:type build: ... | python | def StatusActionFactory(version, build=None, base_class=BaseStatusAction): # noqa
"""
A factory for creating a new status action class specific to a service.
:param version: The service version
:type version: union[str, unicode]
:param build: The optional service build identifier
:type build: ... | [
"def",
"StatusActionFactory",
"(",
"version",
",",
"build",
"=",
"None",
",",
"base_class",
"=",
"BaseStatusAction",
")",
":",
"# noqa",
"return",
"type",
"(",
"str",
"(",
"'StatusAction'",
")",
",",
"(",
"base_class",
",",
")",
",",
"{",
"str",
"(",
"'_... | A factory for creating a new status action class specific to a service.
:param version: The service version
:type version: union[str, unicode]
:param build: The optional service build identifier
:type build: union[str, unicode]
:param base_class: The optional base class, to override `BaseStatusActi... | [
"A",
"factory",
"for",
"creating",
"a",
"new",
"status",
"action",
"class",
"specific",
"to",
"a",
"service",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/action/status.py#L235-L253 |
16,793 | eventbrite/pysoa | pysoa/server/server.py | Server.make_middleware_stack | def make_middleware_stack(middleware, base):
"""
Given a list of in-order middleware callable objects `middleware` and a base function `base`, chains them
together so each middleware is fed the function below, and returns the top level ready to call.
:param middleware: The middleware st... | python | def make_middleware_stack(middleware, base):
"""
Given a list of in-order middleware callable objects `middleware` and a base function `base`, chains them
together so each middleware is fed the function below, and returns the top level ready to call.
:param middleware: The middleware st... | [
"def",
"make_middleware_stack",
"(",
"middleware",
",",
"base",
")",
":",
"for",
"ware",
"in",
"reversed",
"(",
"middleware",
")",
":",
"base",
"=",
"ware",
"(",
"base",
")",
"return",
"base"
] | Given a list of in-order middleware callable objects `middleware` and a base function `base`, chains them
together so each middleware is fed the function below, and returns the top level ready to call.
:param middleware: The middleware stack
:type middleware: iterable[callable]
:param b... | [
"Given",
"a",
"list",
"of",
"in",
"-",
"order",
"middleware",
"callable",
"objects",
"middleware",
"and",
"a",
"base",
"function",
"base",
"chains",
"them",
"together",
"so",
"each",
"middleware",
"is",
"fed",
"the",
"function",
"below",
"and",
"returns",
"t... | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L266-L282 |
16,794 | eventbrite/pysoa | pysoa/server/server.py | Server.process_job | def process_job(self, job_request):
"""
Validate, execute, and run the job request, wrapping it with any applicable job middleware.
:param job_request: The job request
:type job_request: dict
:return: A `JobResponse` object
:rtype: JobResponse
:raise: JobError
... | python | def process_job(self, job_request):
"""
Validate, execute, and run the job request, wrapping it with any applicable job middleware.
:param job_request: The job request
:type job_request: dict
:return: A `JobResponse` object
:rtype: JobResponse
:raise: JobError
... | [
"def",
"process_job",
"(",
"self",
",",
"job_request",
")",
":",
"try",
":",
"# Validate JobRequest message",
"validation_errors",
"=",
"[",
"Error",
"(",
"code",
"=",
"error",
".",
"code",
",",
"message",
"=",
"error",
".",
"message",
",",
"field",
"=",
"... | Validate, execute, and run the job request, wrapping it with any applicable job middleware.
:param job_request: The job request
:type job_request: dict
:return: A `JobResponse` object
:rtype: JobResponse
:raise: JobError | [
"Validate",
"execute",
"and",
"run",
"the",
"job",
"request",
"wrapping",
"it",
"with",
"any",
"applicable",
"job",
"middleware",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L284-L339 |
16,795 | eventbrite/pysoa | pysoa/server/server.py | Server.handle_job_exception | def handle_job_exception(self, exception, variables=None):
"""
Makes and returns a last-ditch error response.
:param exception: The exception that happened
:type exception: Exception
:param variables: A dictionary of context-relevant variables to include in the error response
... | python | def handle_job_exception(self, exception, variables=None):
"""
Makes and returns a last-ditch error response.
:param exception: The exception that happened
:type exception: Exception
:param variables: A dictionary of context-relevant variables to include in the error response
... | [
"def",
"handle_job_exception",
"(",
"self",
",",
"exception",
",",
"variables",
"=",
"None",
")",
":",
"# Get the error and traceback if we can",
"# noinspection PyBroadException",
"try",
":",
"error_str",
",",
"traceback_str",
"=",
"six",
".",
"text_type",
"(",
"exce... | Makes and returns a last-ditch error response.
:param exception: The exception that happened
:type exception: Exception
:param variables: A dictionary of context-relevant variables to include in the error response
:type variables: dict
:return: A `JobResponse` object
:r... | [
"Makes",
"and",
"returns",
"a",
"last",
"-",
"ditch",
"error",
"response",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L341-L383 |
16,796 | eventbrite/pysoa | pysoa/server/server.py | Server.execute_job | def execute_job(self, job_request):
"""
Processes and runs the action requests contained in the job and returns a `JobResponse`.
:param job_request: The job request
:type job_request: dict
:return: A `JobResponse` object
:rtype: JobResponse
"""
# Run the... | python | def execute_job(self, job_request):
"""
Processes and runs the action requests contained in the job and returns a `JobResponse`.
:param job_request: The job request
:type job_request: dict
:return: A `JobResponse` object
:rtype: JobResponse
"""
# Run the... | [
"def",
"execute_job",
"(",
"self",
",",
"job_request",
")",
":",
"# Run the Job's Actions",
"job_response",
"=",
"JobResponse",
"(",
")",
"job_switches",
"=",
"RequestSwitchSet",
"(",
"job_request",
"[",
"'context'",
"]",
"[",
"'switches'",
"]",
")",
"for",
"i",... | Processes and runs the action requests contained in the job and returns a `JobResponse`.
:param job_request: The job request
:type job_request: dict
:return: A `JobResponse` object
:rtype: JobResponse | [
"Processes",
"and",
"runs",
"the",
"action",
"requests",
"contained",
"in",
"the",
"job",
"and",
"returns",
"a",
"JobResponse",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L397-L467 |
16,797 | eventbrite/pysoa | pysoa/server/server.py | Server.handle_shutdown_signal | def handle_shutdown_signal(self, *_):
"""
Handles the reception of a shutdown signal.
"""
if self.shutting_down:
self.logger.warning('Received double interrupt, forcing shutdown')
sys.exit(1)
else:
self.logger.warning('Received interrupt, initi... | python | def handle_shutdown_signal(self, *_):
"""
Handles the reception of a shutdown signal.
"""
if self.shutting_down:
self.logger.warning('Received double interrupt, forcing shutdown')
sys.exit(1)
else:
self.logger.warning('Received interrupt, initi... | [
"def",
"handle_shutdown_signal",
"(",
"self",
",",
"*",
"_",
")",
":",
"if",
"self",
".",
"shutting_down",
":",
"self",
".",
"logger",
".",
"warning",
"(",
"'Received double interrupt, forcing shutdown'",
")",
"sys",
".",
"exit",
"(",
"1",
")",
"else",
":",
... | Handles the reception of a shutdown signal. | [
"Handles",
"the",
"reception",
"of",
"a",
"shutdown",
"signal",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L469-L478 |
16,798 | eventbrite/pysoa | pysoa/server/server.py | Server.harakiri | def harakiri(self, *_):
"""
Handles the reception of a timeout signal indicating that a request has been processing for too long, as
defined by the Harakiri settings.
"""
if self.shutting_down:
self.logger.warning('Graceful shutdown failed after {}s. Exiting now!'.for... | python | def harakiri(self, *_):
"""
Handles the reception of a timeout signal indicating that a request has been processing for too long, as
defined by the Harakiri settings.
"""
if self.shutting_down:
self.logger.warning('Graceful shutdown failed after {}s. Exiting now!'.for... | [
"def",
"harakiri",
"(",
"self",
",",
"*",
"_",
")",
":",
"if",
"self",
".",
"shutting_down",
":",
"self",
".",
"logger",
".",
"warning",
"(",
"'Graceful shutdown failed after {}s. Exiting now!'",
".",
"format",
"(",
"self",
".",
"settings",
"[",
"'harakiri'",
... | Handles the reception of a timeout signal indicating that a request has been processing for too long, as
defined by the Harakiri settings. | [
"Handles",
"the",
"reception",
"of",
"a",
"timeout",
"signal",
"indicating",
"that",
"a",
"request",
"has",
"been",
"processing",
"for",
"too",
"long",
"as",
"defined",
"by",
"the",
"Harakiri",
"settings",
"."
] | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L480-L496 |
16,799 | eventbrite/pysoa | pysoa/server/server.py | Server.run | def run(self):
"""
Starts the server run loop and returns after the server shuts down due to a shutdown-request, Harakiri signal,
or unhandled exception. See the documentation for `Server.main` for full details on the chain of `Server`
method calls.
"""
self.logger.info(... | python | def run(self):
"""
Starts the server run loop and returns after the server shuts down due to a shutdown-request, Harakiri signal,
or unhandled exception. See the documentation for `Server.main` for full details on the chain of `Server`
method calls.
"""
self.logger.info(... | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'Service \"{service}\" server starting up, pysoa version {pysoa}, listening on transport {transport}.'",
".",
"format",
"(",
"service",
"=",
"self",
".",
"service_name",
",",
"pysoa",
"=",
... | Starts the server run loop and returns after the server shuts down due to a shutdown-request, Harakiri signal,
or unhandled exception. See the documentation for `Server.main` for full details on the chain of `Server`
method calls. | [
"Starts",
"the",
"server",
"run",
"loop",
"and",
"returns",
"after",
"the",
"server",
"shuts",
"down",
"due",
"to",
"a",
"shutdown",
"-",
"request",
"Harakiri",
"signal",
"or",
"unhandled",
"exception",
".",
"See",
"the",
"documentation",
"for",
"Server",
".... | 9c052cae2397d13de3df8ae2c790846a70b53f18 | https://github.com/eventbrite/pysoa/blob/9c052cae2397d13de3df8ae2c790846a70b53f18/pysoa/server/server.py#L611-L658 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.