INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
Enable implicit cast of pointer to most suitable class This behaviour is available in sip per default. Based on http://nathanhorne.com/pyqtpyside-wrap-instance Usage: This mechanism kicks in under these circumstances. 1. Qt.py is using PySide 1 or 2. 2. A `base` argument is not pr...
def _wrapinstance(ptr, base=None): """Enable implicit cast of pointer to most suitable class This behaviour is available in sip per default. Based on http://nathanhorne.com/pyqtpyside-wrap-instance Usage: This mechanism kicks in under these circumstances. 1. Qt.py is using PySide 1 or...
Dynamically load a user interface from the given `uifile` This function calls `uic.loadUi` if using PyQt bindings, else it implements a comparable binding for PySide. Documentation: http://pyqt.sourceforge.net/Docs/PyQt5/designer.html#PyQt5.uic.loadUi Arguments: uifile (str): Absolute...
def _loadUi(uifile, baseinstance=None): """Dynamically load a user interface from the given `uifile` This function calls `uic.loadUi` if using PyQt bindings, else it implements a comparable binding for PySide. Documentation: http://pyqt.sourceforge.net/Docs/PyQt5/designer.html#PyQt5.uic.loadUi...
import_sub_module will mimic the function of importlib.import_module
def _import_sub_module(module, name): """import_sub_module will mimic the function of importlib.import_module""" module = __import__(module.__name__ + "." + name) for level in name.split("."): module = getattr(module, level) return module
Install common submodules
def _setup(module, extras): """Install common submodules""" Qt.__binding__ = module.__name__ for name in list(_common_members) + extras: try: submodule = _import_sub_module( module, name) except ImportError: try: # For extra modules l...
Apply misplaced members from `binding` to Qt.py Arguments: binding (dict): Misplaced members
def _reassign_misplaced_members(binding): """Apply misplaced members from `binding` to Qt.py Arguments: binding (dict): Misplaced members """ for src, dst in _misplaced_members[binding].items(): dst_value = None src_parts = src.split(".") src_module = src_parts[0] ...
Apply `binding` to QtCompat Arguments: binding (str): Top level binding in _compatibility_members. decorators (dict, optional): Provides the ability to decorate the original Qt methods when needed by a binding. This can be used to change the returned value to a standard valu...
def _build_compatibility_members(binding, decorators=None): """Apply `binding` to QtCompat Arguments: binding (str): Top level binding in _compatibility_members. decorators (dict, optional): Provides the ability to decorate the original Qt methods when needed by a binding. This can ...
Initialise PySide2 These functions serve to test the existence of a binding along with set it up in such a way that it aligns with the final step; adding members from the original binding to Qt.py
def _pyside2(): """Initialise PySide2 These functions serve to test the existence of a binding along with set it up in such a way that it aligns with the final step; adding members from the original binding to Qt.py """ import PySide2 as module extras = ["QtUiTools"] try: ...
Initialise PyQt4
def _pyqt4(): """Initialise PyQt4""" import sip # Validation of envivornment variable. Prevents an error if # the variable is invalid since it's just a hint. try: hint = int(QT_SIP_API_HINT) except TypeError: hint = None # Variable was None, i.e. not set. except ValueError...
Internal option (used in installer)
def _none(): """Internal option (used in installer)""" Mock = type("Mock", (), {"__getattr__": lambda Qt, attr: None}) Qt.__binding__ = "None" Qt.__qt_version__ = "0.0.0" Qt.__binding_version__ = "0.0.0" Qt.QtCompat.loadUi = lambda uifile, baseinstance=None: None Qt.QtCompat.setSectionResi...
Convert compiled .ui file from PySide2 to Qt.py Arguments: lines (list): Each line of of .ui file Usage: >> with open("myui.py") as f: .. lines = _convert(f.readlines())
def _convert(lines): """Convert compiled .ui file from PySide2 to Qt.py Arguments: lines (list): Each line of of .ui file Usage: >> with open("myui.py") as f: .. lines = _convert(f.readlines()) """ def parse(line): line = line.replace("from PySide2 import", "fro...
This optional function is called by Qt.py to modify the decorators applied to QtCompat namespace objects. Arguments: binding (str): The Qt binding being wrapped by Qt.py decorators (dict): Maps specific decorator functions to QtCompat namespace methods. See Qt._build_compatibility_m...
def update_compatibility_decorators(binding, decorators): """ This optional function is called by Qt.py to modify the decorators applied to QtCompat namespace objects. Arguments: binding (str): The Qt binding being wrapped by Qt.py decorators (dict): Maps specific decorator functions to ...
Pyside equivalent for the loadUiType function in PyQt. From the PyQt4 documentation: Load a Qt Designer .ui file and return a tuple of the generated form class and the Qt base class. These can then be used to create any number of instances of the user interface without having to parse the ...
def load_ui_type(uifile): """Pyside equivalent for the loadUiType function in PyQt. From the PyQt4 documentation: Load a Qt Designer .ui file and return a tuple of the generated form class and the Qt base class. These can then be used to create any number of instances of the user interf...
Provide PyQt4.uic.loadUi functionality to PySide Args: uifile (str): Absolute path to .ui file base_instance (QWidget): The widget into which UI widgets are loaded Note: pysideuic is required for this to work with PySide. This seems to work correctly in Maya as well as outsid...
def pyside_load_ui(uifile, base_instance=None): """Provide PyQt4.uic.loadUi functionality to PySide Args: uifile (str): Absolute path to .ui file base_instance (QWidget): The widget into which UI widgets are loaded Note: pysideuic is required for this to work with PySide. ...
Load a Qt Designer .ui file and returns an instance of the user interface Args: uifile (str): Absolute path to .ui file base_instance (QWidget): The widget into which UI widgets are loaded Returns: function: pyside_load_ui or uic.loadUi
def load_ui_wrapper(uifile, base_instance=None): """Load a Qt Designer .ui file and returns an instance of the user interface Args: uifile (str): Absolute path to .ui file base_instance (QWidget): The widget into which UI widgets are loaded Returns: function: pyside_load_ui or uic....
Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean
def ShouldRetry(self, exception): """Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean """ self.session_token_retry_count += 1 # clear previous location-based routing directive ...
The default index policy on a DocumentContainer will AUTOMATICALLY index ALL documents added. There may be scenarios where you want to exclude a specific doc from the index even though all other documents are being indexed automatically. This method demonstrates how to use an index directive t...
def ExplicitlyExcludeFromIndex(client, database_id): """ The default index policy on a DocumentContainer will AUTOMATICALLY index ALL documents added. There may be scenarios where you want to exclude a specific doc from the index even though all other documents are being indexed automatically. ...
The default behavior is for Cosmos to index every attribute in every document automatically. There are times when a document contains large amounts of information, in deeply nested structures that you know you will never search on. In extreme cases like this, you can exclude paths from the index t...
def ExcludePathsFromIndex(client, database_id): """The default behavior is for Cosmos to index every attribute in every document automatically. There are times when a document contains large amounts of information, in deeply nested structures that you know you will never search on. In extreme cases li...
When a range index is not available (i.e. Only hash or no index found on the path), comparisons queries can still be performed as scans using Allow scan request headers passed through options This method demonstrates how to force a scan when only hash indexes exist on the path ===== Warning=====...
def RangeScanOnHashIndex(client, database_id): """When a range index is not available (i.e. Only hash or no index found on the path), comparisons queries can still be performed as scans using Allow scan request headers passed through options This method demonstrates how to force a scan when only has...
Showing how range queries can be performed even on strings.
def UseRangeIndexesOnStrings(client, database_id): """Showing how range queries can be performed even on strings. """ try: DeleteContainerIfExists(client, database_id, COLLECTION_ID) database_link = GetDatabaseLink(database_id) # collections = Query_Entities(client, 'collection', pa...
Resolves the collection for creating the document based on the partition key. :param dict document: The document to be created. :return: Collection Self link or Name based link which should handle the Create operation. :rtype: str
def ResolveForCreate(self, document): """Resolves the collection for creating the document based on the partition key. :param dict document: The document to be created. :return: Collection Self link or Name based link which should handle the Create operation. :r...
Resolves the collection for reading/querying the documents based on the partition key. :param dict document: The document to be read/queried. :return: Collection Self link(s) or Name based link(s) which should handle the Read operation. :rtype: list
def ResolveForRead(self, partition_key): """Resolves the collection for reading/querying the documents based on the partition key. :param dict document: The document to be read/queried. :return: Collection Self link(s) or Name based link(s) which should handle the Read ...
Gets the containing range based on the partition key.
def _GetContainingRange(self, partition_key): """Gets the containing range based on the partition key. """ for keyrange in self.partition_map.keys(): if keyrange.Contains(partition_key): return keyrange return None
Gets the intersecting ranges based on the partition key.
def _GetIntersectingRanges(self, partition_key): """Gets the intersecting ranges based on the partition key. """ partitionkey_ranges = set() intersecting_ranges = set() if partition_key is None: return list(self.partition_map.keys()) if isinstance(partition_...
Represents a client side partitioning query iterable. This constructor instantiates a QueryIterable for client side partitioning queries, and sets _MultiCollectionQueryExecutionContext as the internal execution context. :param CosmosClient client: Instance o...
def PartitioningQueryIterable(cls, client, query, options, database_link, partition_key): """ Represents a client side partitioning query iterable. This constructor instantiates a QueryIterable for client side partitioning queries, and sets _MultiCollectionQueryExecutionContext ...
instantiates the internal query execution context based.
def _create_execution_context(self): """instantiates the internal query execution context based. """ if hasattr(self, '_database_link'): # client side partitioning query return base_execution_context._MultiCollectionQueryExecutionContext(self._client, self._options, self....
Returns a block of results with respecting retry policy. This method only exists for backward compatibility reasons. (Because QueryIterable has exposed fetch_next_block api). :return: List of results. :rtype: list
def fetch_next_block(self): """Returns a block of results with respecting retry policy. This method only exists for backward compatibility reasons. (Because QueryIterable has exposed fetch_next_block api). :return: List of results. :rtype: list ...
Exectutes the function with passed parameters applying all retry policies :param object client: Document client instance :param object global_endpoint_manager: Instance of _GlobalEndpointManager class :param function function: Function to be called wrapped with retries :param (n...
def _Execute(client, global_endpoint_manager, function, *args, **kwargs): """Exectutes the function with passed parameters applying all retry policies :param object client: Document client instance :param object global_endpoint_manager: Instance of _GlobalEndpointManager class :param fu...
Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean
def ShouldRetry(self, exception): """Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean """ if self.current_retry_attempt_count < self._max_retry_attempt_count: self.current_ret...
Gets the database account first by using the default endpoint, and if that doesn't returns use the endpoints for the preferred locations in the order they are specified to get the database account.
def _GetDatabaseAccount(self): """Gets the database account first by using the default endpoint, and if that doesn't returns use the endpoints for the preferred locations in the order they are specified to get the database account. """ try: database_account = s...
Compares the passed hash value with the hash value of this object
def CompareTo(self, other_hash_value): """Compares the passed hash value with the hash value of this object """ if len(self.hash_value) != len(other_hash_value): raise ValueError("Length of hashes doesn't match.") # The hash byte array that is returned from ComputeHash metho...
Computes the hash of the value passed using MurmurHash3 algorithm. :param bytearray key: Byte array representing the key to be hashed. :return: 32 bit hash value. :rtype: int
def ComputeHash(self, key): """ Computes the hash of the value passed using MurmurHash3 algorithm. :param bytearray key: Byte array representing the key to be hashed. :return: 32 bit hash value. :rtype: int """ if key is None: ...
Computes the hash of the value passed using MurmurHash3 algorithm with the seed value.
def _ComputeHash( key, seed = 0x0 ): """Computes the hash of the value passed using MurmurHash3 algorithm with the seed value. """ def fmix( h ): h ^= h >> 16 h = ( h * 0x85ebca6b ) & 0xFFFFFFFF h ^= h >> 13 h = ( h * 0xc2b2ae35 ) & 0xFFFFFFFF ...
Parses session token and creates the vector session token :param str session_token: :return: A Vector session Token :rtype: VectorSessionToken
def create(cls, session_token): """ Parses session token and creates the vector session token :param str session_token: :return: A Vector session Token :rtype: VectorSessionToken """ version = None global_lsn = None local_lsn_by_region = {}...
Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean
def ShouldRetry(self, exception): """Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean """ if not self.connection_policy.EnableEndpointDiscovery: return False if self...
Returns rewritten query or None (if any)
def get_rewritten_query(self): """Returns rewritten query or None (if any) """ rewrittenQuery = self._extract(_PartitionedQueryExecutionInfo.RewrittenQueryPath) if rewrittenQuery is not None: # Hardcode formattable filter to true for now rewrittenQuery = rewritte...
Gets the SelfLink/ID based link of the collection node that maps to the partition key based on the hashing algorithm used for finding the node in the ring. :param str partition_key: The partition key to be used for finding the node in the ring. :return: The name of the ...
def GetCollectionNode(self, partition_key): """Gets the SelfLink/ID based link of the collection node that maps to the partition key based on the hashing algorithm used for finding the node in the ring. :param str partition_key: The partition key to be used for finding the node in t...
Constructs the partitions in the consistent ring by assigning them to collection nodes using the hashing algorithm and then finally sorting the partitions based on the hash value.
def _ConstructPartitions(self, collection_links, partitions_per_node): """Constructs the partitions in the consistent ring by assigning them to collection nodes using the hashing algorithm and then finally sorting the partitions based on the hash value. """ collections_node_count = len(c...
Finds the partition from the byte array representation of the partition key.
def _FindPartition(self, key): """Finds the partition from the byte array representation of the partition key. """ hash_value = self.hash_generator.ComputeHash(key) return self._LowerBoundSearch(self.partitions, hash_value)
Gets the serialized version of the ConsistentRing. Added this helper for the test code.
def _GetSerializedPartitionList(self): """Gets the serialized version of the ConsistentRing. Added this helper for the test code. """ partition_list = list() for part in self.partitions: partition_list.append((part.node, unpack("<L", part.hash_value)[0])) ...
Gets the bytes representing the value of the partition key.
def _GetBytes(partition_key): """Gets the bytes representing the value of the partition key. """ if isinstance(partition_key, six.string_types): return bytearray(partition_key, encoding='utf-8') else: raise ValueError("Unsupported " + str(type(partition_key)) + " ...
Searches the partition in the partition array using hashValue.
def _LowerBoundSearch(partitions, hash_value): """Searches the partition in the partition array using hashValue. """ for i in xrange(0, len(partitions) - 1): if partitions[i].CompareTo(hash_value) <= 0 and partitions[i+1].CompareTo(hash_value) > 0: return i r...
:return: The next result item. :rtype: dict :raises StopIteration: If there is no more result.
def next(self): """ :return: The next result item. :rtype: dict :raises StopIteration: If there is no more result. """ if self._cur_item is not None: res = self._cur_item self._cur_item = None return res r...
TODO: use more_itertools.peekable instead :return: The current result item. :rtype: dict. :raises StopIteration: If there is no current item.
def peek(self): """ TODO: use more_itertools.peekable instead :return: The current result item. :rtype: dict. :raises StopIteration: If there is no current item. """ if self._cur_item is None: self._cur_item = next(self._ex_context) ...
Returns the ordinal of the value of the item pair in the dictionary. :param dict orderby_item: :return: 0 if the item_pair doesn't have any 'item' key 1 if the value is undefined 2 if the value is a boolean 4 if the value is a number ...
def getTypeOrd(orderby_item): """Returns the ordinal of the value of the item pair in the dictionary. :param dict orderby_item: :return: 0 if the item_pair doesn't have any 'item' key 1 if the value is undefined 2 if the value is a boolean ...
compares the two orderby item pairs. :param dict orderby_item1: :param dict orderby_item2: :return: Integer comparison result. The comparator acts such that - if the types are different we get: Undefined value < Null < booleans < Numbers < St...
def compare(orderby_item1, orderby_item2): """compares the two orderby item pairs. :param dict orderby_item1: :param dict orderby_item2: :return: Integer comparison result. The comparator acts such that - if the types are different we get: ...
Compares the given two instances of DocumentProducers. Based on the orderby query items and whether the sort order is Ascending or Descending compares the peek result of the two DocumentProducers. If the peek results are equal based on the sort order, this compa...
def compare(self, doc_producer1, doc_producer2): """Compares the given two instances of DocumentProducers. Based on the orderby query items and whether the sort order is Ascending or Descending compares the peek result of the two DocumentProducers. If the peek r...
Returns a block of results with respecting retry policy. This method only exists for backward compatibility reasons. (Because QueryIterable has exposed fetch_next_block api). :return: List of results. :rtype: list
def fetch_next_block(self): """Returns a block of results with respecting retry policy. This method only exists for backward compatibility reasons. (Because QueryIterable has exposed fetch_next_block api). :return: List of results. :rtype: list ...
Returns the next query result. :return: The next query result. :rtype: dict :raises StopIteration: If no more result is left.
def next(self): """Returns the next query result. :return: The next query result. :rtype: dict :raises StopIteration: If no more result is left. """ if self._has_finished: raise StopIteration if not len(self._buffer): ...
Fetches more items and doesn't retry on failure :return: List of fetched items. :rtype: list
def _fetch_items_helper_no_retries(self, fetch_function): """Fetches more items and doesn't retry on failure :return: List of fetched items. :rtype: list """ fetched_items = [] # Continues pages till finds a non empty page or all results are exhausted ...
Fetches the next block of query results. This iterates fetches the next block of results from the current collection link. Once the current collection results were exhausted. It moves to the next collection link. :return: List of fetched items. :rtype: list
def _fetch_next_block(self): """Fetches the next block of query results. This iterates fetches the next block of results from the current collection link. Once the current collection results were exhausted. It moves to the next collection link. :return: List of ...
Given a partition key range and a collection, returns the list of overlapping partition key ranges :param str collection_link: The name of the collection. :param list partition_key_range: List of partition key range. :return: List o...
def get_overlapping_ranges(self, collection_link, partition_key_ranges): ''' Given a partition key range and a collection, returns the list of overlapping partition key ranges :param str collection_link: The name of the collection. :param list partition_key_...
Evaluates and returns r - partition_key_range :param dict partition_key_range: Partition key range. :param routing_range._Range r: query range. :return: The subtract r - partition_key_range. :rtype: routing_range._Range
def _subtract_range(self, r, partition_key_range): """ Evaluates and returns r - partition_key_range :param dict partition_key_range: Partition key range. :param routing_range._Range r: query range. :return: The subtract r - partition_key_range. :r...
Given the sorted ranges and a collection, Returns the list of overlapping partition key ranges :param str collection_link: The collection link. :param (list of routing_range._Range) sorted_ranges: The sorted list of non-overlapping ranges. :return: List o...
def get_overlapping_ranges(self, collection_link, sorted_ranges): ''' Given the sorted ranges and a collection, Returns the list of overlapping partition key ranges :param str collection_link: The collection link. :param (list of routing_range._Range) sorted_...
Resolves the collection for creating the document based on the partition key. :param dict document: The document to be created. :return: Collection Self link or Name based link which should handle the Create operation. :rtype: str
def ResolveForCreate(self, document): """Resolves the collection for creating the document based on the partition key. :param dict document: The document to be created. :return: Collection Self link or Name based link which should handle the Create operation. ...
Resolves the collection for reading/querying the documents based on the partition key. :param dict document: The document to be read/queried. :return: Collection Self link(s) or Name based link(s) which should handle the Read operation. :rtype: list
def ResolveForRead(self, partition_key): """Resolves the collection for reading/querying the documents based on the partition key. :param dict document: The document to be read/queried. :return: Collection Self link(s) or Name based link(s) which should handle the Read ...
Returns the next query result. :return: The next query result. :rtype: dict :raises StopIteration: If no more result is left.
def next(self): """Returns the next query result. :return: The next query result. :rtype: dict :raises StopIteration: If no more result is left. """ try: return next(self._execution_context) except HTTPFailure as e: ...
Returns a block of results. This method only exists for backward compatibility reasons. (Because QueryIterable has exposed fetch_next_block api). This method internally invokes next() as many times required to collect the requested fetch size. :return...
def fetch_next_block(self): """Returns a block of results. This method only exists for backward compatibility reasons. (Because QueryIterable has exposed fetch_next_block api). This method internally invokes next() as many times required to collect the request...
Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean
def ShouldRetry(self, exception): """Returns true if should retry based on the passed-in exception. :param (errors.HTTPFailure instance) exception: :rtype: boolean """ if (self.current_retry_attempt_count < self._max_retry_attempt_count) and self.needsRetry(excepti...
returns the next result :return: The next result. :rtype: dict :raises StopIteration: If no more result is left.
def next(self): """returns the next result :return: The next result. :rtype: dict :raises StopIteration: If no more result is left. """ if self._orderByPQ.size() > 0: targetRangeExContext = self._orderByPQ.pop() ...
Checks if the passed parameter is in the range of this object.
def Contains(self, other): """Checks if the passed parameter is in the range of this object. """ if other is None: raise ValueError("other is None.") if isinstance(other, Range): if other.low >= self.low and other.high <= self.high: return True ...
Checks if the passed parameter intersects the range of this object.
def Intersect(self, other): """Checks if the passed parameter intersects the range of this object. """ if isinstance(other, Range): max_low = self.low if (self.low >= other.low) else other.low min_high = self.high if (self.high <= other.high) else other.high ...
Registers the partition resolver associated with the database link :param str database_link: Database Self Link or ID based link. :param object partition_resolver: An instance of PartitionResolver.
def RegisterPartitionResolver(self, database_link, partition_resolver): """Registers the partition resolver associated with the database link :param str database_link: Database Self Link or ID based link. :param object partition_resolver: An instance of PartitionResolver...
Gets the partition resolver associated with the database link :param str database_link: Database self link or ID based link. :return: An instance of PartitionResolver. :rtype: object
def GetPartitionResolver(self, database_link): """Gets the partition resolver associated with the database link :param str database_link: Database self link or ID based link. :return: An instance of PartitionResolver. :rtype: object """ if not d...
Creates a database. :param dict database: The Azure Cosmos database to create. :param dict options: The request options for the request. :return: The Database that was created. :rtype: dict
def CreateDatabase(self, database, options=None): """Creates a database. :param dict database: The Azure Cosmos database to create. :param dict options: The request options for the request. :return: The Database that was created. :rtype: dict...
Reads a database. :param str database_link: The link to the database. :param dict options: The request options for the request. :return: The Database that was read. :rtype: dict
def ReadDatabase(self, database_link, options=None): """Reads a database. :param str database_link: The link to the database. :param dict options: The request options for the request. :return: The Database that was read. :rtype: dict ...
Queries databases. :param (str or dict) query: :param dict options: The request options for the request. :return: Query Iterable of Databases. :rtype: query_iterable.QueryIterable
def QueryDatabases(self, query, options=None): """Queries databases. :param (str or dict) query: :param dict options: The request options for the request. :return: Query Iterable of Databases. :rtype: query_iterable.QueryIterable """ if ...
Reads all collections in a database. :param str database_link: The link to the database. :param dict options: The request options for the request. :return: Query Iterable of Collections. :rtype: query_iterable.QueryIterable
def ReadContainers(self, database_link, options=None): """Reads all collections in a database. :param str database_link: The link to the database. :param dict options: The request options for the request. :return: Query Iterable of Collections. ...
Creates a collection in a database. :param str database_link: The link to the database. :param dict collection: The Azure Cosmos collection to create. :param dict options: The request options for the request. :return: The Collection that was created....
def CreateContainer(self, database_link, collection, options=None): """Creates a collection in a database. :param str database_link: The link to the database. :param dict collection: The Azure Cosmos collection to create. :param dict options: The requ...
Replaces a collection and return it. :param str collection_link: The link to the collection entity. :param dict collection: The collection to be used. :param dict options: The request options for the request. :return: The new Collection....
def ReplaceContainer(self, collection_link, collection, options=None): """Replaces a collection and return it. :param str collection_link: The link to the collection entity. :param dict collection: The collection to be used. :param dict options: The ...
Reads a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. :return: The read Collection. :rtype: dict
def ReadContainer(self, collection_link, options=None): """Reads a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. :return: The read Collection. :rtype: ...
Creates a user. :param str database_link: The link to the database. :param dict user: The Azure Cosmos user to create. :param dict options: The request options for the request. :return: The created User. :rtype: dict
def CreateUser(self, database_link, user, options=None): """Creates a user. :param str database_link: The link to the database. :param dict user: The Azure Cosmos user to create. :param dict options: The request options for the request. :retu...
Upserts a user. :param str database_link: The link to the database. :param dict user: The Azure Cosmos user to upsert. :param dict options: The request options for the request. :return: The upserted User. :rtype: dict
def UpsertUser(self, database_link, user, options=None): """Upserts a user. :param str database_link: The link to the database. :param dict user: The Azure Cosmos user to upsert. :param dict options: The request options for the request. :retu...
Reads a user. :param str user_link: The link to the user entity. :param dict options: The request options for the request. :return: The read User. :rtype: dict
def ReadUser(self, user_link, options=None): """Reads a user. :param str user_link: The link to the user entity. :param dict options: The request options for the request. :return: The read User. :rtype: dict """ i...
Reads all users in a database. :params str database_link: The link to the database. :params dict options: The request options for the request. :return: Query iterable of Users. :rtype: query_iterable.QueryIterable
def ReadUsers(self, database_link, options=None): """Reads all users in a database. :params str database_link: The link to the database. :params dict options: The request options for the request. :return: Query iterable of Users. :rtype: ...
Queries users in a database. :param str database_link: The link to the database. :param (str or dict) query: :param dict options: The request options for the request. :return: Query Iterable of Users. :rtype: query_iterable.Que...
def QueryUsers(self, database_link, query, options=None): """Queries users in a database. :param str database_link: The link to the database. :param (str or dict) query: :param dict options: The request options for the request. :return: Query...
Deletes a database. :param str database_link: The link to the database. :param dict options: The request options for the request. :return: The deleted Database. :rtype: dict
def DeleteDatabase(self, database_link, options=None): """Deletes a database. :param str database_link: The link to the database. :param dict options: The request options for the request. :return: The deleted Database. :rtype: dic...
Creates a permission for a user. :param str user_link: The link to the user entity. :param dict permission: The Azure Cosmos user permission to create. :param dict options: The request options for the request. :return: The created Permiss...
def CreatePermission(self, user_link, permission, options=None): """Creates a permission for a user. :param str user_link: The link to the user entity. :param dict permission: The Azure Cosmos user permission to create. :param dict options: The reques...
Upserts a permission for a user. :param str user_link: The link to the user entity. :param dict permission: The Azure Cosmos user permission to upsert. :param dict options: The request options for the request. :return: The upserted permis...
def UpsertPermission(self, user_link, permission, options=None): """Upserts a permission for a user. :param str user_link: The link to the user entity. :param dict permission: The Azure Cosmos user permission to upsert. :param dict options: The reques...
Reads a permission. :param str permission_link: The link to the permission. :param dict options: The request options for the request. :return: The read permission. :rtype: dict
def ReadPermission(self, permission_link, options=None): """Reads a permission. :param str permission_link: The link to the permission. :param dict options: The request options for the request. :return: The read permission. :rtype: ...
Reads all permissions for a user. :param str user_link: The link to the user entity. :param dict options: The request options for the request. :return: Query Iterable of Permissions. :rtype: query_iterable.QueryIterable
def ReadPermissions(self, user_link, options=None): """Reads all permissions for a user. :param str user_link: The link to the user entity. :param dict options: The request options for the request. :return: Query Iterable of Permissions. :rty...
Queries permissions for a user. :param str user_link: The link to the user entity. :param (str or dict) query: :param dict options: The request options for the request. :return: Query Iterable of Permissions. :rtype: query_iterabl...
def QueryPermissions(self, user_link, query, options=None): """Queries permissions for a user. :param str user_link: The link to the user entity. :param (str or dict) query: :param dict options: The request options for the request. :return: Q...
Replaces a user and return it. :param str user_link: The link to the user entity. :param dict user: :param dict options: The request options for the request. :return: The new User. :rtype: dict
def ReplaceUser(self, user_link, user, options=None): """Replaces a user and return it. :param str user_link: The link to the user entity. :param dict user: :param dict options: The request options for the request. :return: The new User. ...
Deletes a user. :param str user_link: The link to the user entity. :param dict options: The request options for the request. :return: The deleted user. :rtype: dict
def DeleteUser(self, user_link, options=None): """Deletes a user. :param str user_link: The link to the user entity. :param dict options: The request options for the request. :return: The deleted user. :rtype: dict """ ...
Replaces a permission and return it. :param str permission_link: The link to the permission. :param dict permission: :param dict options: The request options for the request. :return: The new Permission. :rtype: dict
def ReplacePermission(self, permission_link, permission, options=None): """Replaces a permission and return it. :param str permission_link: The link to the permission. :param dict permission: :param dict options: The request options for the request. :ret...
Deletes a permission. :param str permission_link: The link to the permission. :param dict options: The request options for the request. :return: The deleted Permission. :rtype: dict
def DeletePermission(self, permission_link, options=None): """Deletes a permission. :param str permission_link: The link to the permission. :param dict options: The request options for the request. :return: The deleted Permission. :rtype: ...
Reads all documents in a collection. :param str collection_link: The link to the document collection. :param dict feed_options: :return: Query Iterable of Documents. :rtype: query_iterable.QueryIterable
def ReadItems(self, collection_link, feed_options=None): """Reads all documents in a collection. :param str collection_link: The link to the document collection. :param dict feed_options: :return: Query Iterable of Documents. :rtype: query_it...
Queries documents in a collection. :param str database_or_Container_link: The link to the database when using partitioning, otherwise link to the document collection. :param (str or dict) query: :param dict options: The request options for the request. :param str...
def QueryItems(self, database_or_Container_link, query, options=None, partition_key=None): """Queries documents in a collection. :param str database_or_Container_link: The link to the database when using partitioning, otherwise link to the document collection. :param (str or dict) q...
Queries documents change feed in a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. options may also specify partition key range id. :return: Query Iterable of ...
def QueryItemsChangeFeed(self, collection_link, options=None): """Queries documents change feed in a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. options may also specif...
Queries change feed of a resource in a collection. :param str collection_link: The link to the document collection. :param str resource_type: The type of the resource. :param dict options: The request options for the request. :param str partition_key_...
def _QueryChangeFeed(self, collection_link, resource_type, options=None, partition_key_range_id=None): """Queries change feed of a resource in a collection. :param str collection_link: The link to the document collection. :param str resource_type: The type of the resourc...
Reads Partition Key Ranges. :param str collection_link: The link to the document collection. :param dict feed_options: :return: Query Iterable of PartitionKeyRanges. :rtype: query_iterable.QueryIterable
def _ReadPartitionKeyRanges(self, collection_link, feed_options=None): """Reads Partition Key Ranges. :param str collection_link: The link to the document collection. :param dict feed_options: :return: Query Iterable of PartitionKeyRanges. :rtype: ...
Creates a document in a collection. :param str database_or_Container_link: The link to the database when using partitioning, otherwise link to the document collection. :param dict document: The Azure Cosmos document to create. :param dict options: The request...
def CreateItem(self, database_or_Container_link, document, options=None): """Creates a document in a collection. :param str database_or_Container_link: The link to the database when using partitioning, otherwise link to the document collection. :param dict document: The ...
Upserts a document in a collection. :param str database_or_Container_link: The link to the database when using partitioning, otherwise link to the document collection. :param dict document: The Azure Cosmos document to upsert. :param dict options: The request...
def UpsertItem(self, database_or_Container_link, document, options=None): """Upserts a document in a collection. :param str database_or_Container_link: The link to the database when using partitioning, otherwise link to the document collection. :param dict document: The ...
Reads a document. :param str document_link: The link to the document. :param dict options: The request options for the request. :return: The read Document. :rtype: dict
def ReadItem(self, document_link, options=None): """Reads a document. :param str document_link: The link to the document. :param dict options: The request options for the request. :return: The read Document. :rtype: dict ...
Reads all triggers in a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. :return: Query Iterable of Triggers. :rtype: query_iterable.QueryIterable
def ReadTriggers(self, collection_link, options=None): """Reads all triggers in a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. :return: Query Iterable of Trigge...
Creates a trigger in a collection. :param str collection_link: The link to the document collection. :param dict trigger: :param dict options: The request options for the request. :return: The created Trigger. :rtype: dict
def CreateTrigger(self, collection_link, trigger, options=None): """Creates a trigger in a collection. :param str collection_link: The link to the document collection. :param dict trigger: :param dict options: The request options for the request. :return...
Upserts a trigger in a collection. :param str collection_link: The link to the document collection. :param dict trigger: :param dict options: The request options for the request. :return: The upserted Trigger. :rtype: dict
def UpsertTrigger(self, collection_link, trigger, options=None): """Upserts a trigger in a collection. :param str collection_link: The link to the document collection. :param dict trigger: :param dict options: The request options for the request. :return...
Reads a trigger. :param str trigger_link: The link to the trigger. :param dict options: The request options for the request. :return: The read Trigger. :rtype: dict
def ReadTrigger(self, trigger_link, options=None): """Reads a trigger. :param str trigger_link: The link to the trigger. :param dict options: The request options for the request. :return: The read Trigger. :rtype: dict ""...
Reads all user defined functions in a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. :return: Query Iterable of UDFs. :rtype: query_iterable.QueryIter...
def ReadUserDefinedFunctions(self, collection_link, options=None): """Reads all user defined functions in a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. :return: ...
Queries user defined functions in a collection. :param str collection_link: The link to the collection. :param (str or dict) query: :param dict options: The request options for the request. :return: Query Iterable of UDFs. :rtype: ...
def QueryUserDefinedFunctions(self, collection_link, query, options=None): """Queries user defined functions in a collection. :param str collection_link: The link to the collection. :param (str or dict) query: :param dict options: The request options for the requ...
Creates a user defined function in a collection. :param str collection_link: The link to the collection. :param str udf: :param dict options: The request options for the request. :return: The created UDF. :rtype: dict
def CreateUserDefinedFunction(self, collection_link, udf, options=None): """Creates a user defined function in a collection. :param str collection_link: The link to the collection. :param str udf: :param dict options: The request options for the request. ...