INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Defer the message. | def defer(self):
"""Defer the message.
This message will remain in the queue but must be received
specifically by its sequence number in order to be processed.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servic... |
Move the message to the Dead Letter queue. | def dead_letter(self, description=None):
"""Move the message to the Dead Letter queue.
The Dead Letter queue is a sub-queue that can be
used to store messages that failed to process correctly, or otherwise require further inspection
or processing. The queue can also be configured to sen... |
Abandon the message. | def abandon(self):
"""Abandon the message.
This message will be returned to the queue to be reprocessed.
:raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
:raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has alrea... |
Gives the sas - url to download the configurations for vpn - sites in a resource group. | def download(
self, resource_group_name, virtual_wan_name, vpn_sites=None, output_blob_sas_url=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Gives the sas-url to download the configurations for vpn-sites in a
resource group.
:param resource_group_name: ... |
Module depends on the API version: | def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2015-06-15: :mod:`v2015_06_15.models<azure.mgmt.compute.v2015_06_15.models>`
* 2016-03-30: :mod:`v2016_03_30.models<azure.mgmt.compute.v2016_03_30.models>`
* 2016-04-30-preview: :mod:`v201... |
Instance depends on the API version: | def disks(self):
"""Instance depends on the API version:
* 2016-04-30-preview: :class:`DisksOperations<azure.mgmt.compute.v2016_04_30_preview.operations.DisksOperations>`
* 2017-03-30: :class:`DisksOperations<azure.mgmt.compute.v2017_03_30.operations.DisksOperations>`
* 2018-04... |
Instance depends on the API version: | def galleries(self):
"""Instance depends on the API version:
* 2018-06-01: :class:`GalleriesOperations<azure.mgmt.compute.v2018_06_01.operations.GalleriesOperations>`
* 2019-03-01: :class:`GalleriesOperations<azure.mgmt.compute.v2019_03_01.operations.GalleriesOperations>`
"""
... |
Instance depends on the API version: | def gallery_image_versions(self):
"""Instance depends on the API version:
* 2018-06-01: :class:`GalleryImageVersionsOperations<azure.mgmt.compute.v2018_06_01.operations.GalleryImageVersionsOperations>`
* 2019-03-01: :class:`GalleryImageVersionsOperations<azure.mgmt.compute.v2019_03_01.ope... |
Instance depends on the API version: | def gallery_images(self):
"""Instance depends on the API version:
* 2018-06-01: :class:`GalleryImagesOperations<azure.mgmt.compute.v2018_06_01.operations.GalleryImagesOperations>`
* 2019-03-01: :class:`GalleryImagesOperations<azure.mgmt.compute.v2019_03_01.operations.GalleryImagesOperatio... |
Instance depends on the API version: | def images(self):
"""Instance depends on the API version:
* 2016-04-30-preview: :class:`ImagesOperations<azure.mgmt.compute.v2016_04_30_preview.operations.ImagesOperations>`
* 2017-03-30: :class:`ImagesOperations<azure.mgmt.compute.v2017_03_30.operations.ImagesOperations>`
* 20... |
Instance depends on the API version: | def log_analytics(self):
"""Instance depends on the API version:
* 2017-12-01: :class:`LogAnalyticsOperations<azure.mgmt.compute.v2017_12_01.operations.LogAnalyticsOperations>`
* 2018-04-01: :class:`LogAnalyticsOperations<azure.mgmt.compute.v2018_04_01.operations.LogAnalyticsOperations>`
... |
Instance depends on the API version: | def resource_skus(self):
"""Instance depends on the API version:
* 2017-03-30: :class:`ResourceSkusOperations<azure.mgmt.compute.v2017_03_30.operations.ResourceSkusOperations>`
* 2017-09-01: :class:`ResourceSkusOperations<azure.mgmt.compute.v2017_09_01.operations.ResourceSkusOperations>`
... |
Instance depends on the API version: | def usage(self):
"""Instance depends on the API version:
* 2015-06-15: :class:`UsageOperations<azure.mgmt.compute.v2015_06_15.operations.UsageOperations>`
* 2016-03-30: :class:`UsageOperations<azure.mgmt.compute.v2016_03_30.operations.UsageOperations>`
* 2016-04-30-preview: :cl... |
Guess Python Autorest options based on the spec path. | def guess_service_info_from_path(spec_path):
"""Guess Python Autorest options based on the spec path.
Expected path:
specification/compute/resource-manager/readme.md
"""
spec_path = spec_path.lower()
spec_path = spec_path[spec_path.index("specification"):] # Might raise and it's ok
split_sp... |
Open handler connection and authenticate session. | def open(self):
"""Open handler connection and authenticate session.
If the handler is already open, this operation will do nothing.
A handler opened with this method must be explicitly closed.
It is recommended to open a handler within a context manager as
opposed to calling th... |
Updates a running PowerShell command with more data. | def update_command(
self, resource_group_name, node_name, session, pssession, custom_headers=None, raw=False, polling=True, **operation_config):
"""Updates a running PowerShell command with more data.
:param resource_group_name: The resource group name uniquely
identifies the resou... |
Deletes the managed application definition. | def delete_by_id(
self, application_definition_id, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes the managed application definition.
:param application_definition_id: The fully qualified ID of the
managed application definition, including the managed... |
Creates a new managed application definition. | def create_or_update_by_id(
self, application_definition_id, parameters, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates a new managed application definition.
:param application_definition_id: The fully qualified ID of the
managed application definitio... |
Module depends on the API version: | def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2016-04-01: :mod:`v2016_04_01.models<azure.mgmt.dns.v2016_04_01.models>`
* 2018-03-01-preview: :mod:`v2018_03_01_preview.models<azure.mgmt.dns.v2018_03_01_preview.models>`
* 2018-05-01: :m... |
Instance depends on the API version: | def dns_resource_reference(self):
"""Instance depends on the API version:
* 2018-05-01: :class:`DnsResourceReferenceOperations<azure.mgmt.dns.v2018_05_01.operations.DnsResourceReferenceOperations>`
"""
api_version = self._get_api_version('dns_resource_reference')
if api_versi... |
Instance depends on the API version: | def record_sets(self):
"""Instance depends on the API version:
* 2016-04-01: :class:`RecordSetsOperations<azure.mgmt.dns.v2016_04_01.operations.RecordSetsOperations>`
* 2018-03-01-preview: :class:`RecordSetsOperations<azure.mgmt.dns.v2018_03_01_preview.operations.RecordSetsOperations>`
... |
Instance depends on the API version: | def zones(self):
"""Instance depends on the API version:
* 2016-04-01: :class:`ZonesOperations<azure.mgmt.dns.v2016_04_01.operations.ZonesOperations>`
* 2018-03-01-preview: :class:`ZonesOperations<azure.mgmt.dns.v2018_03_01_preview.operations.ZonesOperations>`
* 2018-05-01: :cl... |
Module depends on the API version: | def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2016-10-01: :mod:`v2016_10_01.models<azure.mgmt.keyvault.v2016_10_01.models>`
* 2018-02-14: :mod:`v2018_02_14.models<azure.mgmt.keyvault.v2018_02_14.models>`
"""
if api_version == '20... |
The Bing Spell Check API lets you perform contextual grammar and spell checking. Bing has developed a web - based spell - checker that leverages machine learning and statistical machine translation to dynamically train a constantly evolving and highly contextual algorithm. The spell - checker is based on a massive corp... | def spell_checker(
self, text, accept_language=None, pragma=None, user_agent=None, client_id=None, client_ip=None, location=None, action_type=None, app_name=None, country_code=None, client_machine_name=None, doc_id=None, market=None, session_id=None, set_lang=None, user_id=None, mode=None, pre_context_text=... |
Sets the proxy server host and port for the HTTP CONNECT Tunnelling. | def set_proxy(self, host, port, user, password):
'''
Sets the proxy server host and port for the HTTP CONNECT Tunnelling.
host:
Address of the proxy. Ex: '192.168.0.100'
port:
Port of the proxy. Ex: 6000
user:
User for proxy authorization.
... |
Return the target uri for the request. | def get_uri(self, request):
''' Return the target uri for the request.'''
protocol = request.protocol_override \
if request.protocol_override else self.protocol
protocol = protocol.lower()
port = HTTP_PORT if protocol == 'http' else HTTPS_PORT
return protocol + '://' ... |
Create connection for the request. | def get_connection(self, request):
''' Create connection for the request. '''
protocol = request.protocol_override \
if request.protocol_override else self.protocol
protocol = protocol.lower()
target_host = request.host
# target_port = HTTP_PORT if protocol == 'http' ... |
Sends request to cloud service server and return the response. | def perform_request(self, request):
''' Sends request to cloud service server and return the response. '''
connection = self.get_connection(request)
try:
connection.putrequest(request.method, request.path)
self.send_request_headers(connection, request.headers)
... |
Executes script actions on the specified HDInsight cluster. | def execute_script_actions(
self, resource_group_name, cluster_name, persist_on_success, script_actions=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Executes script actions on the specified HDInsight cluster.
:param resource_group_name: The name of the resourc... |
Module depends on the API version: | def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2015-08-01: :mod:`v2015_08_01.models<azure.mgmt.eventhub.v2015_08_01.models>`
* 2017-04-01: :mod:`v2017_04_01.models<azure.mgmt.eventhub.v2017_04_01.models>`
* 2018-01-01-preview: :mod:`v2... |
Instance depends on the API version: | def clusters(self):
"""Instance depends on the API version:
* 2018-01-01-preview: :class:`ClustersOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.ClustersOperations>`
"""
api_version = self._get_api_version('clusters')
if api_version == '2018-01-01-preview':
... |
Instance depends on the API version: | def configuration(self):
"""Instance depends on the API version:
* 2018-01-01-preview: :class:`ConfigurationOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.ConfigurationOperations>`
"""
api_version = self._get_api_version('configuration')
if api_version == '2018... |
Instance depends on the API version: | def consumer_groups(self):
"""Instance depends on the API version:
* 2015-08-01: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2015_08_01.operations.ConsumerGroupsOperations>`
* 2017-04-01: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2017_04_01.operations.ConsumerGroupsO... |
Instance depends on the API version: | def disaster_recovery_configs(self):
"""Instance depends on the API version:
* 2017-04-01: :class:`DisasterRecoveryConfigsOperations<azure.mgmt.eventhub.v2017_04_01.operations.DisasterRecoveryConfigsOperations>`
"""
api_version = self._get_api_version('disaster_recovery_configs')
... |
Instance depends on the API version: | def event_hubs(self):
"""Instance depends on the API version:
* 2015-08-01: :class:`EventHubsOperations<azure.mgmt.eventhub.v2015_08_01.operations.EventHubsOperations>`
* 2017-04-01: :class:`EventHubsOperations<azure.mgmt.eventhub.v2017_04_01.operations.EventHubsOperations>`
"""
... |
Instance depends on the API version: | def namespaces(self):
"""Instance depends on the API version:
* 2015-08-01: :class:`NamespacesOperations<azure.mgmt.eventhub.v2015_08_01.operations.NamespacesOperations>`
* 2017-04-01: :class:`NamespacesOperations<azure.mgmt.eventhub.v2017_04_01.operations.NamespacesOperations>`
... |
Instance depends on the API version: | def regions(self):
"""Instance depends on the API version:
* 2017-04-01: :class:`RegionsOperations<azure.mgmt.eventhub.v2017_04_01.operations.RegionsOperations>`
"""
api_version = self._get_api_version('regions')
if api_version == '2017-04-01':
from .v2017_04_01.o... |
Check the availability of a Front Door resource name. | def check_front_door_name_availability(
self, name, type, custom_headers=None, raw=False, **operation_config):
"""Check the availability of a Front Door resource name.
:param name: The resource name to validate.
:type name: str
:param type: The type of the resource whose nam... |
Permanently deletes the specified vault. aka Purges the deleted Azure key vault. | def purge_deleted(
self, vault_name, location, custom_headers=None, raw=False, polling=True, **operation_config):
"""Permanently deletes the specified vault. aka Purges the deleted Azure
key vault.
:param vault_name: The name of the soft-deleted vault.
:type vault_name: str
... |
Returns the URI for the authorization server if present otherwise empty string. | def get_authorization_server(self):
""" Returns the URI for the authorization server if present, otherwise empty string. """
value = ''
for key in ['authorization_uri', 'authorization']:
value = self.get_value(key) or ''
if value:
break
return valu... |
Extracts the host authority from the given URI. | def _validate_request_uri(self, uri):
""" Extracts the host authority from the given URI. """
if not uri:
raise ValueError('request_uri cannot be empty')
uri = parse.urlparse(uri)
if not uri.netloc:
raise ValueError('request_uri must be an absolute URI')
... |
Return a CLI profile class. | def get_cli_profile():
"""Return a CLI profile class.
.. versionadded:: 1.1.6
:return: A CLI Profile
:rtype: azure.cli.core._profile.Profile
:raises: ImportError if azure-cli-core package is not available
"""
try:
from azure.cli.core._profile import Profile
from azure.cli.... |
Return Credentials and default SubscriptionID of current loaded profile of the CLI. | def get_azure_cli_credentials(resource=None, with_tenant=False):
"""Return Credentials and default SubscriptionID of current loaded profile of the CLI.
Credentials will be the "az login" command:
https://docs.microsoft.com/cli/azure/authenticate-azure-cli
Default subscription ID is either the only one... |
List all the existing alerts where the results can be selective by passing multiple filter parameters including time range and sorted on specific fields.. | def get_all(
self, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_service=None, monitor_condition=None, severity=None, alert_state=None, alert_rule=None, smart_group_id=None, include_context=None, include_egress_config=None, page_count=None, sort_by=None, sort_order=Non... |
Summary of alerts with the count each severity. | def get_summary(
self, groupby, include_smart_groups_count=None, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_service=None, monitor_condition=None, severity=None, alert_state=None, alert_rule=None, time_range=None, custom_time_range=None, custom_headers=None, raw=Fals... |
Submit an operation to take a snapshot of face list large face list person group or large person group with user - specified snapshot type source object id apply scope and an optional user data. <br/ > The snapshot interfaces are for users to backup and restore their face data from one face subscription to another insi... | def take(
self, type, object_id, apply_scope, user_data=None, custom_headers=None, raw=False, **operation_config):
"""Submit an operation to take a snapshot of face list, large face list,
person group or large person group, with user-specified snapshot type,
source object id, apply s... |
Submit an operation to apply a snapshot to current subscription. For each snapshot only subscriptions included in the applyScope of Snapshot - Take can apply it. <br/ > The snapshot interfaces are for users to backup and restore their face data from one face subscription to another inside same region or across regions.... | def apply(
self, snapshot_id, object_id, mode="CreateNew", custom_headers=None, raw=False, **operation_config):
"""Submit an operation to apply a snapshot to current subscription. For
each snapshot, only subscriptions included in the applyScope of
Snapshot - Take can apply it.<br />
... |
Gets predictions for a given utterance in the form of intents and entities. The current maximum query size is 500 characters. | def resolve(
self, app_id, query, timezone_offset=None, verbose=None, staging=None, spell_check=None, bing_spell_check_subscription_key=None, log=None, custom_headers=None, raw=False, **operation_config):
"""Gets predictions for a given utterance, in the form of intents and
entities. The cur... |
Check Name Availability for global uniqueness. | def check_name_availability_local(
self, location, name, type, custom_headers=None, raw=False, **operation_config):
"""Check Name Availability for global uniqueness.
:param location: The location in which uniqueness will be verified.
:type location: str
:param name: Resource... |
The Image Detail Search API lets you search on Bing and get back insights about an image such as webpages that include the image. This section provides technical details about the query parameters and headers that you use to request insights of images and the JSON response objects that contain them. For examples that s... | def details(
self, query, accept_language=None, content_type=None, user_agent=None, client_id=None, client_ip=None, location=None, crop_bottom=None, crop_left=None, crop_right=None, crop_top=None, crop_type=None, country_code=None, id=None, image_url=None, insights_token=None, modules=None, market=None, saf... |
The Image Trending Search API lets you search on Bing and get back a list of images that are trending based on search requests made by others. The images are broken out into different categories. For example Popular People Searches. For a list of markets that support trending images see [ Trending Images ] ( https:// d... | def trending(
self, accept_language=None, user_agent=None, client_id=None, client_ip=None, location=None, country_code=None, market=None, safe_search=None, set_lang=None, custom_headers=None, raw=False, **operation_config):
"""The Image Trending Search API lets you search on Bing and get back a
... |
Opens the request. | def open(self, method, url):
'''
Opens the request.
method:
the request VERB 'GET', 'POST', etc.
url:
the url to connect
'''
flag = VARIANT.create_bool_false()
_method = BSTR(method)
_url = BSTR(url)
_WinHttpRequest._Open(s... |
Sets up the timeout for the request. | def set_timeout(self, timeout_in_seconds):
''' Sets up the timeout for the request. '''
timeout_in_ms = int(timeout_in_seconds * 1000)
_WinHttpRequest._SetTimeouts(
self, 0, timeout_in_ms, timeout_in_ms, timeout_in_ms) |
Sets the request header. | def set_request_header(self, name, value):
''' Sets the request header. '''
_name = BSTR(name)
_value = BSTR(value)
_WinHttpRequest._SetRequestHeader(self, _name, _value) |
Gets back all response headers. | def get_all_response_headers(self):
''' Gets back all response headers. '''
bstr_headers = c_void_p()
_WinHttpRequest._GetAllResponseHeaders(self, byref(bstr_headers))
bstr_headers = ctypes.cast(bstr_headers, c_wchar_p)
headers = bstr_headers.value
_SysFreeString(bstr_he... |
Sends the request body. | def send(self, request=None):
''' Sends the request body. '''
# Sends VT_EMPTY if it is GET, HEAD request.
if request is None:
var_empty = VARIANT.create_empty()
_WinHttpRequest._Send(self, var_empty)
else: # Sends request body as SAFEArray.
_request... |
Gets status of response. | def status(self):
''' Gets status of response. '''
status = c_long()
_WinHttpRequest._Status(self, byref(status))
return int(status.value) |
Gets status text of response. | def status_text(self):
''' Gets status text of response. '''
bstr_status_text = c_void_p()
_WinHttpRequest._StatusText(self, byref(bstr_status_text))
bstr_status_text = ctypes.cast(bstr_status_text, c_wchar_p)
status_text = bstr_status_text.value
_SysFreeString(bstr_stat... |
Gets response body as a SAFEARRAY and converts the SAFEARRAY to str. | def response_body(self):
'''
Gets response body as a SAFEARRAY and converts the SAFEARRAY to str.
'''
var_respbody = VARIANT()
_WinHttpRequest._ResponseBody(self, byref(var_respbody))
if var_respbody.is_safearray_of_bytes():
respbody = var_respbody.str_from_sa... |
Sets client certificate for the request. | def set_client_certificate(self, certificate):
'''Sets client certificate for the request. '''
_certificate = BSTR(certificate)
_WinHttpRequest._SetClientCertificate(self, _certificate) |
Sets up the host and the port for the HTTP CONNECT Tunnelling. | def set_tunnel(self, host, port):
''' Sets up the host and the port for the HTTP CONNECT Tunnelling.'''
url = host
if port:
url = url + u':' + port
var_host = VARIANT.create_bstr_from_str(url)
var_empty = VARIANT.create_empty()
_WinHttpRequest._SetProxy(
... |
Sets up the host and the port for the HTTP CONNECT Tunnelling. | def set_tunnel(self, host, port=None, headers=None):
''' Sets up the host and the port for the HTTP CONNECT Tunnelling. '''
self._httprequest.set_tunnel(unicode(host), unicode(str(port))) |
Connects to host and sends the request. | def putrequest(self, method, uri):
''' Connects to host and sends the request. '''
protocol = unicode(self.protocol + '://')
url = protocol + self.host + unicode(uri)
self._httprequest.set_timeout(self.timeout)
self._httprequest.open(unicode(method), url)
# sets certifi... |
Sends the headers of request. | def putheader(self, name, value):
''' Sends the headers of request. '''
if sys.version_info < (3,):
name = str(name).decode('utf-8')
value = str(value).decode('utf-8')
self._httprequest.set_request_header(name, value) |
Sends request body. | def send(self, request_body):
''' Sends request body. '''
if not request_body:
self._httprequest.send()
else:
self._httprequest.send(request_body) |
Gets the response and generates the _Response object | def getresponse(self):
''' Gets the response and generates the _Response object'''
status = self._httprequest.status()
status_text = self._httprequest.status_text()
resp_headers = self._httprequest.get_all_response_headers()
fixed_headers = []
for resp_header in resp_hea... |
simplified an id to be more friendly for us people | def _get_readable_id(id_name, id_prefix_to_skip):
"""simplified an id to be more friendly for us people"""
# id_name is in the form 'https://namespace.host.suffix/name'
# where name may contain a forward slash!
pos = id_name.find('//')
if pos != -1:
pos += 2
if id_prefix_to_skip:
... |
Adds common part of entry to a given entry body and return the whole xml. | def _create_entry(entry_body):
''' Adds common part of entry to a given entry body and return the whole
xml. '''
updated_str = datetime.utcnow().isoformat()
if datetime.utcnow().utcoffset() is None:
updated_str += '+00:00'
entry_start = '''<?xml version="1.0" encoding="utf-8" standalone="ye... |
converts a Python name into a serializable name | def _get_serialization_name(element_name):
"""converts a Python name into a serializable name"""
known = _KNOWN_SERIALIZATION_XFORMS.get(element_name)
if known is not None:
return known
if element_name.startswith('x_ms_'):
return element_name.replace('_', '-')
if element_name.endswi... |
Serialize bytes into base - 64 string.: param str: Object to be serialized.: rtype: str | def _bstr_to_b64url(bstr, **kwargs):
"""Serialize bytes into base-64 string.
:param str: Object to be serialized.
:rtype: str
"""
encoded = b64encode(bstr).decode()
return encoded.strip('=').replace('+', '-').replace('/', '_') |
Deserialize base64 encoded string into string.: param str b64str: response string to be deserialized.: rtype: bytearray: raises: TypeError if string format invalid. | def _b64_to_bstr(b64str):
"""Deserialize base64 encoded string into string.
:param str b64str: response string to be deserialized.
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
padding = '=' * (3 - (len(b64str) + 3) % 4)
b64str = b64str + padding
encoded = b64str.rep... |
Given query face s faceId to search the similar - looking faces from a faceId array a face list or a large face list. faceId array contains the faces created by [ Face - Detect ] (/ docs/ services/ 563879b61984550e40cbbe8d/ operations/ 563879b61984550f30395236 ) which will expire 24 hours after creation. A faceListId i... | def find_similar(
self, face_id, face_list_id=None, large_face_list_id=None, face_ids=None, max_num_of_candidates_returned=20, mode="matchPerson", custom_headers=None, raw=False, **operation_config):
"""Given query face's faceId, to search the similar-looking faces from a
faceId array, a fac... |
Detect human faces in an image return face rectangles and optionally with faceIds landmarks and attributes. <br/ > * Optional parameters including faceId landmarks and attributes. Attributes include age gender headPose smile facialHair glasses emotion hair makeup occlusion accessories blur exposure and noise. * The ext... | def detect_with_url(
self, url, return_face_id=True, return_face_landmarks=False, return_face_attributes=None, recognition_model="recognition_01", return_recognition_model=False, custom_headers=None, raw=False, **operation_config):
"""Detect human faces in an image, return face rectangles, and optio... |
Verify whether two faces belong to a same person. Compares a face Id with a Person Id. | def verify_face_to_person(
self, face_id, person_id, person_group_id=None, large_person_group_id=None, custom_headers=None, raw=False, **operation_config):
"""Verify whether two faces belong to a same person. Compares a face Id
with a Person Id.
:param face_id: FaceId of the face, c... |
Gets the challenge for the cached URL.: param url: the URL the challenge is cached for.: rtype: HttpBearerChallenge | def get_challenge_for_url(url):
""" Gets the challenge for the cached URL.
:param url: the URL the challenge is cached for.
:rtype: HttpBearerChallenge """
if not url:
raise ValueError('URL cannot be None')
url = parse.urlparse(url)
_lock.acquire()
val = _cache.get(url.netloc)
... |
Removes the cached challenge for the specified URL.: param url: the URL for which to remove the cached challenge | def remove_challenge_for_url(url):
""" Removes the cached challenge for the specified URL.
:param url: the URL for which to remove the cached challenge """
if not url:
raise ValueError('URL cannot be empty')
url = parse.urlparse(url)
_lock.acquire()
del _cache[url.netloc]
_lock.r... |
Caches the challenge for the specified URL.: param url: the URL for which to cache the challenge: param challenge: the challenge to cache | def set_challenge_for_url(url, challenge):
""" Caches the challenge for the specified URL.
:param url: the URL for which to cache the challenge
:param challenge: the challenge to cache """
if not url:
raise ValueError('URL cannot be empty')
if not challenge:
raise ValueError('Challe... |
Gets information about the specified job. | def get(
self, job_id, job_get_options=None, custom_headers=None, raw=False, **operation_config):
"""Gets information about the specified job.
:param job_id: The ID of the job.
:type job_id: str
:param job_get_options: Additional parameters for the operation
:type jo... |
Updates the properties of the specified job. | def patch(
self, job_id, job_patch_parameter, job_patch_options=None, custom_headers=None, raw=False, **operation_config):
"""Updates the properties of the specified job.
This replaces only the job properties specified in the request. For
example, if the job has constraints, and a r... |
Adds a job to the specified account. | def add(
self, job, job_add_options=None, custom_headers=None, raw=False, **operation_config):
"""Adds a job to the specified account.
The Batch service supports two ways to control the work done as part of
a job. In the first approach, the user specifies a Job Manager task.
... |
Lists all of the jobs in the specified account. | def list(
self, job_list_options=None, custom_headers=None, raw=False, **operation_config):
"""Lists all of the jobs in the specified account.
:param job_list_options: Additional parameters for the operation
:type job_list_options: ~azure.batch.models.JobListOptions
:param d... |
Module depends on the API version: | def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2015-06-01: :mod:`v2015_06_01.models<azure.mgmt.authorization.v2015_06_01.models>`
* 2015-07-01: :mod:`v2015_07_01.models<azure.mgmt.authorization.v2015_07_01.models>`
* 2018-01-01-preview... |
Instance depends on the API version: | def classic_administrators(self):
"""Instance depends on the API version:
* 2015-06-01: :class:`ClassicAdministratorsOperations<azure.mgmt.authorization.v2015_06_01.operations.ClassicAdministratorsOperations>`
"""
api_version = self._get_api_version('classic_administrators')
... |
Instance depends on the API version: | def deny_assignments(self):
"""Instance depends on the API version:
* 2018-07-01-preview: :class:`DenyAssignmentsOperations<azure.mgmt.authorization.v2018_07_01_preview.operations.DenyAssignmentsOperations>`
"""
api_version = self._get_api_version('deny_assignments')
if api_v... |
Instance depends on the API version: | def permissions(self):
"""Instance depends on the API version:
* 2015-07-01: :class:`PermissionsOperations<azure.mgmt.authorization.v2015_07_01.operations.PermissionsOperations>`
* 2018-01-01-preview: :class:`PermissionsOperations<azure.mgmt.authorization.v2018_01_01_preview.operations.Pe... |
Instance depends on the API version: | def provider_operations_metadata(self):
"""Instance depends on the API version:
* 2015-07-01: :class:`ProviderOperationsMetadataOperations<azure.mgmt.authorization.v2015_07_01.operations.ProviderOperationsMetadataOperations>`
* 2018-01-01-preview: :class:`ProviderOperationsMetadataOperati... |
Instance depends on the API version: | def role_assignments(self):
"""Instance depends on the API version:
* 2015-07-01: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2015_07_01.operations.RoleAssignmentsOperations>`
* 2018-01-01-preview: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2018_01_01_prev... |
Instance depends on the API version: | def role_definitions(self):
"""Instance depends on the API version:
* 2015-07-01: :class:`RoleDefinitionsOperations<azure.mgmt.authorization.v2015_07_01.operations.RoleDefinitionsOperations>`
* 2018-01-01-preview: :class:`RoleDefinitionsOperations<azure.mgmt.authorization.v2018_01_01_prev... |
Creates an xml fragment from the specified data. data: Array of tuples where first: xml element name second: xml element text third: conversion function | def _data_to_xml(data):
'''Creates an xml fragment from the specified data.
data:
Array of tuples, where first: xml element name
second:
xml element text
third:
... |
Parse the HTTPResponse s body and fill all the data into a class of return_type. | def parse_response(response, return_type):
'''
Parse the HTTPResponse's body and fill all the data into a class of
return_type.
'''
doc = minidom.parseString(response.body)
return_obj = return_type()
xml_name = return_type._xml_name if hasattr(return_type, '_xml_n... |
Parse the HTTPResponse s body and fill all the data into a class of return_type. | def parse_service_resources_response(response, return_type):
'''
Parse the HTTPResponse's body and fill all the data into a class of
return_type.
'''
doc = minidom.parseString(response.body)
return_obj = _list_of(return_type)
for node in _MinidomXmlToObject.get_ch... |
get properties from entry xml | def get_entry_properties_from_node(entry, include_id, id_prefix_to_skip=None, use_title_as_id=False):
''' get properties from entry xml '''
properties = {}
etag = entry.getAttributeNS(METADATA_NS, 'etag')
if etag:
properties['etag'] = etag
for updated in _MinidomXmlT... |
descends through a hierarchy of nodes returning the list of children at the inner most level. Only returns children who share a common parent not cousins. | def get_children_from_path(node, *path):
'''descends through a hierarchy of nodes returning the list of children
at the inner most level. Only returns children who share a common parent,
not cousins.'''
cur = node
for index, child in enumerate(path):
if isinstance(ch... |
parse the xml and fill all the data into a class of return_type | def _parse_response_body_from_xml_node(node, return_type):
'''
parse the xml and fill all the data into a class of return_type
'''
return_obj = return_type()
_MinidomXmlToObject._fill_data_to_return_object(node, return_obj)
return return_obj |
Converts an xml fragment into a list of scalar types. The parent xml element contains a flat list of xml elements which are converted into the specified scalar type and added to the list. Example: xmldoc = <Endpoints > <Endpoint > http:// { storage - service - name }. blob. core. windows. net/ </ Endpoint > <Endpoint >... | def _fill_scalar_list_of(xmldoc, element_type, parent_xml_element_name,
xml_element_name):
'''Converts an xml fragment into a list of scalar types. The parent xml
element contains a flat list of xml elements which are converted into the
specified scalar type and add... |
Converts an xml fragment into a dictionary. The parent xml element contains a list of xml elements where each element has a child element for the key and another for the value. Example: xmldoc = <ExtendedProperties > <ExtendedProperty > <Name > Ext1</ Name > <Value > Val1</ Value > </ ExtendedProperty > <ExtendedProper... | def _fill_dict_of(xmldoc, parent_xml_element_name, pair_xml_element_name,
key_xml_element_name, value_xml_element_name):
'''Converts an xml fragment into a dictionary. The parent xml element
contains a list of xml elements where each element has a child element for
the key,... |
Converts a child of the current dom element to the specified type. | def _fill_instance_child(xmldoc, element_name, return_type):
'''Converts a child of the current dom element to the specified type.
'''
xmlelements = _MinidomXmlToObject.get_child_nodes(
xmldoc, _get_serialization_name(element_name))
if not xmlelements:
return Non... |
Recursively searches from the parent to the child gathering all the applicable namespaces along the way | def _find_namespaces_from_child(parent, child, namespaces):
"""Recursively searches from the parent to the child,
gathering all the applicable namespaces along the way"""
for cur_child in parent.childNodes:
if cur_child is child:
return True
if _MinidomXml... |
Wraps the specified xml in an xml root element with default azure namespaces | def doc_from_xml(document_element_name, inner_xml):
'''Wraps the specified xml in an xml root element with default azure
namespaces'''
xml = ''.join(['<', document_element_name,
' xmlns:i="http://www.w3.org/2001/XMLSchema-instance"',
' xmlns="http://sc... |
Wraps the specified xml in an xml root element with default azure namespaces | def doc_from_xml(document_element_name, inner_xml,
xmlns='http://schemas.microsoft.com/windowsazure'):
'''Wraps the specified xml in an xml root element with default azure
namespaces'''
xml = ''.join(['<', document_element_name,
' xmlns="{0}">'.format(x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.