_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q224800
CatGUI.on_click_search_widget
train
def on_click_search_widget(self, event): """ When the search control is toggled, set visibility and hand down cats""" self.search.cats = self.cats self.search.visible = event.new if self.search.visible: self.search.watchers.append( self.select.widget.link(self...
python
{ "resource": "" }
q224801
no_duplicates_constructor
train
def no_duplicates_constructor(loader, node, deep=False): """Check for duplicate keys while loading YAML https://gist.github.com/pypt/94d747fe5180851196eb """ mapping = {} for key_node, value_node in node.value: key = loader.construct_object(key_node, deep=deep) value = loader.const...
python
{ "resource": "" }
q224802
classname
train
def classname(ob): """Get the object's class's name as package.module.Class""" import inspect if inspect.isclass(ob): return '.'.join([ob.__module__, ob.__name__]) else: return '.'.join([ob.__class__.__module__, ob.__class__.__name__])
python
{ "resource": "" }
q224803
pretty_describe
train
def pretty_describe(object, nestedness=0, indent=2): """Maintain dict ordering - but make string version prettier""" if not isinstance(object, dict): return str(object) sep = f'\n{" " * nestedness * indent}' out = sep.join((f'{k}: {pretty_describe(v, nestedness + 1)}' for k, v in object.items())...
python
{ "resource": "" }
q224804
GUI.add
train
def add(self, *args, **kwargs): """Add to list of cats""" return self.cat.select.add(*args, **kwargs)
python
{ "resource": "" }
q224805
coerce_to_list
train
def coerce_to_list(items, preprocess=None): """Given an instance or list, coerce to list. With optional preprocessing. """ if not isinstance(items, list): items = [items] if preprocess: items = list(map(preprocess, items)) return items
python
{ "resource": "" }
q224806
Base._repr_mimebundle_
train
def _repr_mimebundle_(self, *args, **kwargs): """Display in a notebook or a server""" try: if self.logo: p = pn.Row( self.logo_panel, self.panel, margin=0) return p._repr_mimebundle_(*args, **kwargs) ...
python
{ "resource": "" }
q224807
Base.unwatch
train
def unwatch(self): """Get rid of any lingering watchers and remove from list""" if self.watchers is not None: unwatched = [] for watcher in self.watchers: watcher.inst.param.unwatch(watcher) unwatched.append(watcher) self.watchers = [w ...
python
{ "resource": "" }
q224808
BaseSelector._create_options
train
def _create_options(self, items): """Helper method to create options from list, or instance. Applies preprocess method if available to create a uniform output """ return OrderedDict(map(lambda x: (x.name, x), coerce_to_list(items, self.preprocess)))
python
{ "resource": "" }
q224809
BaseSelector.options
train
def options(self, new): """Set options from list, or instance of named item Over-writes old options """ options = self._create_options(new) if self.widget.value: self.widget.set_param(options=options, value=list(options.values())[:1]) else: self.w...
python
{ "resource": "" }
q224810
BaseSelector.add
train
def add(self, items): """Add items to options""" options = self._create_options(items) for k, v in options.items(): if k in self.labels and v not in self.items: options.pop(k) count = 0 while f'{k}_{count}' in self.labels: ...
python
{ "resource": "" }
q224811
BaseSelector.remove
train
def remove(self, items): """Remove items from options""" items = coerce_to_list(items) new_options = {k: v for k, v in self.options.items() if v not in items} self.widget.options = new_options self.widget.param.trigger('options')
python
{ "resource": "" }
q224812
BaseSelector.selected
train
def selected(self, new): """Set selected from list or instance of object or name. Over-writes existing selection """ def preprocess(item): if isinstance(item, str): return self.options[item] return item items = coerce_to_list(new, preproce...
python
{ "resource": "" }
q224813
BaseView.source
train
def source(self, source): """When the source gets updated, update the select widget""" if isinstance(source, list): # if source is a list, get first item or None source = source[0] if len(source) > 0 else None self._source = source
python
{ "resource": "" }
q224814
SourceGUI.callback
train
def callback(self, sources): """When a source is selected, enable widgets that depend on that condition and do done_callback""" enable = bool(sources) if not enable: self.plot_widget.value = False enable_widget(self.plot_widget, enable) if self.done_callback:...
python
{ "resource": "" }
q224815
SourceGUI.on_click_plot_widget
train
def on_click_plot_widget(self, event): """ When the plot control is toggled, set visibility and hand down source""" self.plot.source = self.sources self.plot.visible = event.new if self.plot.visible: self.plot.watchers.append( self.select.widget.link(self.plot...
python
{ "resource": "" }
q224816
sanitize_path
train
def sanitize_path(path): """Utility for cleaning up paths.""" storage_option = infer_storage_options(path) protocol = storage_option['protocol'] if protocol in ('http', 'https'): # Most FSs remove the protocol but not HTTPFS. We need to strip # it to match properly. path = os.p...
python
{ "resource": "" }
q224817
_download
train
def _download(file_in, file_out, blocksize, output=False): """Read from input and write to output file in blocks""" with warnings.catch_warnings(): warnings.filterwarnings('ignore') if output: try: from tqdm.autonotebook import tqdm except ImportError: ...
python
{ "resource": "" }
q224818
make_caches
train
def make_caches(driver, specs, catdir=None, cache_dir=None, storage_options={}): """ Creates Cache objects from the cache_specs provided in the catalog yaml file Parameters ---------- driver: str Name of the plugin that can load catalog entry specs: list Specification for cachi...
python
{ "resource": "" }
q224819
BaseCache.load
train
def load(self, urlpath, output=None, **kwargs): """ Downloads data from a given url, generates a hashed filename, logs metadata, and caches it locally. Parameters ---------- urlpath: str, location of data May be a local path, or remote path if including a pr...
python
{ "resource": "" }
q224820
BaseCache._load
train
def _load(self, files_in, files_out, urlpath, meta=True): """Download a set of files""" import dask out = [] outnames = [] for file_in, file_out in zip(files_in, files_out): cache_path = file_out.path outnames.append(cache_path) # If `_munge_p...
python
{ "resource": "" }
q224821
BaseCache.clear_cache
train
def clear_cache(self, urlpath): """ Clears cache and metadata for a given urlpath. Parameters ---------- urlpath: str, location of data May be a local path, or remote path if including a protocol specifier such as ``'s3://'``. May include glob wildcards....
python
{ "resource": "" }
q224822
BaseCache.clear_all
train
def clear_all(self): """ Clears all cache and metadata. """ for urlpath in self._metadata.keys(): self.clear_cache(urlpath) # Safely clean up anything else. if not os.path.isdir(self._cache_dir): return for subdir in os.listdir(self._cache...
python
{ "resource": "" }
q224823
write_json
train
def write_json(dictionary, filename): """Write dictionary to JSON""" with open(filename, 'w') as data_file: json.dump(dictionary, data_file, indent=4, sort_keys=True) print('--> Wrote ' + os.path.basename(filename))
python
{ "resource": "" }
q224824
compare
train
def compare(dicts): """Compare by iteration""" common_members = {} common_keys = reduce(lambda x, y: x & y, map(dict.keys, dicts)) for k in common_keys: common_members[k] = list( reduce(lambda x, y: x & y, [set(d[k]) for d in dicts])) return common_members
python
{ "resource": "" }
q224825
sort_common_members
train
def sort_common_members(): """Sorts the keys and members""" filename = PREFIX + '/common_members.json' sorted_json_data = {} json_data = read_json(filename) all_keys = [] for key, value in json_data.items(): all_keys.append(key) sorted_keys = sorted(all_keys) for key in sorted...
python
{ "resource": "" }
q224826
generate_common_members
train
def generate_common_members(): """Generate JSON with commonly shared members""" pyside = read_json(PREFIX + '/PySide.json') pyside2 = read_json(PREFIX + '/PySide2.json') pyqt4 = read_json(PREFIX + '/PyQt4.json') pyqt5 = read_json(PREFIX + '/PyQt5.json') dicts = [pyside, pyside2, pyqt4, pyqt5] ...
python
{ "resource": "" }
q224827
parse
train
def parse(fname): """Return blocks of code as list of dicts Arguments: fname (str): Relative name of caveats file """ blocks = list() with io.open(fname, "r", encoding="utf-8") as f: in_block = False current_block = None current_header = "" for line in f: ...
python
{ "resource": "" }
q224828
_qInstallMessageHandler
train
def _qInstallMessageHandler(handler): """Install a message handler that works in all bindings Args: handler: A function that takes 3 arguments, or None """ def messageOutputHandler(*args): # In Qt4 bindings, message handlers are passed 2 arguments # In Qt5 bindings, message hand...
python
{ "resource": "" }
q224829
_import_sub_module
train
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
python
{ "resource": "" }
q224830
_setup
train
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...
python
{ "resource": "" }
q224831
_build_compatibility_members
train
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 ...
python
{ "resource": "" }
q224832
_convert
train
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...
python
{ "resource": "" }
q224833
update_compatibility_decorators
train
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 ...
python
{ "resource": "" }
q224834
load_ui_type
train
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...
python
{ "resource": "" }
q224835
pyside_load_ui
train
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. ...
python
{ "resource": "" }
q224836
ExplicitlyExcludeFromIndex
train
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. ...
python
{ "resource": "" }
q224837
ExcludePathsFromIndex
train
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...
python
{ "resource": "" }
q224838
UseRangeIndexesOnStrings
train
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...
python
{ "resource": "" }
q224839
RangePartitionResolver.ResolveForCreate
train
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...
python
{ "resource": "" }
q224840
RangePartitionResolver._GetContainingRange
train
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
python
{ "resource": "" }
q224841
RangePartitionResolver._GetIntersectingRanges
train
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_...
python
{ "resource": "" }
q224842
QueryIterable._create_execution_context
train
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....
python
{ "resource": "" }
q224843
_Execute
train
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...
python
{ "resource": "" }
q224844
_GlobalEndpointManager._GetDatabaseAccount
train
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...
python
{ "resource": "" }
q224845
_Partition.CompareTo
train
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...
python
{ "resource": "" }
q224846
_MurmurHash.ComputeHash
train
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: ...
python
{ "resource": "" }
q224847
_MurmurHash._ComputeHash
train
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 ...
python
{ "resource": "" }
q224848
VectorSessionToken.create
train
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 = {}...
python
{ "resource": "" }
q224849
_ConsistentHashRing._ConstructPartitions
train
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...
python
{ "resource": "" }
q224850
_ConsistentHashRing._FindPartition
train
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)
python
{ "resource": "" }
q224851
_ConsistentHashRing._GetSerializedPartitionList
train
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])) ...
python
{ "resource": "" }
q224852
_ConsistentHashRing._GetBytes
train
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)) + " ...
python
{ "resource": "" }
q224853
_ConsistentHashRing._LowerBoundSearch
train
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...
python
{ "resource": "" }
q224854
_QueryExecutionContextBase._fetch_items_helper_no_retries
train
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 ...
python
{ "resource": "" }
q224855
_MultiCollectionQueryExecutionContext._fetch_next_block
train
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 ...
python
{ "resource": "" }
q224856
Range.Contains
train
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 ...
python
{ "resource": "" }
q224857
Range.Intersect
train
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 ...
python
{ "resource": "" }
q224858
CosmosClient.RegisterPartitionResolver
train
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...
python
{ "resource": "" }
q224859
CosmosClient.GetPartitionResolver
train
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...
python
{ "resource": "" }
q224860
CosmosClient.CreateDatabase
train
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...
python
{ "resource": "" }
q224861
CosmosClient.ReadDatabase
train
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 ...
python
{ "resource": "" }
q224862
CosmosClient.QueryDatabases
train
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 ...
python
{ "resource": "" }
q224863
CosmosClient.ReadContainers
train
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. ...
python
{ "resource": "" }
q224864
CosmosClient.CreateContainer
train
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...
python
{ "resource": "" }
q224865
CosmosClient.ReplaceContainer
train
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 ...
python
{ "resource": "" }
q224866
CosmosClient.ReadContainer
train
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: ...
python
{ "resource": "" }
q224867
CosmosClient.UpsertUser
train
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...
python
{ "resource": "" }
q224868
CosmosClient.ReadUser
train
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...
python
{ "resource": "" }
q224869
CosmosClient.ReadUsers
train
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: ...
python
{ "resource": "" }
q224870
CosmosClient.QueryUsers
train
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...
python
{ "resource": "" }
q224871
CosmosClient.DeleteDatabase
train
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...
python
{ "resource": "" }
q224872
CosmosClient.CreatePermission
train
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...
python
{ "resource": "" }
q224873
CosmosClient.UpsertPermission
train
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...
python
{ "resource": "" }
q224874
CosmosClient.ReadPermission
train
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: ...
python
{ "resource": "" }
q224875
CosmosClient.ReadPermissions
train
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...
python
{ "resource": "" }
q224876
CosmosClient.QueryPermissions
train
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...
python
{ "resource": "" }
q224877
CosmosClient.ReplaceUser
train
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. ...
python
{ "resource": "" }
q224878
CosmosClient.DeleteUser
train
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 """ ...
python
{ "resource": "" }
q224879
CosmosClient.ReplacePermission
train
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...
python
{ "resource": "" }
q224880
CosmosClient.DeletePermission
train
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: ...
python
{ "resource": "" }
q224881
CosmosClient.ReadItems
train
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...
python
{ "resource": "" }
q224882
CosmosClient.QueryItems
train
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...
python
{ "resource": "" }
q224883
CosmosClient.QueryItemsChangeFeed
train
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...
python
{ "resource": "" }
q224884
CosmosClient._QueryChangeFeed
train
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...
python
{ "resource": "" }
q224885
CosmosClient._ReadPartitionKeyRanges
train
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: ...
python
{ "resource": "" }
q224886
CosmosClient.CreateItem
train
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 ...
python
{ "resource": "" }
q224887
CosmosClient.UpsertItem
train
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 ...
python
{ "resource": "" }
q224888
CosmosClient.ReadItem
train
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 ...
python
{ "resource": "" }
q224889
CosmosClient.ReadTriggers
train
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...
python
{ "resource": "" }
q224890
CosmosClient.CreateTrigger
train
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...
python
{ "resource": "" }
q224891
CosmosClient.UpsertTrigger
train
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...
python
{ "resource": "" }
q224892
CosmosClient.ReadTrigger
train
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 ""...
python
{ "resource": "" }
q224893
CosmosClient.ReadUserDefinedFunctions
train
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: ...
python
{ "resource": "" }
q224894
CosmosClient.QueryUserDefinedFunctions
train
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...
python
{ "resource": "" }
q224895
CosmosClient.CreateUserDefinedFunction
train
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. ...
python
{ "resource": "" }
q224896
CosmosClient.UpsertUserDefinedFunction
train
def UpsertUserDefinedFunction(self, collection_link, udf, options=None): """Upserts 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. ...
python
{ "resource": "" }
q224897
CosmosClient.ReadUserDefinedFunction
train
def ReadUserDefinedFunction(self, udf_link, options=None): """Reads a user defined function. :param str udf_link: The link to the user defined function. :param dict options: The request options for the request. :return: The read UDF. :rtype: ...
python
{ "resource": "" }
q224898
CosmosClient.ReadStoredProcedures
train
def ReadStoredProcedures(self, collection_link, options=None): """Reads all store procedures in a collection. :param str collection_link: The link to the document collection. :param dict options: The request options for the request. :return: Query It...
python
{ "resource": "" }
q224899
CosmosClient.CreateStoredProcedure
train
def CreateStoredProcedure(self, collection_link, sproc, options=None): """Creates a stored procedure in a collection. :param str collection_link: The link to the document collection. :param str sproc: :param dict options: The request options for the request. ...
python
{ "resource": "" }