_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q6600 | list_vmss_vm_instance_view_pg | train | def list_vmss_vm_instance_view_pg(access_token, subscription_id, resource_group, vmss_name,
link=None):
'''Gets one page of a paginated list of scale set VM instance views.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azu... | python | {
"resource": ""
} |
q6601 | poweroff_vmss | train | def poweroff_vmss(access_token, subscription_id, resource_group, vmss_name):
'''Power off all the VMs in a virtual machine scale set.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource_group (str): Azure resource group na... | python | {
"resource": ""
} |
q6602 | poweroff_vmss_vms | train | def poweroff_vmss_vms(access_token, subscription_id, resource_group, vmss_name, instance_ids):
'''Poweroff all the VMs in a virtual machine scale set.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource_group (str): Azure ... | python | {
"resource": ""
} |
q6603 | put_vmss | train | def put_vmss(access_token, subscription_id, resource_group, vmss_name, vmss_body):
'''Put VMSS body.
Can be used to create or update a scale set.
E.g. call get_vmss(), make changes to the body, call put_vmss().
Args:
access_token (str): A valid Azure authentication token.
subscription_... | python | {
"resource": ""
} |
q6604 | scale_vmss | train | def scale_vmss(access_token, subscription_id, resource_group, vmss_name, capacity):
'''Change the instance count of an existing VM Scale Set.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource_group (str): Azure resource ... | python | {
"resource": ""
} |
q6605 | start_vm | train | def start_vm(access_token, subscription_id, resource_group, vm_name):
'''Start a virtual machine.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource_group (str): Azure resource group name.
vm_name (str): Name of t... | python | {
"resource": ""
} |
q6606 | update_vm | train | def update_vm(access_token, subscription_id, resource_group, vm_name, body):
'''Update a virtual machine with a new JSON body. E.g. do a GET, change something, call this.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource... | python | {
"resource": ""
} |
q6607 | update_vmss | train | def update_vmss(access_token, subscription_id, resource_group, vmss_name, body):
'''Update a VMSS with a new JSON body. E.g. do a GET, change something, call this.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource_group ... | python | {
"resource": ""
} |
q6608 | get_vm_ids_by_ud | train | def get_vm_ids_by_ud(access_token, subscription_id, resource_group, vmssname, updatedomain):
'''look at VMSS VM instance view to get VM IDs by UD'''
instance_viewlist = azurerm.list_vmss_vm_instance_view(access_token, subscription_id,
resource_group, vm... | python | {
"resource": ""
} |
q6609 | get_graph_token_from_msi | train | def get_graph_token_from_msi():
'''get a Microsoft Graph access token using Azure Cloud Shell's MSI_ENDPOINT.
Notes:
The auth token returned by this function is not an Azure auth token. Use it for querying
the Microsoft Graph API.
This function only works in an Azure cloud shell or... | python | {
"resource": ""
} |
q6610 | get_object_id_from_graph | train | def get_object_id_from_graph(access_token=None):
'''Return the object ID for the Graph user who owns the access token.
Args:
access_token (str): A Microsoft Graph access token. (Not an Azure access token.)
If not provided, attempt to get it from MSI_ENDPOINT.
Returns:
... | python | {
"resource": ""
} |
q6611 | get_subscription_from_cli | train | def get_subscription_from_cli(name=None):
'''Get the default, or named, subscription id from CLI's local cache.
Args:
name (str): Optional subscription name. If this is set, the subscription id of the named
subscription is returned from the CLI cache if present. If not set, the subscription ... | python | {
"resource": ""
} |
q6612 | list_locations | train | def list_locations(access_token, subscription_id):
'''List available locations for a subscription.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
Returns:
HTTP response. JSON list of locations.
'''
endpoint = ''.j... | python | {
"resource": ""
} |
q6613 | create_cosmosdb_account | train | def create_cosmosdb_account(access_token, subscription_id, rgname, account_name, location,
cosmosdb_kind):
'''Create a new Cosmos DB account in the named resource group, with the named location.
Args:
access_token (str): A valid Azure authentication token.
subscripti... | python | {
"resource": ""
} |
q6614 | get_cosmosdb_account_keys | train | def get_cosmosdb_account_keys(access_token, subscription_id, rgname, account_name):
'''Get the access keys for the specified Cosmos DB account.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group ... | python | {
"resource": ""
} |
q6615 | create_keyvault | train | def create_keyvault(access_token, subscription_id, rgname, vault_name, location,
template_deployment=True, tenant_id=None, object_id=None):
'''Create a new key vault in the named resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (s... | python | {
"resource": ""
} |
q6616 | delete_keyvault | train | def delete_keyvault(access_token, subscription_id, rgname, vault_name):
'''Deletes a key vault in the named resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group name.
vault_... | python | {
"resource": ""
} |
q6617 | get_keyvault | train | def get_keyvault(access_token, subscription_id, rgname, vault_name):
'''Gets details about the named key vault.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group name.
vault_name (str): ... | python | {
"resource": ""
} |
q6618 | list_keyvaults | train | def list_keyvaults(access_token, subscription_id, rgname):
'''Lists key vaults in the named resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group name.
Returns:
HTTP res... | python | {
"resource": ""
} |
q6619 | list_keyvaults_sub | train | def list_keyvaults_sub(access_token, subscription_id):
'''Lists key vaults belonging to this subscription.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
Returns:
HTTP response. 200 OK.
'''
endpoint = ''.join([get... | python | {
"resource": ""
} |
q6620 | set_keyvault_secret | train | def set_keyvault_secret(access_token, vault_uri, secret_name, secret_value):
'''Adds a secret to a key vault using the key vault URI.
Creates a new version if the secret already exists.
Args:
access_token (str): A valid Azure authentication token.
vault_uri (str): Vault URI e.g. https:/... | python | {
"resource": ""
} |
q6621 | delete_keyvault_secret | train | def delete_keyvault_secret(access_token, vault_uri, secret_name):
'''Deletes a secret from a key vault using the key vault URI.
Args:
access_token (str): A valid Azure authentication token.
vault_uri (str): Vault URI e.g. https://myvault.azure.net.
secret_name (str): Name of the secret... | python | {
"resource": ""
} |
q6622 | create_autoscale_setting | train | def create_autoscale_setting(access_token, subscription_id, resource_group, setting_name,
vmss_name, location, minval, maxval, default, autoscale_rules,
notify=None):
'''Create a new autoscale setting for a scale set.
Args:
access_token (str): A... | python | {
"resource": ""
} |
q6623 | list_autoscale_settings | train | def list_autoscale_settings(access_token, subscription_id):
'''List the autoscale settings in a subscription.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
Returns:
HTTP response. JSON body of autoscale settings.
'''... | python | {
"resource": ""
} |
q6624 | list_insights_components | train | def list_insights_components(access_token, subscription_id, resource_group):
'''List the Microsoft Insights components in a resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource_group (str): Azure resource gr... | python | {
"resource": ""
} |
q6625 | list_metric_defs_for_resource | train | def list_metric_defs_for_resource(access_token, subscription_id, resource_group,
resource_provider, resource_type, resource_name):
'''List the monitoring metric definitions for a resource.
Args:
access_token (str): A valid Azure authentication token.
subscripti... | python | {
"resource": ""
} |
q6626 | get_metrics_for_resource | train | def get_metrics_for_resource(access_token, subscription_id, resource_group, resource_provider,
resource_type, resource_name):
'''Get the monitoring metrics for a resource.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure sub... | python | {
"resource": ""
} |
q6627 | get_events_for_subscription | train | def get_events_for_subscription(access_token, subscription_id, start_timestamp):
'''Get the insights evens for a subsctipion since the specific timestamp.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
start_timestamp (str): t... | python | {
"resource": ""
} |
q6628 | deploy_template | train | def deploy_template(access_token, subscription_id, resource_group, deployment_name, template,
parameters):
'''Deploy a template referenced by a JSON string, with parameters as a JSON string.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str):... | python | {
"resource": ""
} |
q6629 | deploy_template_uri | train | def deploy_template_uri(access_token, subscription_id, resource_group, deployment_name,
template_uri, parameters):
'''Deploy a template referenced by a URI, with parameters as a JSON string.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (s... | python | {
"resource": ""
} |
q6630 | deploy_template_uri_param_uri | train | def deploy_template_uri_param_uri(access_token, subscription_id, resource_group, deployment_name,
template_uri, parameters_uri):
'''Deploy a template with both template and parameters referenced by URIs.
Args:
access_token (str): A valid Azure authentication token.
... | python | {
"resource": ""
} |
q6631 | attach_model | train | def attach_model(subscription, rgname, vmssvm_model, diskname, lun):
'''Attach a data disk to a VMSS VM model'''
disk_id = '/subscriptions/' + subscription + '/resourceGroups/' + rgname + \
'/providers/Microsoft.Compute/disks/' + diskname
disk_model = {'lun': lun, 'createOption': 'Attach', 'caching'... | python | {
"resource": ""
} |
q6632 | detach_model | train | def detach_model(vmssvm_model, lun):
'''Detach a data disk from a VMSS VM model'''
data_disks = vmssvm_model['properties']['storageProfile']['dataDisks']
data_disks[:] = [disk for disk in data_disks if disk.get('lun') != lun]
vmssvm_model['properties']['storageProfile']['dataDisks'] = data_disks
ret... | python | {
"resource": ""
} |
q6633 | get_access_token | train | def get_access_token(tenant_id, application_id, application_secret):
'''get an Azure access token using the adal library.
Args:
tenant_id (str): Tenant id of the user's account.
application_id (str): Application id of a Service Principal account.
application_secret (str): Application se... | python | {
"resource": ""
} |
q6634 | get_access_token_from_cli | train | def get_access_token_from_cli():
'''Get an Azure authentication token from CLI's cache.
Will only work if CLI local cache has an unexpired auth token (i.e. you ran 'az login'
recently), or if you are running in Azure Cloud Shell (aka cloud console)
Returns:
An Azure authentication token st... | python | {
"resource": ""
} |
q6635 | list_offers | train | def list_offers(access_token, subscription_id, location, publisher):
'''List available VM image offers from a publisher.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
location (str): Azure data center location. E.g. westus.
... | python | {
"resource": ""
} |
q6636 | list_skus | train | def list_skus(access_token, subscription_id, location, publisher, offer):
'''List available VM image skus for a publisher offer.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
location (str): Azure data center location. E.g. w... | python | {
"resource": ""
} |
q6637 | list_sku_versions | train | def list_sku_versions(access_token, subscription_id, location, publisher, offer, sku):
'''List available versions for a given publisher's sku.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
location (str): Azure data center lo... | python | {
"resource": ""
} |
q6638 | create_container_definition | train | def create_container_definition(container_name, image, port=80, cpu=1.0, memgb=1.5,
environment=None):
'''Makes a python dictionary of container properties.
Args:
container_name: The name of the container.
image (str): Container image string. E.g. nginx.
... | python | {
"resource": ""
} |
q6639 | create_container_instance_group | train | def create_container_instance_group(access_token, subscription_id, resource_group,
container_group_name, container_list, location,
ostype='Linux', port=80, iptype='public'):
'''Create a new container group with a list of containers specifified ... | python | {
"resource": ""
} |
q6640 | delete_container_instance_group | train | def delete_container_instance_group(access_token, subscription_id, resource_group,
container_group_name):
'''Delete a container group from a resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscriptio... | python | {
"resource": ""
} |
q6641 | get_container_instance_group | train | def get_container_instance_group(access_token, subscription_id, resource_group,
container_group_name):
'''Get the JSON definition of a container group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
... | python | {
"resource": ""
} |
q6642 | get_container_instance_logs | train | def get_container_instance_logs(access_token, subscription_id, resource_group, container_group_name,
container_name=None):
'''Get the container logs for containers in a container group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id... | python | {
"resource": ""
} |
q6643 | list_container_instance_groups | train | def list_container_instance_groups(access_token, subscription_id, resource_group):
'''List the container groups in a resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
resource_group (str): Azure resource group nam... | python | {
"resource": ""
} |
q6644 | list_container_instance_groups_sub | train | def list_container_instance_groups_sub(access_token, subscription_id):
'''List the container groups in a subscription.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
Returns:
HTTP response. JSON list of container groups a... | python | {
"resource": ""
} |
q6645 | create_resource_group | train | def create_resource_group(access_token, subscription_id, rgname, location):
'''Create a resource group in the specified location.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group name.
... | python | {
"resource": ""
} |
q6646 | delete_resource_group | train | def delete_resource_group(access_token, subscription_id, rgname):
'''Delete the named resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group name.
Returns:
HTTP response.... | python | {
"resource": ""
} |
q6647 | export_template | train | def export_template(access_token, subscription_id, rgname):
'''Capture the specified resource group as a template
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group name.
Returns:
HT... | python | {
"resource": ""
} |
q6648 | get_resource_group | train | def get_resource_group(access_token, subscription_id, rgname):
'''Get details about the named resource group.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
rgname (str): Azure resource group name.
Returns:
HTTP r... | python | {
"resource": ""
} |
q6649 | list_resource_groups | train | def list_resource_groups(access_token, subscription_id):
'''List the resource groups in a subscription.
Args:
access_token (str): A valid Azure authentication token.
subscription_id (str): Azure subscription id.
Returns:
HTTP response.
'''
endpoint = ''.join([get_rm_endpoin... | python | {
"resource": ""
} |
q6650 | CacheManager.get | train | def get(self, requirement):
"""
Get a distribution archive from any of the available caches.
:param requirement: A :class:`.Requirement` object.
:returns: The absolute pathname of a local file or :data:`None` when the
distribution archive is missing from all available ... | python | {
"resource": ""
} |
q6651 | CacheManager.put | train | def put(self, requirement, handle):
"""
Store a distribution archive in all of the available caches.
:param requirement: A :class:`.Requirement` object.
:param handle: A file-like object that provides access to the
distribution archive.
"""
filenam... | python | {
"resource": ""
} |
q6652 | CacheManager.generate_filename | train | def generate_filename(self, requirement):
"""
Generate a distribution archive filename for a package.
:param requirement: A :class:`.Requirement` object.
:returns: The filename of the distribution archive (a string)
including a single leading directory component to ind... | python | {
"resource": ""
} |
q6653 | SystemPackageManager.install_dependencies | train | def install_dependencies(self, requirement):
"""
Install missing dependencies for the given requirement.
:param requirement: A :class:`.Requirement` object.
:returns: :data:`True` when missing system packages were installed,
:data:`False` otherwise.
:raises: :e... | python | {
"resource": ""
} |
q6654 | SystemPackageManager.find_missing_dependencies | train | def find_missing_dependencies(self, requirement):
"""
Find missing dependencies of a Python package.
:param requirement: A :class:`.Requirement` object.
:returns: A list of strings with system package names.
"""
known_dependencies = self.find_known_dependencies(requireme... | python | {
"resource": ""
} |
q6655 | SystemPackageManager.find_known_dependencies | train | def find_known_dependencies(self, requirement):
"""
Find the known dependencies of a Python package.
:param requirement: A :class:`.Requirement` object.
:returns: A list of strings with system package names.
"""
logger.info("Checking for known dependencies of %s ..", req... | python | {
"resource": ""
} |
q6656 | SystemPackageManager.find_installed_packages | train | def find_installed_packages(self):
"""
Find the installed system packages.
:returns: A list of strings with system package names.
:raises: :exc:`.SystemDependencyError` when the command to list the
installed system packages fails.
"""
list_command = subp... | python | {
"resource": ""
} |
q6657 | SystemPackageManager.confirm_installation | train | def confirm_installation(self, requirement, missing_dependencies, install_command):
"""
Ask the operator's permission to install missing system packages.
:param requirement: A :class:`.Requirement` object.
:param missing_dependencies: A list of strings with missing dependencies.
... | python | {
"resource": ""
} |
q6658 | compact | train | def compact(text, **kw):
"""
Compact whitespace in a string and format any keyword arguments into the string.
:param text: The text to compact (a string).
:param kw: Any keyword arguments to apply using :func:`str.format()`.
:returns: The compacted, formatted string.
The whitespace compaction ... | python | {
"resource": ""
} |
q6659 | expand_path | train | def expand_path(pathname):
"""
Expand the home directory in a pathname based on the effective user id.
:param pathname: A pathname that may start with ``~/``, indicating the path
should be interpreted as being relative to the home
directory of the current (effectiv... | python | {
"resource": ""
} |
q6660 | find_home_directory | train | def find_home_directory():
"""
Look up the home directory of the effective user id.
:returns: The pathname of the home directory (a string).
.. note:: On Windows this uses the ``%APPDATA%`` environment variable (if
available) and otherwise falls back to ``~/Application Data``.
"""
... | python | {
"resource": ""
} |
q6661 | same_directories | train | def same_directories(path1, path2):
"""
Check if two pathnames refer to the same directory.
:param path1: The first pathname (a string).
:param path2: The second pathname (a string).
:returns: :data:`True` if both pathnames refer to the same directory,
:data:`False` otherwise.
"""... | python | {
"resource": ""
} |
q6662 | hash_files | train | def hash_files(method, *files):
"""
Calculate the hexadecimal digest of one or more local files.
:param method: The hash method (a string, given to :func:`hashlib.new()`).
:param files: The pathname(s) of file(s) to hash (zero or more strings).
:returns: The calculated hex digest (a string).
""... | python | {
"resource": ""
} |
q6663 | requirement_is_installed | train | def requirement_is_installed(expr):
"""
Check whether a requirement is installed.
:param expr: A requirement specification similar to those used in pip
requirement files (a string).
:returns: :data:`True` if the requirement is available (installed),
:data:`False` otherwis... | python | {
"resource": ""
} |
q6664 | match_option | train | def match_option(argument, short_option, long_option):
"""
Match a command line argument against a short and long option.
:param argument: The command line argument (a string).
:param short_option: The short option (a string).
:param long_option: The long option (a string).
:returns: :data:`Tru... | python | {
"resource": ""
} |
q6665 | match_option_with_value | train | def match_option_with_value(arguments, option, value):
"""
Check if a list of command line options contains an option with a value.
:param arguments: The command line arguments (a list of strings).
:param option: The long option (a string).
:param value: The expected value (a string).
:returns:... | python | {
"resource": ""
} |
q6666 | fromfile | train | def fromfile(file, dtype, count, *args, **kwargs):
"""Wrapper around np.fromfile to support any file-like object."""
try:
return numpy.fromfile(file, dtype=dtype, count=count, *args, **kwargs)
except (TypeError, IOError):
return numpy.frombuffer(file.read(count * numpy.dtype(dtype).itemsize)... | python | {
"resource": ""
} |
q6667 | parse | train | def parse(path, meta_data_only=False, compensate=False, channel_naming='$PnS',
reformat_meta=False, data_set=0, dtype='float32', encoding="utf-8"):
"""Parse an fcs file at the location specified by the path.
Parameters
----------
path: str
Path of .fcs file
meta_data_only: bool
... | python | {
"resource": ""
} |
q6668 | FCSParser.load_file | train | def load_file(self, file_handle, data_set=0, read_data=True):
"""Load the requested parts of the file into memory."""
file_handle.seek(0, 2)
self._file_size = file_handle.tell()
file_handle.seek(0)
data_segments = 0
# seek the correct data set in fcs
nextdata_offs... | python | {
"resource": ""
} |
q6669 | FCSParser.from_data | train | def from_data(cls, data):
"""Load an FCS file from a bytes-like object.
Args:
data: buffer containing contents of an FCS file.
Returns:
FCSParser instance with data loaded
"""
obj = cls()
with contextlib.closing(BytesIO(data)) as file_handle:
... | python | {
"resource": ""
} |
q6670 | FCSParser.read_header | train | def read_header(self, file_handle, nextdata_offset=0):
"""Read the header of the FCS file.
The header specifies where the annotation, data and analysis are located inside the binary
file.
Args:
file_handle: buffer containing FCS file.
nextdata_offset: byte offse... | python | {
"resource": ""
} |
q6671 | FCSParser._extract_text_dict | train | def _extract_text_dict(self, raw_text):
"""Parse the TEXT segment of the FCS file into a python dictionary."""
delimiter = raw_text[0]
if raw_text[-1] != delimiter:
raw_text = raw_text.strip()
if raw_text[-1] != delimiter:
msg = (u'The first two character... | python | {
"resource": ""
} |
q6672 | FCSParser.read_text | train | def read_text(self, file_handle):
"""Parse the TEXT segment of the FCS file.
The TEXT segment contains meta data associated with the FCS file.
Converting all meta keywords to lower case.
"""
header = self.annotation['__header__'] # For convenience
#####
# Read ... | python | {
"resource": ""
} |
q6673 | FCSParser.read_analysis | train | def read_analysis(self, file_handle):
"""Read the ANALYSIS segment of the FCS file and store it in self.analysis.
Warning: This has never been tested with an actual fcs file that contains an
analysis segment.
Args:
file_handle: buffer containing FCS data
"""
... | python | {
"resource": ""
} |
q6674 | FCSParser._verify_assumptions | train | def _verify_assumptions(self):
"""Verify that all assumptions made by the parser hold."""
text = self.annotation
keys = text.keys()
if '$MODE' not in text or text['$MODE'] != 'L':
raise ParserFeatureNotImplementedError(u'Mode not implemented')
if '$P0B' in keys:
... | python | {
"resource": ""
} |
q6675 | FCSParser.get_channel_names | train | def get_channel_names(self):
"""Get list of channel names. Raises a warning if the names are not unique."""
names_s, names_n = self.channel_names_s, self.channel_names_n
# Figure out which channel names to use
if self._channel_naming == '$PnS':
channel_names, channel_names_a... | python | {
"resource": ""
} |
q6676 | FCSParser.read_data | train | def read_data(self, file_handle):
"""Read the DATA segment of the FCS file."""
self._verify_assumptions()
text = self.annotation
if (self._data_start > self._file_size) or (self._data_end > self._file_size):
raise ValueError(u'The FCS file "{}" is corrupted. Part of the data... | python | {
"resource": ""
} |
q6677 | FCSParser.data | train | def data(self):
"""Get parsed DATA segment of the FCS file."""
if self._data is None:
with open(self.path, 'rb') as f:
self.read_data(f)
return self._data | python | {
"resource": ""
} |
q6678 | FCSParser.analysis | train | def analysis(self):
"""Get ANALYSIS segment of the FCS file."""
if self._analysis is None:
with open(self.path, 'rb') as f:
self.read_analysis(f)
return self._analysis | python | {
"resource": ""
} |
q6679 | FCSParser.reformat_meta | train | def reformat_meta(self):
"""Collect the meta data information in a more user friendly format.
Function looks through the meta data, collecting the channel related information into a
dataframe and moving it into the _channels_ key.
"""
meta = self.annotation # For shorthand (pas... | python | {
"resource": ""
} |
q6680 | FCSParser.dataframe | train | def dataframe(self):
"""Construct Pandas dataframe."""
data = self.data
channel_names = self.get_channel_names()
return pd.DataFrame(data, columns=channel_names) | python | {
"resource": ""
} |
q6681 | BinaryDistributionManager.get_binary_dist | train | def get_binary_dist(self, requirement):
"""
Get or create a cached binary distribution archive.
:param requirement: A :class:`.Requirement` object.
:returns: An iterable of tuples with two values each: A
:class:`tarfile.TarInfo` object and a file-like object.
... | python | {
"resource": ""
} |
q6682 | BinaryDistributionManager.needs_invalidation | train | def needs_invalidation(self, requirement, cache_file):
"""
Check whether a cached binary distribution needs to be invalidated.
:param requirement: A :class:`.Requirement` object.
:param cache_file: The pathname of a cached binary distribution (a string).
:returns: :data:`True` i... | python | {
"resource": ""
} |
q6683 | BinaryDistributionManager.recall_checksum | train | def recall_checksum(self, cache_file):
"""
Get the checksum of the input used to generate a binary distribution archive.
:param cache_file: The pathname of the binary distribution archive (a string).
:returns: The checksum (a string) or :data:`None` (when no checksum is available).
... | python | {
"resource": ""
} |
q6684 | BinaryDistributionManager.persist_checksum | train | def persist_checksum(self, requirement, cache_file):
"""
Persist the checksum of the input used to generate a binary distribution.
:param requirement: A :class:`.Requirement` object.
:param cache_file: The pathname of a cached binary distribution (a string).
.. note:: The check... | python | {
"resource": ""
} |
q6685 | BinaryDistributionManager.build_binary_dist | train | def build_binary_dist(self, requirement):
"""
Build a binary distribution archive from an unpacked source distribution.
:param requirement: A :class:`.Requirement` object.
:returns: The pathname of a binary distribution archive (a string).
:raises: :exc:`.BinaryDistributionError... | python | {
"resource": ""
} |
q6686 | BinaryDistributionManager.transform_binary_dist | train | def transform_binary_dist(self, archive_path):
"""
Transform binary distributions into a form that can be cached for future use.
:param archive_path: The pathname of the original binary distribution archive.
:returns: An iterable of tuples with two values each:
1. A :... | python | {
"resource": ""
} |
q6687 | BinaryDistributionManager.install_binary_dist | train | def install_binary_dist(self, members, virtualenv_compatible=True, prefix=None,
python=None, track_installed_files=False):
"""
Install a binary distribution into the given prefix.
:param members: An iterable of tuples with two values each:
1.... | python | {
"resource": ""
} |
q6688 | BinaryDistributionManager.fix_hashbang | train | def fix_hashbang(self, contents, python):
"""
Rewrite hashbangs_ to use the correct Python executable.
:param contents: The contents of the script whose hashbang should be
fixed (a string).
:param python: The absolute pathname of the Python executable (a
... | python | {
"resource": ""
} |
q6689 | BinaryDistributionManager.update_installed_files | train | def update_installed_files(self, installed_files):
"""
Track the files installed by a package so pip knows how to remove the package.
This method is used by :func:`install_binary_dist()` (which collects
the list of installed files for :func:`update_installed_files()`).
:param i... | python | {
"resource": ""
} |
q6690 | Config.available_configuration_files | train | def available_configuration_files(self):
"""A list of strings with the absolute pathnames of the available configuration files."""
known_files = [GLOBAL_CONFIG, LOCAL_CONFIG, self.environment.get('PIP_ACCEL_CONFIG')]
absolute_paths = [parse_path(pathname) for pathname in known_files if pathname]... | python | {
"resource": ""
} |
q6691 | Config.load_configuration_file | train | def load_configuration_file(self, configuration_file):
"""
Load configuration defaults from a configuration file.
:param configuration_file: The pathname of a configuration file (a
string).
:raises: :exc:`Exception` when the configuration file cannot b... | python | {
"resource": ""
} |
q6692 | Config.get | train | def get(self, property_name=None, environment_variable=None, configuration_option=None, default=None):
"""
Internal shortcut to get a configuration option's value.
:param property_name: The name of the property that users can set on
the :class:`Config` class (a str... | python | {
"resource": ""
} |
q6693 | Config.auto_install | train | def auto_install(self):
"""
Whether automatic installation of missing system packages is enabled.
:data:`True` if automatic installation of missing system packages is
enabled, :data:`False` if it is disabled, :data:`None` otherwise (in this case
the user will be prompted at the ... | python | {
"resource": ""
} |
q6694 | Config.trust_mod_times | train | def trust_mod_times(self):
"""
Whether to trust file modification times for cache invalidation.
- Environment variable: ``$PIP_ACCEL_TRUST_MOD_TIMES``
- Configuration option: ``trust-mod-times``
- Default: :data:`True` unless the AppVeyor_ continuous integration
... | python | {
"resource": ""
} |
q6695 | Config.s3_cache_readonly | train | def s3_cache_readonly(self):
"""
Whether the Amazon S3 bucket is considered read only.
If this is :data:`True` then the Amazon S3 bucket will only be used for
:class:`~pip_accel.caches.s3.S3CacheBackend.get()` operations (all
:class:`~pip_accel.caches.s3.S3CacheBackend.put()` op... | python | {
"resource": ""
} |
q6696 | S3CacheBackend.get | train | def get(self, filename):
"""
Download a distribution archive from the configured Amazon S3 bucket.
:param filename: The filename of the distribution archive (a string).
:returns: The pathname of a distribution archive on the local file
system or :data:`None`.
:... | python | {
"resource": ""
} |
q6697 | S3CacheBackend.put | train | def put(self, filename, handle):
"""
Upload a distribution archive to the configured Amazon S3 bucket.
If the :attr:`~.Config.s3_cache_readonly` configuration option is
enabled this method does nothing.
:param filename: The filename of the distribution archive (a string).
... | python | {
"resource": ""
} |
q6698 | S3CacheBackend.s3_connection | train | def s3_connection(self):
"""
Connect to the Amazon S3 API.
If the connection attempt fails because Boto can't find credentials the
attempt is retried once with an anonymous connection.
Called on demand by :attr:`s3_bucket`.
:returns: A :class:`boto.s3.connection.S3Conn... | python | {
"resource": ""
} |
q6699 | Requirement.wheel_metadata | train | def wheel_metadata(self):
"""Get the distribution metadata of an unpacked wheel distribution."""
if not self.is_wheel:
raise TypeError("Requirement is not a wheel distribution!")
for distribution in find_distributions(self.source_directory):
return distribution
ms... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.