text
stringlengths
81
112k
Adds an object to a bucket. See also: AWS API Documentation :example: response = client.put_object( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', Body=b'bytes'|file, Bucket='string', ...
uses the acl subresource to set the access control list (ACL) permissions for an object that already exists in a bucket See also: AWS API Documentation :example: response = client.put_object_acl( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner...
Uploads a part in a multipart upload. Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts ...
Uploads a part by copying data from an existing object as data source. See also: AWS API Documentation :example: response = client.upload_part_copy( Bucket='string', CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'}, CopySourceIfMatch='string',...
[EC2-VPC only] Adds one or more egress rules to a security group for use with a VPC. Specifically, this action permits instances to send traffic to one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more destination security groups for the same VPC. This action doesn't apply to security groups for u...
Adds one or more ingress rules to a security group. Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur. [EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission to access a security group in your account, or gives ...
Creates a network interface in the specified subnet. For more information about network interfaces, see Elastic Network Interfaces in the Amazon Virtual Private Cloud User Guide . See also: AWS API Documentation Examples This example creates a network interface for the specified subnet. Expecte...
Creates an EBS volume that can be attached to an instance in the same Availability Zone. The volume is created in the regional endpoint that you send the HTTP request to. For more information see Regions and Endpoints . You can create a new empty volume or restore a volume from an EBS snapshot. Any AWS Marketplace ...
Describes Reserved Instance offerings that are available for purchase. With Reserved Instances, you purchase the right to launch instances for a period of time. During that time period, you do not receive insufficient capacity errors, and you pay a lower usage rate than the rate charged for On-Demand instances for the ...
Describes the Spot price history. For more information, see Spot Instance Pricing History in the Amazon Elastic Compute Cloud User Guide . When you specify a start and end time, this operation returns the prices of the instance types within the time range that you specified and the time when the price changed. The ...
Import single or multi-volume disk images or EBS snapshots into an Amazon Machine Image (AMI). For more information, see Importing a VM as an Image Using VM Import/Export in the VM Import/Export User Guide . See also: AWS API Documentation :example: response = client.import_image( DryRun=True|...
Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time. See also: AWS API Documentation :example: response = client.modify_image_attribute( DryRun=True|False, ImageId='string', Attribute='string', OperationType='add'|'remove'...
Modifies the specified attribute of the specified instance. You can specify only one attribute at a time. To modify some attributes, the instance must be stopped. For more information, see Modifying Attributes of a Stopped Instance in the Amazon Elastic Compute Cloud User Guide . See also: AWS API Documentation...
Registers an AMI. When you're creating an AMI, this is the final step you must complete before you can launch an instance from the AMI. For more information about creating AMIs, see Creating Your Own AMIs in the Amazon Elastic Compute Cloud User Guide . You can also use RegisterImage to create an Amazon EBS-backed ...
Replaces an entry (rule) in a network ACL. For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide . See also: AWS API Documentation Examples This example replaces an entry for the specified network ACL. The new rule 100 allows ingress traffic from 203.0...
Replaces an existing route within a route table in a VPC. You must provide only one of the following: Internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only Internet gateway. For more information about route tables, see Route Tables in the A...
Creates a Spot instance request. Spot instances are instances that Amazon EC2 launches when the bid price that you specify exceeds the current Spot price. Amazon EC2 periodically sets the Spot price based on available Spot Instance capacity and current Spot instance requests. For more information, see Spot Instance Req...
Launches the specified number of instances using an AMI for which you have permissions. You can specify a number of options, or leave the default options. The following rules apply: To ensure faster instance launches, break up large requests into smaller batches. For example, create 5 separate launch requests f...
Launches an environment for the specified application using the specified configuration. See also: AWS API Documentation Examples The following operation creates a new environment for version v1 of a java application named my-app: Expected Output: :example: response = client.create_environ...
Returns list of event descriptions matching criteria up to the last 6 weeks. See also: AWS API Documentation Examples The following operation retrieves events for an environment named my-env: Expected Output: :example: response = client.describe_events( ApplicationName='string', ...
Updates the environment description, deploys a new application version, updates the configuration settings to an entirely new configuration template, or updates select configuration option values in the running environment. Attempting to update both the release and configuration is not allowed and AWS Elastic Beans...
Creates a new Lambda function. The function metadata is created from the request parameters, and the code for the function is provided by a .zip file in the request body. If the function name already exists, the operation will fail. Note that the function name is case-sensitive. If you are using versioning, you can...
Updates the configuration parameters for the specified Lambda function by using the values provided in the request. You provide only the parameters you want to change. This operation must only be used on an existing Lambda function and cannot be used to update the function's code. If you are using the versioning fe...
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective of the region in which they were created. See also: AWS API Documentation :example: response = client.create_trail( Name='string', S...
Creates a new cluster. To create the cluster in Virtual Private Cloud (VPC), you must provide a cluster subnet group name. The cluster subnet group identifies the subnets of your VPC that Amazon Redshift uses when creating the cluster. For more information about managing clusters, go to Amazon Redshift Clusters in ...
Returns one or more snapshot objects, which contain metadata about your cluster snapshots. By default, this operation returns information about all snapshots of all clusters that are owned by you AWS customer account. No information is returned for snapshots owned by inactive AWS customer accounts. If you specify b...
Modifies the settings for a cluster. For example, you can add another security or parameter group, update the preferred maintenance window, or change the master user password. Resetting a cluster password or modifying the security groups associated with a cluster do not need a reboot. However, modifying a parameter gro...
Creates a new cluster from a snapshot. By default, Amazon Redshift creates the resulting cluster with the same configuration as the original cluster from which the snapshot was created, except that the new cluster is created with the default cluster security and parameter groups. After Amazon Redshift creates the clust...
Creates an empty cluster. Each cluster supports five nodes. You use the CreateJob action separately to create the jobs for each of these nodes. The cluster does not ship until these five node jobs have been created. See also: AWS API Documentation Examples Creates an empty cluster. Each cluster suppor...
Creates a job to import or export data between Amazon S3 and your on-premises data center. Your AWS account must have the right trust policies and permissions in place to create a job for Snowball. If you're creating a job for a node in a cluster, you only need to provide the clusterId value; the other job attributes a...
While a job's JobState value is New , you can update some of the information associated with a job. Once the job changes to a different job state, usually within 60 minutes of the job being created, this action is no longer available. See also: AWS API Documentation Examples This action allows you to u...
Adds a new task to a Maintenance Window. See also: AWS API Documentation :example: response = client.register_task_with_maintenance_window( WindowId='string', Targets=[ { 'Key': 'string', 'Values': [ 'string', ...
Executes commands on one or more remote instances. See also: AWS API Documentation :example: response = client.send_command( InstanceIds=[ 'string', ], Targets=[ { 'Key': 'string', 'Values': [ 'string',...
Creates and immedately starts a new server. The server is ready to use when it is in the HEALTHY state. By default, you can create a maximum of 10 servers. This operation is asynchronous. A LimitExceededException is thrown when you have created the maximum number of servers (10). A ResourceAlreadyExistsExceptio...
Creates a new product. See also: AWS API Documentation :example: response = client.create_product( AcceptLanguage='string', Name='string', Owner='string', Description='string', Distributor='string', SupportDescription='string', SupportEmail='stri...
Requests a Provision of a specified product. A ProvisionedProduct is a resourced instance for a product. For example, provisioning a CloudFormation-template-backed product results in launching a CloudFormation stack and all the underlying resources that come with it. You can check the status of this request using t...
Updates an existing product. See also: AWS API Documentation :example: response = client.update_product( AcceptLanguage='string', Id='string', Name='string', Owner='string', Description='string', Distributor='string', SupportDescription='string',...
Returns a list of closed workflow executions in the specified domain that meet the filtering criteria. The results may be split into multiple pages. To retrieve subsequent pages, make the call again using the nextPageToken returned by the initial call. Access Control You can use IAM policies to control this act...
Registers a new activity type along with its configuration settings in the specified domain. Access Control You can use IAM policies to control this action's access to Amazon SWF resources as follows: If the caller does not have sufficient permissions to invoke the action, or the parameter values fall outsi...
Registers a new workflow type and its configuration settings in the specified domain. The retention period for the workflow history is set by the RegisterDomain action. Access Control You can use IAM policies to control this action's access to Amazon SWF resources as follows: If the caller does not hav...
Starts an execution of the workflow type in the specified domain using the provided workflowId and input data. This action returns the newly started workflow execution. Access Control You can use IAM policies to control this action's access to Amazon SWF resources as follows: If the caller does not have...
Creates a new Amazon Aurora DB cluster. You can use the ReplicationSourceIdentifier parameter to create the DB cluster as a Read Replica of another DB cluster or Amazon RDS MySQL DB instance. For cross-region replication where the DB cluster identified by ReplicationSourceIdentifier is encrypted, you must also spec...
Creates a new DB instance. See also: AWS API Documentation Examples This example creates a DB instance. Expected Output: :example: response = client.create_db_instance( DBName='string', DBInstanceIdentifier='string', AllocatedStorage=123, DBInstanceClass='st...
Creates a DB instance for a DB instance running MySQL, MariaDB, or PostgreSQL that acts as a Read Replica of a source DB instance. All Read Replica DB instances are created as Single-AZ deployments with backups disabled. All other DB instance attributes (including DB security groups and DB parameter groups) are inh...
Returns a list of the available DB engines. See also: AWS API Documentation Examples This example lists settings for the specified DB engine version. Expected Output: :example: response = client.describe_db_engine_versions( Engine='string', EngineVersion='string', D...
Returns information about reserved DB instances for this account, or about a specified reserved DB instance. See also: AWS API Documentation Examples This example lists information for all reserved DB instances for the specified DB instance class, duration, product, offering type, and availability zone...
Lists available reserved DB instance offerings. See also: AWS API Documentation Examples This example lists information for all reserved DB instance offerings for the specified DB instance class, duration, product, offering type, and availability zone settings. Expected Output: :example: r...
Modify a setting for an Amazon Aurora DB cluster. You can change one or more database configuration parameters by specifying these parameters and the new values in the request. For more information on Amazon Aurora, see Aurora on Amazon RDS in the Amazon RDS User Guide. See also: AWS API Documentation Exam...
Modifies settings for a DB instance. You can change one or more database configuration parameters by specifying these parameters and the new values in the request. See also: AWS API Documentation Examples This example immediately changes the specified settings for the specified DB instance. Expecte...
Creates an Amazon Aurora DB cluster from data stored in an Amazon S3 bucket. Amazon RDS must be authorized to access the Amazon S3 bucket and the data must be created using the Percona XtraBackup utility as described in Migrating Data from MySQL by Using an Amazon S3 Bucket . See also: AWS API Documentation ...
Creates a new DB cluster from a DB cluster snapshot. The target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group. For more information on Amazon Aurora, see Aurora o...
Restores a DB cluster to an arbitrary point in time. Users can restore to any point in time before LatestRestorableTime for up to BackupRetentionPeriod days. The target DB cluster is created from the source DB cluster with the same configuration as the original DB cluster, except that the new DB cluster is created with...
Creates a new DB instance from a DB snapshot. The target database is created from the source database restore point with the most of original configuration with the default security group and the default DB parameter group. By default, the new DB instance is created as a single-AZ deployment except when the instance is...
Restores a DB instance to an arbitrary point in time. You can restore to any point in time before the time identified by the LatestRestorableTime property. You can restore to a point up to the number of days specified by the BackupRetentionPeriod property. The target database is created with most of the original co...
Updates an existing health check. Note that some values can't be updated. For more information about updating health checks, see Creating, Updating, and Deleting Health Checks in the Amazon Route 53 Developer Guide . See also: AWS API Documentation :example: response = client.update_health_check( ...
The CreateHIT operation creates a new Human Intelligence Task (HIT). The new HIT is made available for Workers to find and accept on the Amazon Mechanical Turk website. This operation allows you to specify a new HIT by passing in values for the properties of the HIT, such as its title, reward amount and number of a...
The CreateHITWithHITType operation creates a new Human Intelligence Task (HIT) using an existing HITTypeID generated by the CreateHITType operation. This is an alternative way to create HITs from the CreateHIT operation. This is the recommended best practice for Requesters who are creating large numbers of HITs. ...
The CreateQualificationType operation creates a new Qualification type, which is represented by a QualificationType data structure. See also: AWS API Documentation :example: response = client.create_qualification_type( Name='string', Keywords='string', Description='string', ...
The UpdateQualificationType operation modifies the attributes of an existing Qualification type, which is represented by a QualificationType data structure. Only the owner of a Qualification type can modify its attributes. Most attributes of a Qualification type can be changed after the type has been created. Howev...
Convert the name of a hash algorithm as described in the OATH specifications, to a python object handling the digest algorithm interface, PEP-xxx. :param description the name of the hash algorithm, example :rtype: a hash algorithm class constructor def str2hashalgo(description):...
Convert an OCRA crypto function description into a CryptoFunction instance :param crypto_function_description: :returns: the CryptoFunction object :rtype: CryptoFunction def str2cryptofunction(crypto_function_description): ''' Convert an OCRA crypto function descripti...
Compute a HOTP value as prescribed by RFC4226 :param key: the HOTP secret key given as an hexadecimal string :param counter: the OTP generation counter :param format: the output format, can be: - hex, for a variable length hexadecimal format, ...
Validate a HOTP value inside a window of [counter-backward_drift:counter+forward_drift] :param key: the shared secret :type key: hexadecimal string of even length :param response: the OTP to check :type response: ASCII string :param ...
Compute a TOTP value as prescribed by OATH specifications. :param key: the TOTP key given as an hexadecimal string :param format: the output format, can be: - hex, for a variable length hexadecimal format, - hex-notrunc, for a 40 characters hexadecimal no...
Validate a TOTP value inside a window of [drift-bacward_drift:drift+forward_drift] of time steps. Where drift is the drift obtained during the last call to accept_totp. :param response: a string representing the OTP to check, its format should correspond to the format parame...
Some phone app directly accept a partial b32 encoding, we try to emulate that def from_b32key(b32_key, state=None): '''Some phone app directly accept a partial b32 encoding, we try to emulate that''' try: lenient_b32decode(b32_key) except TypeError: raise ValueError('invalid base32 value') ...
https://github.com/google/google-authenticator/wiki/Key-Uri-Format def generate(self, secret, type='totp', account='alex', issuer=None, algo='sha1', digits=6, init_counter=None): """ h...
Convert from onnx operator to mxnet operator. The converter must specify conversions explicitly for incompatible name, and apply handlers to operator attributes. Parameters ---------- op_name : str Operator name, such as Convolution, FullyConnected attrs : dict Dict of operator ...
Construct symbol from onnx graph. The inputs from onnx graph is vague, only providing "1", "2"... For convenience, we rename the `real` input names to "input_0", "input_1"... And renaming parameters to "param_0", "param_1"... Parameters ---------- graph : onnx protobuf o...
onnx pooling operator supports asymmetrical padding Adding pad operator before pooling in mxnet to work with onnx def _fix_pooling(self, op_name, inputs, new_attr): """onnx pooling operator supports asymmetrical padding Adding pad operator before pooling in mxnet to work with onnx""" po...
onnx slice provides slicing on multiple axis. Adding multiple slice_axis operator for multiple axes from mxnet def _fix_slice(self, inputs, new_attr): """onnx slice provides slicing on multiple axis. Adding multiple slice_axis operator for multiple axes from mxnet""" begin = new_attr.ge...
MXNet doesnt have a squeeze operator. Using "split" to perform similar operation. "split" can be slower compared to "reshape". This can have performance impact. TODO: Remove this implementation once mxnet adds the support. def _fix_squeeze(self, inputs, new_attr): """ ...
MXNet maximum/minimum compares only two symbols at a time. ONNX can send more than two to compare. Breaking into multiple mxnet ops to compare two symbols at a time def _fix_max_min(self, op_name, inputs): """ MXNet maximum/minimum compares only two symbols at a time. ONNX c...
Using FullyConnected operator in place of linalg_gemm to perform same operation def _fix_gemm(self, op_name, inputs, old_attr): """Using FullyConnected operator in place of linalg_gemm to perform same operation""" op = getattr(mx.sym, op_name, None) alpha = float(old_attr.get('alpha', 1.0)) ...
Grab data in TensorProto and convert to numpy array. def _parse_array(self, tensor_proto): """Grab data in TensorProto and convert to numpy array.""" try: from onnx.numpy_helper import to_array except ImportError as e: raise ImportError("Unable to import onnx which is re...
Convert a list of AttributeProto to a dict, with names as keys. def _parse_attr(self, attr_proto): """Convert a list of AttributeProto to a dict, with names as keys.""" attrs = {} for a in attr_proto: for f in ['f', 'i', 's']: if a.HasField(f): at...
A workaround to handle dropout or similar operator that have more than one out in ONNX. def _fix_outputs(self, op, outputs): """A workaround to handle dropout or similar operator that have more than one out in ONNX. """ if op == 'Dropout': assert len(outputs) == 2, "...
A workaround for 'use_bias' attribute since onnx don't provide this attribute, we have to check the number of inputs to decide it. def _fix_bias(self, op, attrs, num_inputs): """A workaround for 'use_bias' attribute since onnx don't provide this attribute, we have to check the number of inputs ...
A workaround to reshape bias term to (1, num_channel). def _fix_bias_shape(self, op_name, inputs, attrs): """A workaround to reshape bias term to (1, num_channel).""" if (op_name == 'Add' or op_name == 'Mul') and (int(len(self._params)) > 0) and \ ('broadcast' in attrs and attrs['broadc...
A workaround for getting 'channels' or 'units' since onnx don't provide these attributes. We check the shape of weights provided to get the number. def _fix_channels(self, op, attrs, inputs): """A workaround for getting 'channels' or 'units' since onnx don't provide these attributes. We check t...
Run model inference and return the result Parameters ---------- inputs : numpy array input to run a layer on Returns ------- params : numpy array result obtained after running the inference on mxnet def run(self, inputs, **kwargs): """Ru...
Helper function to parse default values. def _parse_default(self, target): """Helper function to parse default values.""" if not isinstance(target, (list, tuple)): k, v, t = target, None, lambda x: x elif len(target) == 1: k, v, t = target[0], None, lambda x: x e...
Helper function to parse default boolean values. def _parse_bool(self, value): """Helper function to parse default boolean values.""" if isinstance(value, string_types): return value.strip().lower() in ['true', '1', 't', 'y', 'yes'] return bool(value)
Wrapper for getting required attributes. def _required_attr(self, attr, key): """Wrapper for getting required attributes.""" assert isinstance(attr, dict) if key not in attr: raise AttributeError("Required attribute {} not found.".format(key)) return attr[key]
Created ONNX GraphProto from node def make_graph(node, inputs): """ Created ONNX GraphProto from node""" initializer = [] tensor_input_info = [] tensor_output_info = [] # Adding input tensor info. for index in range(len(node.input)): tensor_input_info.append...
Running individual node inference on mxnet engine and return the result to onnx test infrastructure. Parameters ---------- node : onnx node object loaded onnx node (individual layer) inputs : numpy array input to run a node on device : 'CPU' ...
For running end to end model(used for onnx test backend) Parameters ---------- model : onnx ModelProto object loaded onnx graph device : 'CPU' specifying device to run test on kwargs : other arguments Returns ------- ...
Removing extra padding from Caffe2. def _revert_caffe2_pad(attr): """Removing extra padding from Caffe2.""" if len(attr) == 4: attr = attr[:2] elif len(attr) == 2: pass else: raise ValueError("Invalid caffe2 type padding: {}".format(attr)) return attr
Changing onnx's pads sequence to match with mxnet's pad_width mxnet: (x1_begin, x1_end, ... , xn_begin, xn_end) onnx: (x1_begin, x2_begin, ... , xn_end, xn_end) def _pad_sequence_fix(attr, kernelDim=None): """Changing onnx's pads sequence to match with mxnet's pad_width mxnet: (x1_begin, x1_end, ... , ...
Imports the supplied ONNX model file into MXNet symbol and parameters. Parameters ---------- model_file : ONNX model file name Returns ------- sym : mx.symbol Compatible mxnet symbol params : dict of str to mx.ndarray Dict of converted parameters stored in mx.ndarray forma...
Public function that reads a local file and generates a SHA256 hash digest for it def generate_hash(filepath): """Public function that reads a local file and generates a SHA256 hash digest for it""" fr = FileReader(filepath) data = fr.read_bin() return _calculate_sha256(data)
Public function that reads a list of local directories and generates tar archives from them def generate_tar_files(directory_list): """Public function that reads a list of local directories and generates tar archives from them""" tar_file_list = [] for directory in directory_list: if dir_exis...
Public function that removes temporary tar archive files in a local directory def remove_tar_files(file_list): """Public function that removes temporary tar archive files in a local directory""" for f in file_list: if file_exists(f) and f.endswith('.tar'): os.remove(f)
Private function that reads a local directory and generates a tar archive from it def _generate_tar(dir_path): """Private function that reads a local directory and generates a tar archive from it""" try: with tarfile.open(dir_path + '.tar', 'w') as tar: tar.add(dir_path) except tarfile....
public method for single file encryption with optional compression, ASCII armored formatting, and file hash digest generation def encrypt_file(self, inpath, force_nocompress=False, force_compress=False, armored=False, checksum=False): """public method for single file encryption with optional compression, ASCII...
public method for multiple file encryption with optional compression, ASCII armored formatting, and file hash digest generation def encrypt_files(self, file_list, force_nocompress=False, force_compress=False, armored=False, checksum=False): """public method for multiple file encryption with optional compressio...
private method that performs magic number and size check on file to determine whether to compress the file def _is_compress_filetype(self, inpath): """private method that performs magic number and size check on file to determine whether to compress the file""" # check for common file type suffixes in o...
private method to compare file path mime type to common binary file types def _is_common_binary(self, inpath): """private method to compare file path mime type to common binary file types""" # make local variables for the available char numbers in the suffix types to be tested two_suffix = inpa...
private method to compare file path mime type to common text file types def _is_common_text(self, inpath): """private method to compare file path mime type to common text file types""" # make local variables for the available char numbers in the suffix types to be tested one_suffix = inpath[-2:...
Seems to be the fastest kNN implementation. Pre-sorts each rows neighbors and then filters these sorted indices using each columns mask of observed values. Important detail: If k observed values are not available then uses fewer than k neighboring rows. Parameters ---------- X : np.ndarray...