id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
51,000
yyuu/botornado
boto/ec2/autoscale/__init__.py
AutoScaleConnection.resume_processes
def resume_processes(self, as_group, scaling_processes=None): """ Resumes Auto Scaling processes for an Auto Scaling group. :type as_group: string :param as_group: The auto scaling group to resume processes on. :type scaling_processes: list :param scaling_processes: Pro...
python
def resume_processes(self, as_group, scaling_processes=None): """ Resumes Auto Scaling processes for an Auto Scaling group. :type as_group: string :param as_group: The auto scaling group to resume processes on. :type scaling_processes: list :param scaling_processes: Pro...
[ "def", "resume_processes", "(", "self", ",", "as_group", ",", "scaling_processes", "=", "None", ")", ":", "params", "=", "{", "'AutoScalingGroupName'", ":", "as_group", "}", "if", "scaling_processes", ":", "self", ".", "build_list_params", "(", "params", ",", ...
Resumes Auto Scaling processes for an Auto Scaling group. :type as_group: string :param as_group: The auto scaling group to resume processes on. :type scaling_processes: list :param scaling_processes: Processes you want to resume. If omitted, all processes will be resumed.
[ "Resumes", "Auto", "Scaling", "processes", "for", "an", "Auto", "Scaling", "group", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/autoscale/__init__.py#L497-L512
51,001
yyuu/botornado
boto/ec2/autoscale/__init__.py
AutoScaleConnection.create_scheduled_group_action
def create_scheduled_group_action(self, as_group, name, time, desired_capacity=None, min_size=None, max_size=None): """ Creates a scheduled scaling action for a Auto Scaling group. If you leave a parameter unspecified, t...
python
def create_scheduled_group_action(self, as_group, name, time, desired_capacity=None, min_size=None, max_size=None): """ Creates a scheduled scaling action for a Auto Scaling group. If you leave a parameter unspecified, t...
[ "def", "create_scheduled_group_action", "(", "self", ",", "as_group", ",", "name", ",", "time", ",", "desired_capacity", "=", "None", ",", "min_size", "=", "None", ",", "max_size", "=", "None", ")", ":", "params", "=", "{", "'AutoScalingGroupName'", ":", "as...
Creates a scheduled scaling action for a Auto Scaling group. If you leave a parameter unspecified, the corresponding value remains unchanged in the affected Auto Scaling group. :type as_group: string :param as_group: The auto scaling group to get activities on. :type name: stri...
[ "Creates", "a", "scheduled", "scaling", "action", "for", "a", "Auto", "Scaling", "group", ".", "If", "you", "leave", "a", "parameter", "unspecified", "the", "corresponding", "value", "remains", "unchanged", "in", "the", "affected", "Auto", "Scaling", "group", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/autoscale/__init__.py#L514-L550
51,002
yyuu/botornado
boto/ec2/autoscale/__init__.py
AutoScaleConnection.disable_metrics_collection
def disable_metrics_collection(self, as_group, metrics=None): """ Disables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of affected metrics with the Metrics parameter. """ params = {'AutoScalingGroupNam...
python
def disable_metrics_collection(self, as_group, metrics=None): """ Disables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of affected metrics with the Metrics parameter. """ params = {'AutoScalingGroupNam...
[ "def", "disable_metrics_collection", "(", "self", ",", "as_group", ",", "metrics", "=", "None", ")", ":", "params", "=", "{", "'AutoScalingGroupName'", ":", "as_group", "}", "if", "metrics", ":", "self", ".", "build_list_params", "(", "params", ",", "metrics",...
Disables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of affected metrics with the Metrics parameter.
[ "Disables", "monitoring", "of", "group", "metrics", "for", "the", "Auto", "Scaling", "group", "specified", "in", "AutoScalingGroupName", ".", "You", "can", "specify", "the", "list", "of", "affected", "metrics", "with", "the", "Metrics", "parameter", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/autoscale/__init__.py#L568-L578
51,003
yyuu/botornado
boto/ec2/autoscale/__init__.py
AutoScaleConnection.enable_metrics_collection
def enable_metrics_collection(self, as_group, granularity, metrics=None): """ Enables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of enabled metrics with the Metrics parameter. Auto scaling metrics collection...
python
def enable_metrics_collection(self, as_group, granularity, metrics=None): """ Enables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of enabled metrics with the Metrics parameter. Auto scaling metrics collection...
[ "def", "enable_metrics_collection", "(", "self", ",", "as_group", ",", "granularity", ",", "metrics", "=", "None", ")", ":", "params", "=", "{", "'AutoScalingGroupName'", ":", "as_group", ",", "'Granularity'", ":", "granularity", "}", "if", "metrics", ":", "se...
Enables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of enabled metrics with the Metrics parameter. Auto scaling metrics collection can be turned on only if the InstanceMonitoring.Enabled flag, in the Auto Scaling gro...
[ "Enables", "monitoring", "of", "group", "metrics", "for", "the", "Auto", "Scaling", "group", "specified", "in", "AutoScalingGroupName", ".", "You", "can", "specify", "the", "list", "of", "enabled", "metrics", "with", "the", "Metrics", "parameter", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/autoscale/__init__.py#L580-L605
51,004
yyuu/botornado
boto/ec2/autoscale/__init__.py
AutoScaleConnection.set_instance_health
def set_instance_health(self, instance_id, health_status, should_respect_grace_period=True): """ Explicitly set the health status of an instance. :type instance_id: str :param instance_id: The identifier of the EC2 instance. :type health_status: str ...
python
def set_instance_health(self, instance_id, health_status, should_respect_grace_period=True): """ Explicitly set the health status of an instance. :type instance_id: str :param instance_id: The identifier of the EC2 instance. :type health_status: str ...
[ "def", "set_instance_health", "(", "self", ",", "instance_id", ",", "health_status", ",", "should_respect_grace_period", "=", "True", ")", ":", "params", "=", "{", "'InstanceId'", ":", "instance_id", ",", "'HealthStatus'", ":", "health_status", "}", "if", "should_...
Explicitly set the health status of an instance. :type instance_id: str :param instance_id: The identifier of the EC2 instance. :type health_status: str :param health_status: The health status of the instance. "Healthy" means that the instance is healthy and should remain ...
[ "Explicitly", "set", "the", "health", "status", "of", "an", "instance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/autoscale/__init__.py#L615-L639
51,005
yyuu/botornado
boto/ec2/autoscale/__init__.py
AutoScaleConnection.get_all_tags
def get_all_tags(self, filters=None, max_records=None, next_token=None): """ Lists the Auto Scaling group tags. This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as t...
python
def get_all_tags(self, filters=None, max_records=None, next_token=None): """ Lists the Auto Scaling group tags. This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as t...
[ "def", "get_all_tags", "(", "self", ",", "filters", "=", "None", ",", "max_records", "=", "None", ",", "next_token", "=", "None", ")", ":", "params", "=", "{", "}", "if", "max_records", ":", "params", "[", "'MaxRecords'", "]", "=", "max_records", "if", ...
Lists the Auto Scaling group tags. This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as the NextToken parameter. :type filters: dict :param filters: The value of the...
[ "Lists", "the", "Auto", "Scaling", "group", "tags", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/autoscale/__init__.py#L643-L667
51,006
yyuu/botornado
boto/ec2/autoscale/__init__.py
AutoScaleConnection.create_or_update_tags
def create_or_update_tags(self, tags): """ Creates new tags or updates existing tags for an Auto Scaling group. :type tags: List of :class:`boto.ec2.autoscale.tag.Tag` :param tags: The new or updated tags. """ params = {} for i, tag in enumerate(tags): ...
python
def create_or_update_tags(self, tags): """ Creates new tags or updates existing tags for an Auto Scaling group. :type tags: List of :class:`boto.ec2.autoscale.tag.Tag` :param tags: The new or updated tags. """ params = {} for i, tag in enumerate(tags): ...
[ "def", "create_or_update_tags", "(", "self", ",", "tags", ")", ":", "params", "=", "{", "}", "for", "i", ",", "tag", "in", "enumerate", "(", "tags", ")", ":", "tag", ".", "build_params", "(", "params", ",", "i", "+", "1", ")", "return", "self", "."...
Creates new tags or updates existing tags for an Auto Scaling group. :type tags: List of :class:`boto.ec2.autoscale.tag.Tag` :param tags: The new or updated tags.
[ "Creates", "new", "tags", "or", "updates", "existing", "tags", "for", "an", "Auto", "Scaling", "group", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/autoscale/__init__.py#L669-L679
51,007
yyuu/botornado
boto/s3/key.py
Key.open_read
def open_read(self, headers=None, query_args='', override_num_retries=None, response_headers=None): """ Open this key for reading :type headers: dict :param headers: Headers to pass in the web request :type query_args: string :param query_args: Argumen...
python
def open_read(self, headers=None, query_args='', override_num_retries=None, response_headers=None): """ Open this key for reading :type headers: dict :param headers: Headers to pass in the web request :type query_args: string :param query_args: Argumen...
[ "def", "open_read", "(", "self", ",", "headers", "=", "None", ",", "query_args", "=", "''", ",", "override_num_retries", "=", "None", ",", "response_headers", "=", "None", ")", ":", "if", "self", ".", "resp", "==", "None", ":", "self", ".", "mode", "="...
Open this key for reading :type headers: dict :param headers: Headers to pass in the web request :type query_args: string :param query_args: Arguments to pass in the query string (ie, 'torrent') :type override_num_retries: int :param override_num_retries: If not None w...
[ "Open", "this", "key", "for", "reading" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L137-L194
51,008
yyuu/botornado
boto/s3/key.py
Key.change_storage_class
def change_storage_class(self, new_storage_class, dst_bucket=None): """ Change the storage class of an existing key. Depending on whether a different destination bucket is supplied or not, this will either move the item within the bucket, preserving all metadata and ACL info buck...
python
def change_storage_class(self, new_storage_class, dst_bucket=None): """ Change the storage class of an existing key. Depending on whether a different destination bucket is supplied or not, this will either move the item within the bucket, preserving all metadata and ACL info buck...
[ "def", "change_storage_class", "(", "self", ",", "new_storage_class", ",", "dst_bucket", "=", "None", ")", ":", "if", "new_storage_class", "==", "'STANDARD'", ":", "return", "self", ".", "copy", "(", "self", ".", "bucket", ".", "name", ",", "self", ".", "n...
Change the storage class of an existing key. Depending on whether a different destination bucket is supplied or not, this will either move the item within the bucket, preserving all metadata and ACL info bucket changing the storage class or it will copy the item to the provided destinati...
[ "Change", "the", "storage", "class", "of", "an", "existing", "key", ".", "Depending", "on", "whether", "a", "different", "destination", "bucket", "is", "supplied", "or", "not", "this", "will", "either", "move", "the", "item", "within", "the", "bucket", "pres...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L258-L287
51,009
yyuu/botornado
boto/s3/key.py
Key.copy
def copy(self, dst_bucket, dst_key, metadata=None, reduced_redundancy=False, preserve_acl=False, encrypt_key=False): """ Copy this Key to another bucket. :type dst_bucket: string :param dst_bucket: The name of the destination bucket :type dst_key: stri...
python
def copy(self, dst_bucket, dst_key, metadata=None, reduced_redundancy=False, preserve_acl=False, encrypt_key=False): """ Copy this Key to another bucket. :type dst_bucket: string :param dst_bucket: The name of the destination bucket :type dst_key: stri...
[ "def", "copy", "(", "self", ",", "dst_bucket", ",", "dst_key", ",", "metadata", "=", "None", ",", "reduced_redundancy", "=", "False", ",", "preserve_acl", "=", "False", ",", "encrypt_key", "=", "False", ")", ":", "dst_bucket", "=", "self", ".", "bucket", ...
Copy this Key to another bucket. :type dst_bucket: string :param dst_bucket: The name of the destination bucket :type dst_key: string :param dst_key: The name of the destination key :type metadata: dict :param metadata: Metadata to be associated with new key. ...
[ "Copy", "this", "Key", "to", "another", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L289-L349
51,010
yyuu/botornado
boto/s3/key.py
Key.delete
def delete(self): """ Delete this key from S3 """ return self.bucket.delete_key(self.name, version_id=self.version_id)
python
def delete(self): """ Delete this key from S3 """ return self.bucket.delete_key(self.name, version_id=self.version_id)
[ "def", "delete", "(", "self", ")", ":", "return", "self", ".", "bucket", ".", "delete_key", "(", "self", ".", "name", ",", "version_id", "=", "self", ".", "version_id", ")" ]
Delete this key from S3
[ "Delete", "this", "key", "from", "S3" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L390-L394
51,011
yyuu/botornado
boto/s3/key.py
Key.generate_url
def generate_url(self, expires_in, method='GET', headers=None, query_auth=True, force_http=False, response_headers=None, expires_in_absolute=False): """ Generate a URL to access this key. :type expires_in: int :param expires_in: How long the url...
python
def generate_url(self, expires_in, method='GET', headers=None, query_auth=True, force_http=False, response_headers=None, expires_in_absolute=False): """ Generate a URL to access this key. :type expires_in: int :param expires_in: How long the url...
[ "def", "generate_url", "(", "self", ",", "expires_in", ",", "method", "=", "'GET'", ",", "headers", "=", "None", ",", "query_auth", "=", "True", ",", "force_http", "=", "False", ",", "response_headers", "=", "None", ",", "expires_in_absolute", "=", "False", ...
Generate a URL to access this key. :type expires_in: int :param expires_in: How long the url is valid for, in seconds :type method: string :param method: The method to use for retrieving the file (default is GET) :type headers: dict :param header...
[ "Generate", "a", "URL", "to", "access", "this", "key", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L428-L455
51,012
yyuu/botornado
boto/s3/key.py
Key.set_contents_from_filename
def set_contents_from_filename(self, filename, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None, reduced_redundancy=False, encrypt_key=False): """ Store an object in S3 using the...
python
def set_contents_from_filename(self, filename, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None, reduced_redundancy=False, encrypt_key=False): """ Store an object in S3 using the...
[ "def", "set_contents_from_filename", "(", "self", ",", "filename", ",", "headers", "=", "None", ",", "replace", "=", "True", ",", "cb", "=", "None", ",", "num_cb", "=", "10", ",", "policy", "=", "None", ",", "md5", "=", "None", ",", "reduced_redundancy",...
Store an object in S3 using the name of the Key object as the key in S3 and the contents of the file named by 'filename'. See set_contents_from_file method for details about the parameters. :type filename: string :param filename: The name of the file that you want to put onto S3...
[ "Store", "an", "object", "in", "S3", "using", "the", "name", "of", "the", "Key", "object", "as", "the", "key", "in", "S3", "and", "the", "contents", "of", "the", "file", "named", "by", "filename", ".", "See", "set_contents_from_file", "method", "for", "d...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L904-L970
51,013
yyuu/botornado
boto/s3/key.py
Key.get_contents_to_file
def get_contents_to_file(self, fp, headers=None, cb=None, num_cb=10, torrent=False, version_id=None, res_download_handler=None, response_headers=None): """ Ret...
python
def get_contents_to_file(self, fp, headers=None, cb=None, num_cb=10, torrent=False, version_id=None, res_download_handler=None, response_headers=None): """ Ret...
[ "def", "get_contents_to_file", "(", "self", ",", "fp", ",", "headers", "=", "None", ",", "cb", "=", "None", ",", "num_cb", "=", "10", ",", "torrent", "=", "False", ",", "version_id", "=", "None", ",", "res_download_handler", "=", "None", ",", "response_h...
Retrieve an object from S3 using the name of the Key object as the key in S3. Write the contents of the object to the file pointed to by 'fp'. :type fp: File -like object :param fp: :type headers: dict :param headers: additional HTTP headers that will be sent with ...
[ "Retrieve", "an", "object", "from", "S3", "using", "the", "name", "of", "the", "Key", "object", "as", "the", "key", "in", "S3", ".", "Write", "the", "contents", "of", "the", "object", "to", "the", "file", "pointed", "to", "by", "fp", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L1171-L1226
51,014
yyuu/botornado
boto/s3/key.py
Key.add_email_grant
def add_email_grant(self, permission, email_address, headers=None): """ Convenience method that provides a quick way to add an email grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then P...
python
def add_email_grant(self, permission, email_address, headers=None): """ Convenience method that provides a quick way to add an email grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then P...
[ "def", "add_email_grant", "(", "self", ",", "permission", ",", "email_address", ",", "headers", "=", "None", ")", ":", "policy", "=", "self", ".", "get_acl", "(", "headers", "=", "headers", ")", "policy", ".", "acl", ".", "add_email_grant", "(", "permissio...
Convenience method that provides a quick way to add an email grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ACL back to S3. :type permission: string :param permission...
[ "Convenience", "method", "that", "provides", "a", "quick", "way", "to", "add", "an", "email", "grant", "to", "a", "key", ".", "This", "method", "retrieves", "the", "current", "ACL", "creates", "a", "new", "grant", "based", "on", "the", "parameters", "passe...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L1337-L1363
51,015
yyuu/botornado
boto/s3/key.py
Key.add_user_grant
def add_user_grant(self, permission, user_id, headers=None, display_name=None): """ Convenience method that provides a quick way to add a canonical user grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, a...
python
def add_user_grant(self, permission, user_id, headers=None, display_name=None): """ Convenience method that provides a quick way to add a canonical user grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, a...
[ "def", "add_user_grant", "(", "self", ",", "permission", ",", "user_id", ",", "headers", "=", "None", ",", "display_name", "=", "None", ")", ":", "policy", "=", "self", ".", "get_acl", "(", ")", "policy", ".", "acl", ".", "add_user_grant", "(", "permissi...
Convenience method that provides a quick way to add a canonical user grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ACL back to S3. :type permission: string :param p...
[ "Convenience", "method", "that", "provides", "a", "quick", "way", "to", "add", "a", "canonical", "user", "grant", "to", "a", "key", ".", "This", "method", "retrieves", "the", "current", "ACL", "creates", "a", "new", "grant", "based", "on", "the", "paramete...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/key.py#L1365-L1388
51,016
yyuu/botornado
boto/services/servicedef.py
ServiceDef.get_obj
def get_obj(self, name): """ Returns the AWS object associated with a given option. The heuristics used are a bit lame. If the option name contains the word 'bucket' it is assumed to be an S3 bucket, if the name contains the word 'queue' it is assumed to be an SQS queue and ...
python
def get_obj(self, name): """ Returns the AWS object associated with a given option. The heuristics used are a bit lame. If the option name contains the word 'bucket' it is assumed to be an S3 bucket, if the name contains the word 'queue' it is assumed to be an SQS queue and ...
[ "def", "get_obj", "(", "self", ",", "name", ")", ":", "val", "=", "self", ".", "get", "(", "name", ")", "if", "not", "val", ":", "return", "None", "if", "name", ".", "find", "(", "'queue'", ")", ">=", "0", ":", "obj", "=", "boto", ".", "lookup"...
Returns the AWS object associated with a given option. The heuristics used are a bit lame. If the option name contains the word 'bucket' it is assumed to be an S3 bucket, if the name contains the word 'queue' it is assumed to be an SQS queue and if it contains the word 'domain' it is a...
[ "Returns", "the", "AWS", "object", "associated", "with", "a", "given", "option", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/services/servicedef.py#L64-L89
51,017
guyskk/flask-restaction
flask_restaction/exporters.py
export_json
def export_json(data, status, headers): """ Creates a JSON response JSON content is encoded by utf-8, not unicode escape. Args: data: any type object that can dump to json status (int): http status code headers (dict): http headers """ dumped = json.dumps(data, ensure_a...
python
def export_json(data, status, headers): """ Creates a JSON response JSON content is encoded by utf-8, not unicode escape. Args: data: any type object that can dump to json status (int): http status code headers (dict): http headers """ dumped = json.dumps(data, ensure_a...
[ "def", "export_json", "(", "data", ",", "status", ",", "headers", ")", ":", "dumped", "=", "json", ".", "dumps", "(", "data", ",", "ensure_ascii", "=", "False", ")", "resp", "=", "current_app", ".", "response_class", "(", "dumped", ",", "status", "=", ...
Creates a JSON response JSON content is encoded by utf-8, not unicode escape. Args: data: any type object that can dump to json status (int): http status code headers (dict): http headers
[ "Creates", "a", "JSON", "response" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/exporters.py#L33-L48
51,018
yyuu/botornado
boto/rds/dbsecuritygroup.py
DBSecurityGroup.authorize
def authorize(self, cidr_ip=None, ec2_group=None): """ Add a new rule to this DBSecurity group. You need to pass in either a CIDR block to authorize or and EC2 SecurityGroup. @type cidr_ip: string @param cidr_ip: A valid CIDR IP range to authorize @type ec2_grou...
python
def authorize(self, cidr_ip=None, ec2_group=None): """ Add a new rule to this DBSecurity group. You need to pass in either a CIDR block to authorize or and EC2 SecurityGroup. @type cidr_ip: string @param cidr_ip: A valid CIDR IP range to authorize @type ec2_grou...
[ "def", "authorize", "(", "self", ",", "cidr_ip", "=", "None", ",", "ec2_group", "=", "None", ")", ":", "if", "isinstance", "(", "ec2_group", ",", "SecurityGroup", ")", ":", "group_name", "=", "ec2_group", ".", "name", "group_owner_id", "=", "ec2_group", "....
Add a new rule to this DBSecurity group. You need to pass in either a CIDR block to authorize or and EC2 SecurityGroup. @type cidr_ip: string @param cidr_ip: A valid CIDR IP range to authorize @type ec2_group: :class:`boto.ec2.securitygroup.SecurityGroup>` @rtype: bool...
[ "Add", "a", "new", "rule", "to", "this", "DBSecurity", "group", ".", "You", "need", "to", "pass", "in", "either", "a", "CIDR", "block", "to", "authorize", "or", "and", "EC2", "SecurityGroup", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/dbsecuritygroup.py#L68-L91
51,019
yyuu/botornado
boto/rds/dbsecuritygroup.py
DBSecurityGroup.revoke
def revoke(self, cidr_ip=None, ec2_group=None): """ Revoke access to a CIDR range or EC2 SecurityGroup. You need to pass in either a CIDR block or an EC2 SecurityGroup from which to revoke access. @type cidr_ip: string @param cidr_ip: A valid CIDR IP range to revoke ...
python
def revoke(self, cidr_ip=None, ec2_group=None): """ Revoke access to a CIDR range or EC2 SecurityGroup. You need to pass in either a CIDR block or an EC2 SecurityGroup from which to revoke access. @type cidr_ip: string @param cidr_ip: A valid CIDR IP range to revoke ...
[ "def", "revoke", "(", "self", ",", "cidr_ip", "=", "None", ",", "ec2_group", "=", "None", ")", ":", "if", "isinstance", "(", "ec2_group", ",", "SecurityGroup", ")", ":", "group_name", "=", "ec2_group", ".", "name", "group_owner_id", "=", "ec2_group", ".", ...
Revoke access to a CIDR range or EC2 SecurityGroup. You need to pass in either a CIDR block or an EC2 SecurityGroup from which to revoke access. @type cidr_ip: string @param cidr_ip: A valid CIDR IP range to revoke @type ec2_group: :class:`boto.ec2.securitygroup.SecurityGroup>`...
[ "Revoke", "access", "to", "a", "CIDR", "range", "or", "EC2", "SecurityGroup", ".", "You", "need", "to", "pass", "in", "either", "a", "CIDR", "block", "or", "an", "EC2", "SecurityGroup", "from", "which", "to", "revoke", "access", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/dbsecuritygroup.py#L93-L117
51,020
yyuu/botornado
boto/s3/multipart.py
part_lister
def part_lister(mpupload, part_number_marker=None): """ A generator function for listing parts of a multipart upload. """ more_results = True part = None while more_results: parts = mpupload.get_all_parts(None, part_number_marker) for part in parts: yield part ...
python
def part_lister(mpupload, part_number_marker=None): """ A generator function for listing parts of a multipart upload. """ more_results = True part = None while more_results: parts = mpupload.get_all_parts(None, part_number_marker) for part in parts: yield part ...
[ "def", "part_lister", "(", "mpupload", ",", "part_number_marker", "=", "None", ")", ":", "more_results", "=", "True", "part", "=", "None", "while", "more_results", ":", "parts", "=", "mpupload", ".", "get_all_parts", "(", "None", ",", "part_number_marker", ")"...
A generator function for listing parts of a multipart upload.
[ "A", "generator", "function", "for", "listing", "parts", "of", "a", "multipart", "upload", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/multipart.py#L105-L116
51,021
yyuu/botornado
boto/s3/multipart.py
MultiPartUpload.get_all_parts
def get_all_parts(self, max_parts=None, part_number_marker=None): """ Return the uploaded parts of this MultiPart Upload. This is a lower-level method that requires you to manually page through results. To simplify this process, you can just use the object itself as an iterator...
python
def get_all_parts(self, max_parts=None, part_number_marker=None): """ Return the uploaded parts of this MultiPart Upload. This is a lower-level method that requires you to manually page through results. To simplify this process, you can just use the object itself as an iterator...
[ "def", "get_all_parts", "(", "self", ",", "max_parts", "=", "None", ",", "part_number_marker", "=", "None", ")", ":", "self", ".", "_parts", "=", "[", "]", "query_args", "=", "'uploadId=%s'", "%", "self", ".", "id", "if", "max_parts", ":", "query_args", ...
Return the uploaded parts of this MultiPart Upload. This is a lower-level method that requires you to manually page through results. To simplify this process, you can just use the object itself as an iterator and it will automatically handle all of the paging with S3.
[ "Return", "the", "uploaded", "parts", "of", "this", "MultiPart", "Upload", ".", "This", "is", "a", "lower", "-", "level", "method", "that", "requires", "you", "to", "manually", "page", "through", "results", ".", "To", "simplify", "this", "process", "you", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/multipart.py#L190-L211
51,022
yyuu/botornado
boto/s3/multipart.py
MultiPartUpload.copy_part_from_key
def copy_part_from_key(self, src_bucket_name, src_key_name, part_num, start=None, end=None): """ Copy another part of this MultiPart Upload. :type src_bucket_name: string :param src_bucket_name: Name of the bucket containing the source key :type src_k...
python
def copy_part_from_key(self, src_bucket_name, src_key_name, part_num, start=None, end=None): """ Copy another part of this MultiPart Upload. :type src_bucket_name: string :param src_bucket_name: Name of the bucket containing the source key :type src_k...
[ "def", "copy_part_from_key", "(", "self", ",", "src_bucket_name", ",", "src_key_name", ",", "part_num", ",", "start", "=", "None", ",", "end", "=", "None", ")", ":", "if", "part_num", "<", "1", ":", "raise", "ValueError", "(", "'Part numbers must be greater th...
Copy another part of this MultiPart Upload. :type src_bucket_name: string :param src_bucket_name: Name of the bucket containing the source key :type src_key_name: string :param src_key_name: Name of the source key :type part_num: int :param part_num: The number of this...
[ "Copy", "another", "part", "of", "this", "MultiPart", "Upload", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/multipart.py#L236-L268
51,023
yyuu/botornado
boto/s3/multipart.py
MultiPartUpload.complete_upload
def complete_upload(self): """ Complete the MultiPart Upload operation. This method should be called when all parts of the file have been successfully uploaded to S3. :rtype: :class:`boto.s3.multipart.CompletedMultiPartUpload` :returns: An object representing the comple...
python
def complete_upload(self): """ Complete the MultiPart Upload operation. This method should be called when all parts of the file have been successfully uploaded to S3. :rtype: :class:`boto.s3.multipart.CompletedMultiPartUpload` :returns: An object representing the comple...
[ "def", "complete_upload", "(", "self", ")", ":", "xml", "=", "self", ".", "to_xml", "(", ")", "return", "self", ".", "bucket", ".", "complete_multipart_upload", "(", "self", ".", "key_name", ",", "self", ".", "id", ",", "xml", ")" ]
Complete the MultiPart Upload operation. This method should be called when all parts of the file have been successfully uploaded to S3. :rtype: :class:`boto.s3.multipart.CompletedMultiPartUpload` :returns: An object representing the completed upload.
[ "Complete", "the", "MultiPart", "Upload", "operation", ".", "This", "method", "should", "be", "called", "when", "all", "parts", "of", "the", "file", "have", "been", "successfully", "uploaded", "to", "S3", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/multipart.py#L270-L281
51,024
llazzaro/analyzerstrategies
analyzerstrategies/zscoreMomentumPortfolioStrategy.py
OneTraker.__placeSellOrder
def __placeSellOrder(self, tick): ''' place sell order ''' if self.__position < 0: return share=self.__position order=Order(accountId=self.__strategy.accountId, action=Action.SELL, is_market=True, sym...
python
def __placeSellOrder(self, tick): ''' place sell order ''' if self.__position < 0: return share=self.__position order=Order(accountId=self.__strategy.accountId, action=Action.SELL, is_market=True, sym...
[ "def", "__placeSellOrder", "(", "self", ",", "tick", ")", ":", "if", "self", ".", "__position", "<", "0", ":", "return", "share", "=", "self", ".", "__position", "order", "=", "Order", "(", "accountId", "=", "self", ".", "__strategy", ".", "accountId", ...
place sell order
[ "place", "sell", "order" ]
3c647802f582bf2f06c6793f282bee0d26514cd6
https://github.com/llazzaro/analyzerstrategies/blob/3c647802f582bf2f06c6793f282bee0d26514cd6/analyzerstrategies/zscoreMomentumPortfolioStrategy.py#L101-L114
51,025
mishbahr/django-connected
connected_accounts/views.py
OAuthRedirect.get_callback_url
def get_callback_url(self, provider): """Return the callback url for this provider.""" info = self.model._meta.app_label, self.model._meta.model_name return reverse('admin:%s_%s_callback' % info, kwargs={'provider': provider.id})
python
def get_callback_url(self, provider): """Return the callback url for this provider.""" info = self.model._meta.app_label, self.model._meta.model_name return reverse('admin:%s_%s_callback' % info, kwargs={'provider': provider.id})
[ "def", "get_callback_url", "(", "self", ",", "provider", ")", ":", "info", "=", "self", ".", "model", ".", "_meta", ".", "app_label", ",", "self", ".", "model", ".", "_meta", ".", "model_name", "return", "reverse", "(", "'admin:%s_%s_callback'", "%", "info...
Return the callback url for this provider.
[ "Return", "the", "callback", "url", "for", "this", "provider", "." ]
7ec1f042786fef2eb6c00b1479ce47c90341ba81
https://github.com/mishbahr/django-connected/blob/7ec1f042786fef2eb6c00b1479ce47c90341ba81/connected_accounts/views.py#L42-L45
51,026
mishbahr/django-connected
connected_accounts/views.py
OAuthCallback.get_login_redirect
def get_login_redirect(self, provider, account): """Return url to redirect authenticated users.""" info = self.model._meta.app_label, self.model._meta.model_name # inline import to prevent circular imports. from .admin import PRESERVED_FILTERS_SESSION_KEY preserved_filters = self...
python
def get_login_redirect(self, provider, account): """Return url to redirect authenticated users.""" info = self.model._meta.app_label, self.model._meta.model_name # inline import to prevent circular imports. from .admin import PRESERVED_FILTERS_SESSION_KEY preserved_filters = self...
[ "def", "get_login_redirect", "(", "self", ",", "provider", ",", "account", ")", ":", "info", "=", "self", ".", "model", ".", "_meta", ".", "app_label", ",", "self", ".", "model", ".", "_meta", ".", "model_name", "# inline import to prevent circular imports.", ...
Return url to redirect authenticated users.
[ "Return", "url", "to", "redirect", "authenticated", "users", "." ]
7ec1f042786fef2eb6c00b1479ce47c90341ba81
https://github.com/mishbahr/django-connected/blob/7ec1f042786fef2eb6c00b1479ce47c90341ba81/connected_accounts/views.py#L119-L129
51,027
mishbahr/django-connected
connected_accounts/views.py
OAuthCallback.get_error_redirect
def get_error_redirect(self, provider, reason): """Return url to redirect on login failure.""" info = self.model._meta.app_label, self.model._meta.model_name return reverse('admin:%s_%s_changelist' % info)
python
def get_error_redirect(self, provider, reason): """Return url to redirect on login failure.""" info = self.model._meta.app_label, self.model._meta.model_name return reverse('admin:%s_%s_changelist' % info)
[ "def", "get_error_redirect", "(", "self", ",", "provider", ",", "reason", ")", ":", "info", "=", "self", ".", "model", ".", "_meta", ".", "app_label", ",", "self", ".", "model", ".", "_meta", ".", "model_name", "return", "reverse", "(", "'admin:%s_%s_chang...
Return url to redirect on login failure.
[ "Return", "url", "to", "redirect", "on", "login", "failure", "." ]
7ec1f042786fef2eb6c00b1479ce47c90341ba81
https://github.com/mishbahr/django-connected/blob/7ec1f042786fef2eb6c00b1479ce47c90341ba81/connected_accounts/views.py#L131-L134
51,028
mishbahr/django-connected
connected_accounts/views.py
OAuthCallback.handle_login_failure
def handle_login_failure(self, provider, reason): """Message user and redirect on error.""" logger.error('Authenication Failure: {0}'.format(reason)) messages.error(self.request, 'Authenication Failed. Please try again') return redirect(self.get_error_redirect(provider, reason))
python
def handle_login_failure(self, provider, reason): """Message user and redirect on error.""" logger.error('Authenication Failure: {0}'.format(reason)) messages.error(self.request, 'Authenication Failed. Please try again') return redirect(self.get_error_redirect(provider, reason))
[ "def", "handle_login_failure", "(", "self", ",", "provider", ",", "reason", ")", ":", "logger", ".", "error", "(", "'Authenication Failure: {0}'", ".", "format", "(", "reason", ")", ")", "messages", ".", "error", "(", "self", ".", "request", ",", "'Authenica...
Message user and redirect on error.
[ "Message", "user", "and", "redirect", "on", "error", "." ]
7ec1f042786fef2eb6c00b1479ce47c90341ba81
https://github.com/mishbahr/django-connected/blob/7ec1f042786fef2eb6c00b1479ce47c90341ba81/connected_accounts/views.py#L136-L140
51,029
yyuu/botornado
boto/manage/cmdshell.py
sshclient_from_instance
def sshclient_from_instance(instance, ssh_key_file, host_key_file='~/.ssh/known_hosts', user_name='root', ssh_pwd=None): """ Create and return an SSHClient object given an instance object. :type instance: :class`boto.ec2.instance.Instance` object ...
python
def sshclient_from_instance(instance, ssh_key_file, host_key_file='~/.ssh/known_hosts', user_name='root', ssh_pwd=None): """ Create and return an SSHClient object given an instance object. :type instance: :class`boto.ec2.instance.Instance` object ...
[ "def", "sshclient_from_instance", "(", "instance", ",", "ssh_key_file", ",", "host_key_file", "=", "'~/.ssh/known_hosts'", ",", "user_name", "=", "'root'", ",", "ssh_pwd", "=", "None", ")", ":", "s", "=", "FakeServer", "(", "instance", ",", "ssh_key_file", ")", ...
Create and return an SSHClient object given an instance object. :type instance: :class`boto.ec2.instance.Instance` object :param instance: The instance object. :type ssh_key_file: str :param ssh_key_file: A path to the private key file used to log into instance. :type...
[ "Create", "and", "return", "an", "SSHClient", "object", "given", "an", "instance", "object", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/manage/cmdshell.py#L214-L241
51,030
yyuu/botornado
boto/manage/cmdshell.py
SSHClient.open
def open(self, filename, mode='r', bufsize=-1): """ Open a file on the remote system and return a file-like object. """ sftp_client = self.open_sftp() return sftp_client.open(filename, mode, bufsize)
python
def open(self, filename, mode='r', bufsize=-1): """ Open a file on the remote system and return a file-like object. """ sftp_client = self.open_sftp() return sftp_client.open(filename, mode, bufsize)
[ "def", "open", "(", "self", ",", "filename", ",", "mode", "=", "'r'", ",", "bufsize", "=", "-", "1", ")", ":", "sftp_client", "=", "self", ".", "open_sftp", "(", ")", "return", "sftp_client", ".", "open", "(", "filename", ",", "mode", ",", "bufsize",...
Open a file on the remote system and return a file-like object.
[ "Open", "a", "file", "on", "the", "remote", "system", "and", "return", "a", "file", "-", "like", "object", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/manage/cmdshell.py#L86-L91
51,031
yyuu/botornado
boto/manage/cmdshell.py
SSHClient.run
def run(self, command): """ Execute a command on the remote host. Return a tuple containing an integer status and a two strings, the first containing stdout and the second containing stderr from the command. """ boto.log.debug('running:%s on %s' % (command, self.server.i...
python
def run(self, command): """ Execute a command on the remote host. Return a tuple containing an integer status and a two strings, the first containing stdout and the second containing stderr from the command. """ boto.log.debug('running:%s on %s' % (command, self.server.i...
[ "def", "run", "(", "self", ",", "command", ")", ":", "boto", ".", "log", ".", "debug", "(", "'running:%s on %s'", "%", "(", "command", ",", "self", ".", "server", ".", "instance_id", ")", ")", "status", "=", "0", "try", ":", "t", "=", "self", ".", ...
Execute a command on the remote host. Return a tuple containing an integer status and a two strings, the first containing stdout and the second containing stderr from the command.
[ "Execute", "a", "command", "on", "the", "remote", "host", ".", "Return", "a", "tuple", "containing", "an", "integer", "status", "and", "a", "two", "strings", "the", "first", "containing", "stdout", "and", "the", "second", "containing", "stderr", "from", "the...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/manage/cmdshell.py#L116-L135
51,032
yyuu/botornado
boto/manage/cmdshell.py
SSHClient.run_pty
def run_pty(self, command): """ Execute a command on the remote host with a pseudo-terminal. Returns a string containing the output of the command. """ boto.log.debug('running:%s on %s' % (command, self.server.instance_id)) channel = self._ssh_client.get_transport().open_...
python
def run_pty(self, command): """ Execute a command on the remote host with a pseudo-terminal. Returns a string containing the output of the command. """ boto.log.debug('running:%s on %s' % (command, self.server.instance_id)) channel = self._ssh_client.get_transport().open_...
[ "def", "run_pty", "(", "self", ",", "command", ")", ":", "boto", ".", "log", ".", "debug", "(", "'running:%s on %s'", "%", "(", "command", ",", "self", ".", "server", ".", "instance_id", ")", ")", "channel", "=", "self", ".", "_ssh_client", ".", "get_t...
Execute a command on the remote host with a pseudo-terminal. Returns a string containing the output of the command.
[ "Execute", "a", "command", "on", "the", "remote", "host", "with", "a", "pseudo", "-", "terminal", ".", "Returns", "a", "string", "containing", "the", "output", "of", "the", "command", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/manage/cmdshell.py#L137-L146
51,033
gmichaeljaison/cv-utils
cv_utils/feature_extractor.py
factory
def factory(feature): """ Factory to choose feature extractor :param feature: name of the feature :return: Feature extractor function """ if feature == 'hog': return hog elif feature == 'deep': return deep elif feature == 'gray': return gray elif feature == '...
python
def factory(feature): """ Factory to choose feature extractor :param feature: name of the feature :return: Feature extractor function """ if feature == 'hog': return hog elif feature == 'deep': return deep elif feature == 'gray': return gray elif feature == '...
[ "def", "factory", "(", "feature", ")", ":", "if", "feature", "==", "'hog'", ":", "return", "hog", "elif", "feature", "==", "'deep'", ":", "return", "deep", "elif", "feature", "==", "'gray'", ":", "return", "gray", "elif", "feature", "==", "'lab'", ":", ...
Factory to choose feature extractor :param feature: name of the feature :return: Feature extractor function
[ "Factory", "to", "choose", "feature", "extractor" ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/feature_extractor.py#L13-L35
51,034
gmichaeljaison/cv-utils
cv_utils/feature_extractor.py
hog
def hog(img, options=None): """ HOG feature extractor. :param img: :param options: :return: HOG Feature for given image The output will have channels same as number of orientations. Height and Width will be reduced based on block-size and cell-size """ op = _DEF_HOG_OPTS.cop...
python
def hog(img, options=None): """ HOG feature extractor. :param img: :param options: :return: HOG Feature for given image The output will have channels same as number of orientations. Height and Width will be reduced based on block-size and cell-size """ op = _DEF_HOG_OPTS.cop...
[ "def", "hog", "(", "img", ",", "options", "=", "None", ")", ":", "op", "=", "_DEF_HOG_OPTS", ".", "copy", "(", ")", "if", "options", "is", "not", "None", ":", "op", ".", "update", "(", "options", ")", "img", "=", "gray", "(", "img", ")", "img_fd"...
HOG feature extractor. :param img: :param options: :return: HOG Feature for given image The output will have channels same as number of orientations. Height and Width will be reduced based on block-size and cell-size
[ "HOG", "feature", "extractor", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/feature_extractor.py#L51-L82
51,035
yyuu/botornado
boto/file/key.py
Key.get_file
def get_file(self, fp, headers=None, cb=None, num_cb=10, torrent=False): """ Retrieves a file from a Key :type fp: file :param fp: File pointer to put the data into :type headers: string :param: ignored in this subclass. :type cb: function :param cb: ig...
python
def get_file(self, fp, headers=None, cb=None, num_cb=10, torrent=False): """ Retrieves a file from a Key :type fp: file :param fp: File pointer to put the data into :type headers: string :param: ignored in this subclass. :type cb: function :param cb: ig...
[ "def", "get_file", "(", "self", ",", "fp", ",", "headers", "=", "None", ",", "cb", "=", "None", ",", "num_cb", "=", "10", ",", "torrent", "=", "False", ")", ":", "if", "self", ".", "key_type", "&", "self", ".", "KEY_STREAM_READABLE", ":", "raise", ...
Retrieves a file from a Key :type fp: file :param fp: File pointer to put the data into :type headers: string :param: ignored in this subclass. :type cb: function :param cb: ignored in this subclass. :type cb: int :param num_cb: ignored in this subclas...
[ "Retrieves", "a", "file", "from", "a", "Key" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/file/key.py#L55-L80
51,036
yyuu/botornado
boto/file/key.py
Key.set_contents_from_file
def set_contents_from_file(self, fp, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None): """ Store an object in a file using the name of the Key object as the key in file URI and the contents of the file pointed to by 'fp' as the content...
python
def set_contents_from_file(self, fp, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None): """ Store an object in a file using the name of the Key object as the key in file URI and the contents of the file pointed to by 'fp' as the content...
[ "def", "set_contents_from_file", "(", "self", ",", "fp", ",", "headers", "=", "None", ",", "replace", "=", "True", ",", "cb", "=", "None", ",", "num_cb", "=", "10", ",", "policy", "=", "None", ",", "md5", "=", "None", ")", ":", "if", "self", ".", ...
Store an object in a file using the name of the Key object as the key in file URI and the contents of the file pointed to by 'fp' as the contents. :type fp: file :param fp: the file whose contents to upload :type headers: dict :param headers: ignored in this subclass. ...
[ "Store", "an", "object", "in", "a", "file", "using", "the", "name", "of", "the", "Key", "object", "as", "the", "key", "in", "file", "URI", "and", "the", "contents", "of", "the", "file", "pointed", "to", "by", "fp", "as", "the", "contents", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/file/key.py#L82-L128
51,037
yyuu/botornado
boto/file/key.py
Key.get_contents_as_string
def get_contents_as_string(self, headers=None, cb=None, num_cb=10, torrent=False): """ Retrieve file data from the Key, and return contents as a string. :type headers: dict :param headers: ignored in this subclass. :type cb: function :para...
python
def get_contents_as_string(self, headers=None, cb=None, num_cb=10, torrent=False): """ Retrieve file data from the Key, and return contents as a string. :type headers: dict :param headers: ignored in this subclass. :type cb: function :para...
[ "def", "get_contents_as_string", "(", "self", ",", "headers", "=", "None", ",", "cb", "=", "None", ",", "num_cb", "=", "10", ",", "torrent", "=", "False", ")", ":", "fp", "=", "StringIO", ".", "StringIO", "(", ")", "self", ".", "get_contents_to_file", ...
Retrieve file data from the Key, and return contents as a string. :type headers: dict :param headers: ignored in this subclass. :type cb: function :param cb: ignored in this subclass. :type cb: int :param num_cb: ignored in this subclass. :type cb: int ...
[ "Retrieve", "file", "data", "from", "the", "Key", "and", "return", "contents", "as", "a", "string", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/file/key.py#L130-L156
51,038
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.enclosing_box
def enclosing_box(boxes): """ Finds a new box that exactly encloses all the given boxes. :param boxes: Array of Box objects :return: Box object that encloses all boxes """ x = max(0, min([box.x for box in boxes])) y = max(0, min([box.y for box in boxes])) ...
python
def enclosing_box(boxes): """ Finds a new box that exactly encloses all the given boxes. :param boxes: Array of Box objects :return: Box object that encloses all boxes """ x = max(0, min([box.x for box in boxes])) y = max(0, min([box.y for box in boxes])) ...
[ "def", "enclosing_box", "(", "boxes", ")", ":", "x", "=", "max", "(", "0", ",", "min", "(", "[", "box", ".", "x", "for", "box", "in", "boxes", "]", ")", ")", "y", "=", "max", "(", "0", ",", "min", "(", "[", "box", ".", "y", "for", "box", ...
Finds a new box that exactly encloses all the given boxes. :param boxes: Array of Box objects :return: Box object that encloses all boxes
[ "Finds", "a", "new", "box", "that", "exactly", "encloses", "all", "the", "given", "boxes", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L33-L44
51,039
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.left_most
def left_most(boxes): """ Finds the left most box out of the given boxes. :param boxes: Array of Box objects :return: The left-most Box object """ x_list = [(box.x, box) for box in boxes] x_list.sort() return x_list[0][1]
python
def left_most(boxes): """ Finds the left most box out of the given boxes. :param boxes: Array of Box objects :return: The left-most Box object """ x_list = [(box.x, box) for box in boxes] x_list.sort() return x_list[0][1]
[ "def", "left_most", "(", "boxes", ")", ":", "x_list", "=", "[", "(", "box", ".", "x", ",", "box", ")", "for", "box", "in", "boxes", "]", "x_list", ".", "sort", "(", ")", "return", "x_list", "[", "0", "]", "[", "1", "]" ]
Finds the left most box out of the given boxes. :param boxes: Array of Box objects :return: The left-most Box object
[ "Finds", "the", "left", "most", "box", "out", "of", "the", "given", "boxes", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L47-L56
51,040
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.right_most
def right_most(boxes): """ Finds the right most box out of the given boxes. :param boxes: Array of Box objects :return: The right-most Box object """ x_list = [(box.x, box) for box in boxes] x_list.sort() return x_list[-1][1]
python
def right_most(boxes): """ Finds the right most box out of the given boxes. :param boxes: Array of Box objects :return: The right-most Box object """ x_list = [(box.x, box) for box in boxes] x_list.sort() return x_list[-1][1]
[ "def", "right_most", "(", "boxes", ")", ":", "x_list", "=", "[", "(", "box", ".", "x", ",", "box", ")", "for", "box", "in", "boxes", "]", "x_list", ".", "sort", "(", ")", "return", "x_list", "[", "-", "1", "]", "[", "1", "]" ]
Finds the right most box out of the given boxes. :param boxes: Array of Box objects :return: The right-most Box object
[ "Finds", "the", "right", "most", "box", "out", "of", "the", "given", "boxes", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L59-L68
51,041
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.intersection_box
def intersection_box(box1, box2): """ Finds an intersection box that is common to both given boxes. :param box1: Box object 1 :param box2: Box object 2 :return: None if there is no intersection otherwise the new Box """ b1_x2, b1_y2 = box1.bottom_right() ...
python
def intersection_box(box1, box2): """ Finds an intersection box that is common to both given boxes. :param box1: Box object 1 :param box2: Box object 2 :return: None if there is no intersection otherwise the new Box """ b1_x2, b1_y2 = box1.bottom_right() ...
[ "def", "intersection_box", "(", "box1", ",", "box2", ")", ":", "b1_x2", ",", "b1_y2", "=", "box1", ".", "bottom_right", "(", ")", "b2_x2", ",", "b2_y2", "=", "box2", ".", "bottom_right", "(", ")", "x", ",", "y", "=", "max", "(", "box1", ".", "x", ...
Finds an intersection box that is common to both given boxes. :param box1: Box object 1 :param box2: Box object 2 :return: None if there is no intersection otherwise the new Box
[ "Finds", "an", "intersection", "box", "that", "is", "common", "to", "both", "given", "boxes", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L71-L85
51,042
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.overlaps
def overlaps(self, box, th=0.0001): """ Check whether this box and given box overlaps at least by given threshold. :param box: Box to compare with :param th: Threshold above which overlapping should be considered :returns: True if overlaps """ int_box = Box.inter...
python
def overlaps(self, box, th=0.0001): """ Check whether this box and given box overlaps at least by given threshold. :param box: Box to compare with :param th: Threshold above which overlapping should be considered :returns: True if overlaps """ int_box = Box.inter...
[ "def", "overlaps", "(", "self", ",", "box", ",", "th", "=", "0.0001", ")", ":", "int_box", "=", "Box", ".", "intersection_box", "(", "self", ",", "box", ")", "small_box", "=", "self", "if", "self", ".", "smaller", "(", "box", ")", "else", "box", "r...
Check whether this box and given box overlaps at least by given threshold. :param box: Box to compare with :param th: Threshold above which overlapping should be considered :returns: True if overlaps
[ "Check", "whether", "this", "box", "and", "given", "box", "overlaps", "at", "least", "by", "given", "threshold", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L121-L131
51,043
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.expand
def expand(self, percentage): """ Expands the box co-ordinates by given percentage on four sides. Ignores negative values. :param percentage: Percentage to expand :return: New expanded Box """ ex_h = math.ceil(self.height * percentage / 100) ex_w = math.ceil(self...
python
def expand(self, percentage): """ Expands the box co-ordinates by given percentage on four sides. Ignores negative values. :param percentage: Percentage to expand :return: New expanded Box """ ex_h = math.ceil(self.height * percentage / 100) ex_w = math.ceil(self...
[ "def", "expand", "(", "self", ",", "percentage", ")", ":", "ex_h", "=", "math", ".", "ceil", "(", "self", ".", "height", "*", "percentage", "/", "100", ")", "ex_w", "=", "math", ".", "ceil", "(", "self", ".", "width", "*", "percentage", "/", "100",...
Expands the box co-ordinates by given percentage on four sides. Ignores negative values. :param percentage: Percentage to expand :return: New expanded Box
[ "Expands", "the", "box", "co", "-", "ordinates", "by", "given", "percentage", "on", "four", "sides", ".", "Ignores", "negative", "values", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L133-L147
51,044
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.padding
def padding(self, px): """ Add padding around four sides of box :param px: padding value in pixels. Can be an array in the format of [top right bottom left] or single value. :return: New padding added box """ # if px is not an array, have equal padding all si...
python
def padding(self, px): """ Add padding around four sides of box :param px: padding value in pixels. Can be an array in the format of [top right bottom left] or single value. :return: New padding added box """ # if px is not an array, have equal padding all si...
[ "def", "padding", "(", "self", ",", "px", ")", ":", "# if px is not an array, have equal padding all sides", "if", "not", "isinstance", "(", "px", ",", "list", ")", ":", "px", "=", "[", "px", "]", "*", "4", "x", "=", "max", "(", "0", ",", "self", ".", ...
Add padding around four sides of box :param px: padding value in pixels. Can be an array in the format of [top right bottom left] or single value. :return: New padding added box
[ "Add", "padding", "around", "four", "sides", "of", "box" ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L149-L165
51,045
gmichaeljaison/cv-utils
cv_utils/bbox.py
Box.pos_by_percent
def pos_by_percent(self, x_percent, y_percent): """ Finds a point inside the box that is exactly at the given percentage place. :param x_percent: how much percentage from left edge :param y_percent: how much percentage from top edge :return: A point inside the box """ ...
python
def pos_by_percent(self, x_percent, y_percent): """ Finds a point inside the box that is exactly at the given percentage place. :param x_percent: how much percentage from left edge :param y_percent: how much percentage from top edge :return: A point inside the box """ ...
[ "def", "pos_by_percent", "(", "self", ",", "x_percent", ",", "y_percent", ")", ":", "x", "=", "round", "(", "x_percent", "*", "self", ".", "width", ")", "y", "=", "round", "(", "y_percent", "*", "self", ".", "height", ")", "return", "int", "(", "x", ...
Finds a point inside the box that is exactly at the given percentage place. :param x_percent: how much percentage from left edge :param y_percent: how much percentage from top edge :return: A point inside the box
[ "Finds", "a", "point", "inside", "the", "box", "that", "is", "exactly", "at", "the", "given", "percentage", "place", "." ]
a8251c870165a7428d8c468a6436aa41d0cf7c09
https://github.com/gmichaeljaison/cv-utils/blob/a8251c870165a7428d8c468a6436aa41d0cf7c09/cv_utils/bbox.py#L186-L196
51,046
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment.pip_version
def pip_version(self): """Version of installed pip.""" if not self._pip_exists: return None if not hasattr(self, '_pip_version'): # don't call `self._execute_pip` here as that method calls this one output = self._execute(self._pip + ['-V'], log=False).split()[...
python
def pip_version(self): """Version of installed pip.""" if not self._pip_exists: return None if not hasattr(self, '_pip_version'): # don't call `self._execute_pip` here as that method calls this one output = self._execute(self._pip + ['-V'], log=False).split()[...
[ "def", "pip_version", "(", "self", ")", ":", "if", "not", "self", ".", "_pip_exists", ":", "return", "None", "if", "not", "hasattr", "(", "self", ",", "'_pip_version'", ")", ":", "# don't call `self._execute_pip` here as that method calls this one", "output", "=", ...
Version of installed pip.
[ "Version", "of", "installed", "pip", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L60-L68
51,047
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment._create
def _create(self): """Executes `virtualenv` to create a new environment.""" if self.readonly: raise VirtualenvReadonlyException() args = ['virtualenv'] if self.system_site_packages: args.append('--system-site-packages') if self.python is None: ...
python
def _create(self): """Executes `virtualenv` to create a new environment.""" if self.readonly: raise VirtualenvReadonlyException() args = ['virtualenv'] if self.system_site_packages: args.append('--system-site-packages') if self.python is None: ...
[ "def", "_create", "(", "self", ")", ":", "if", "self", ".", "readonly", ":", "raise", "VirtualenvReadonlyException", "(", ")", "args", "=", "[", "'virtualenv'", "]", "if", "self", ".", "system_site_packages", ":", "args", ".", "append", "(", "'--system-site-...
Executes `virtualenv` to create a new environment.
[ "Executes", "virtualenv", "to", "create", "a", "new", "environment", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L90-L107
51,048
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment._execute_pip
def _execute_pip(self, args, log=True): """ Executes pip commands. :param args: Arguments to pass to pip (list[str]) :param log: Log the output to a file [default: True] (boolean) :return: See _execute """ # Copy the pip calling arguments so they can be extended...
python
def _execute_pip(self, args, log=True): """ Executes pip commands. :param args: Arguments to pass to pip (list[str]) :param log: Log the output to a file [default: True] (boolean) :return: See _execute """ # Copy the pip calling arguments so they can be extended...
[ "def", "_execute_pip", "(", "self", ",", "args", ",", "log", "=", "True", ")", ":", "# Copy the pip calling arguments so they can be extended", "exec_args", "=", "list", "(", "self", ".", "_pip", ")", "# Older versions of pip don't support the version check argument.", "#...
Executes pip commands. :param args: Arguments to pass to pip (list[str]) :param log: Log the output to a file [default: True] (boolean) :return: See _execute
[ "Executes", "pip", "commands", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L109-L127
51,049
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment._execute
def _execute(self, args, log=True): """Executes the given command inside the environment and returns the output.""" if not self._ready: self.open_or_create() output = '' error = '' try: proc = subprocess.Popen(args, cwd=self.path, env=self.env, stdout=subp...
python
def _execute(self, args, log=True): """Executes the given command inside the environment and returns the output.""" if not self._ready: self.open_or_create() output = '' error = '' try: proc = subprocess.Popen(args, cwd=self.path, env=self.env, stdout=subp...
[ "def", "_execute", "(", "self", ",", "args", ",", "log", "=", "True", ")", ":", "if", "not", "self", ".", "_ready", ":", "self", ".", "open_or_create", "(", ")", "output", "=", "''", "error", "=", "''", "try", ":", "proc", "=", "subprocess", ".", ...
Executes the given command inside the environment and returns the output.
[ "Executes", "the", "given", "command", "inside", "the", "environment", "and", "returns", "the", "output", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L129-L158
51,050
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment._write_to_log
def _write_to_log(self, s, truncate=False): """Writes the given output to the log file, appending unless `truncate` is True.""" # if truncate is True, set write mode to truncate with open(self._logfile, 'w' if truncate else 'a') as fp: fp.writelines((to_text(s) if six.PY2 else to_tex...
python
def _write_to_log(self, s, truncate=False): """Writes the given output to the log file, appending unless `truncate` is True.""" # if truncate is True, set write mode to truncate with open(self._logfile, 'w' if truncate else 'a') as fp: fp.writelines((to_text(s) if six.PY2 else to_tex...
[ "def", "_write_to_log", "(", "self", ",", "s", ",", "truncate", "=", "False", ")", ":", "# if truncate is True, set write mode to truncate", "with", "open", "(", "self", ".", "_logfile", ",", "'w'", "if", "truncate", "else", "'a'", ")", "as", "fp", ":", "fp"...
Writes the given output to the log file, appending unless `truncate` is True.
[ "Writes", "the", "given", "output", "to", "the", "log", "file", "appending", "unless", "truncate", "is", "True", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L160-L164
51,051
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment._write_to_error
def _write_to_error(self, s, truncate=False): """Writes the given output to the error file, appending unless `truncate` is True.""" # if truncate is True, set write mode to truncate with open(self._errorfile, 'w' if truncate else 'a') as fp: fp.writelines((to_text(s)), )
python
def _write_to_error(self, s, truncate=False): """Writes the given output to the error file, appending unless `truncate` is True.""" # if truncate is True, set write mode to truncate with open(self._errorfile, 'w' if truncate else 'a') as fp: fp.writelines((to_text(s)), )
[ "def", "_write_to_error", "(", "self", ",", "s", ",", "truncate", "=", "False", ")", ":", "# if truncate is True, set write mode to truncate", "with", "open", "(", "self", ".", "_errorfile", ",", "'w'", "if", "truncate", "else", "'a'", ")", "as", "fp", ":", ...
Writes the given output to the error file, appending unless `truncate` is True.
[ "Writes", "the", "given", "output", "to", "the", "error", "file", "appending", "unless", "truncate", "is", "True", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L166-L170
51,052
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment._pip_exists
def _pip_exists(self): """Returns True if pip exists inside the virtual environment. Can be used as a naive way to verify that the environment is installed.""" return os.path.isfile(os.path.join(self.path, 'bin', 'pip'))
python
def _pip_exists(self): """Returns True if pip exists inside the virtual environment. Can be used as a naive way to verify that the environment is installed.""" return os.path.isfile(os.path.join(self.path, 'bin', 'pip'))
[ "def", "_pip_exists", "(", "self", ")", ":", "return", "os", ".", "path", ".", "isfile", "(", "os", ".", "path", ".", "join", "(", "self", ".", "path", ",", "'bin'", ",", "'pip'", ")", ")" ]
Returns True if pip exists inside the virtual environment. Can be used as a naive way to verify that the environment is installed.
[ "Returns", "True", "if", "pip", "exists", "inside", "the", "virtual", "environment", ".", "Can", "be", "used", "as", "a", "naive", "way", "to", "verify", "that", "the", "environment", "is", "installed", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L172-L175
51,053
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment.upgrade
def upgrade(self, package, force=False): """Shortcut method to upgrade a package. If `force` is set to True, the package and all of its dependencies will be reinstalled, otherwise if the package is up to date, this command is a no-op.""" self.install(package, upgrade=True, force=force)
python
def upgrade(self, package, force=False): """Shortcut method to upgrade a package. If `force` is set to True, the package and all of its dependencies will be reinstalled, otherwise if the package is up to date, this command is a no-op.""" self.install(package, upgrade=True, force=force)
[ "def", "upgrade", "(", "self", ",", "package", ",", "force", "=", "False", ")", ":", "self", ".", "install", "(", "package", ",", "upgrade", "=", "True", ",", "force", "=", "force", ")" ]
Shortcut method to upgrade a package. If `force` is set to True, the package and all of its dependencies will be reinstalled, otherwise if the package is up to date, this command is a no-op.
[ "Shortcut", "method", "to", "upgrade", "a", "package", ".", "If", "force", "is", "set", "to", "True", "the", "package", "and", "all", "of", "its", "dependencies", "will", "be", "reinstalled", "otherwise", "if", "the", "package", "is", "up", "to", "date", ...
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L281-L285
51,054
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment.upgrade_all
def upgrade_all(self): """ Upgrades all installed packages to their latest versions. """ for pkg in self.installed_package_names: self.install(pkg, upgrade=True)
python
def upgrade_all(self): """ Upgrades all installed packages to their latest versions. """ for pkg in self.installed_package_names: self.install(pkg, upgrade=True)
[ "def", "upgrade_all", "(", "self", ")", ":", "for", "pkg", "in", "self", ".", "installed_package_names", ":", "self", ".", "install", "(", "pkg", ",", "upgrade", "=", "True", ")" ]
Upgrades all installed packages to their latest versions.
[ "Upgrades", "all", "installed", "packages", "to", "their", "latest", "versions", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L287-L292
51,055
sjkingo/virtualenv-api
virtualenvapi/manage.py
VirtualEnvironment.search
def search(self, term): """ Searches the PyPi repository for the given `term` and returns a dictionary of results. New in 2.1.5: returns a dictionary instead of list of tuples """ packages = {} results = self._execute_pip(['search', term], log=False) # Don't wan...
python
def search(self, term): """ Searches the PyPi repository for the given `term` and returns a dictionary of results. New in 2.1.5: returns a dictionary instead of list of tuples """ packages = {} results = self._execute_pip(['search', term], log=False) # Don't wan...
[ "def", "search", "(", "self", ",", "term", ")", ":", "packages", "=", "{", "}", "results", "=", "self", ".", "_execute_pip", "(", "[", "'search'", ",", "term", "]", ",", "log", "=", "False", ")", "# Don't want to log searches", "for", "result", "in", "...
Searches the PyPi repository for the given `term` and returns a dictionary of results. New in 2.1.5: returns a dictionary instead of list of tuples
[ "Searches", "the", "PyPi", "repository", "for", "the", "given", "term", "and", "returns", "a", "dictionary", "of", "results", "." ]
146a181e540ae2ae89c2542497dea0cedbc78839
https://github.com/sjkingo/virtualenv-api/blob/146a181e540ae2ae89c2542497dea0cedbc78839/virtualenvapi/manage.py#L294-L315
51,056
yyuu/botornado
boto/ec2/elb/loadbalancer.py
LoadBalancer.enable_zones
def enable_zones(self, zones): """ Enable availability zones to this Access Point. All zones must be in the same region as the Access Point. :type zones: string or List of strings :param zones: The name of the zone(s) to add. """ if isinstance(zones, str) or isi...
python
def enable_zones(self, zones): """ Enable availability zones to this Access Point. All zones must be in the same region as the Access Point. :type zones: string or List of strings :param zones: The name of the zone(s) to add. """ if isinstance(zones, str) or isi...
[ "def", "enable_zones", "(", "self", ",", "zones", ")", ":", "if", "isinstance", "(", "zones", ",", "str", ")", "or", "isinstance", "(", "zones", ",", "unicode", ")", ":", "zones", "=", "[", "zones", "]", "new_zones", "=", "self", ".", "connection", "...
Enable availability zones to this Access Point. All zones must be in the same region as the Access Point. :type zones: string or List of strings :param zones: The name of the zone(s) to add.
[ "Enable", "availability", "zones", "to", "this", "Access", "Point", ".", "All", "zones", "must", "be", "in", "the", "same", "region", "as", "the", "Access", "Point", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/elb/loadbalancer.py#L131-L143
51,057
yyuu/botornado
boto/ec2/elb/loadbalancer.py
LoadBalancer.disable_zones
def disable_zones(self, zones): """ Disable availability zones from this Access Point. :type zones: string or List of strings :param zones: The name of the zone(s) to add. """ if isinstance(zones, str) or isinstance(zones, unicode): zones = [zones] n...
python
def disable_zones(self, zones): """ Disable availability zones from this Access Point. :type zones: string or List of strings :param zones: The name of the zone(s) to add. """ if isinstance(zones, str) or isinstance(zones, unicode): zones = [zones] n...
[ "def", "disable_zones", "(", "self", ",", "zones", ")", ":", "if", "isinstance", "(", "zones", ",", "str", ")", "or", "isinstance", "(", "zones", ",", "unicode", ")", ":", "zones", "=", "[", "zones", "]", "new_zones", "=", "self", ".", "connection", ...
Disable availability zones from this Access Point. :type zones: string or List of strings :param zones: The name of the zone(s) to add.
[ "Disable", "availability", "zones", "from", "this", "Access", "Point", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/elb/loadbalancer.py#L145-L156
51,058
yyuu/botornado
boto/ec2/elb/loadbalancer.py
LoadBalancer.register_instances
def register_instances(self, instances): """ Adds instances to this load balancer. All instances must be in the same region as the load balancer. Adding endpoints that are already registered with the load balancer has no effect. :param list instances: List of instance IDs (strin...
python
def register_instances(self, instances): """ Adds instances to this load balancer. All instances must be in the same region as the load balancer. Adding endpoints that are already registered with the load balancer has no effect. :param list instances: List of instance IDs (strin...
[ "def", "register_instances", "(", "self", ",", "instances", ")", ":", "if", "isinstance", "(", "instances", ",", "str", ")", "or", "isinstance", "(", "instances", ",", "unicode", ")", ":", "instances", "=", "[", "instances", "]", "new_instances", "=", "sel...
Adds instances to this load balancer. All instances must be in the same region as the load balancer. Adding endpoints that are already registered with the load balancer has no effect. :param list instances: List of instance IDs (strings) that you'd like to add to this load balancer.
[ "Adds", "instances", "to", "this", "load", "balancer", ".", "All", "instances", "must", "be", "in", "the", "same", "region", "as", "the", "load", "balancer", ".", "Adding", "endpoints", "that", "are", "already", "registered", "with", "the", "load", "balancer...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/elb/loadbalancer.py#L158-L171
51,059
staggerpkg/stagger
stagger/tags.py
frameclass
def frameclass(cls): """Register cls as a class representing an ID3 frame. Sets cls.frameid and cls._version if not present, and registers the new frame in Tag's known_frames dictionary. To be used as a decorator on the class definition: @frameclass class UFID(Frame): _framespec = (Nu...
python
def frameclass(cls): """Register cls as a class representing an ID3 frame. Sets cls.frameid and cls._version if not present, and registers the new frame in Tag's known_frames dictionary. To be used as a decorator on the class definition: @frameclass class UFID(Frame): _framespec = (Nu...
[ "def", "frameclass", "(", "cls", ")", ":", "assert", "issubclass", "(", "cls", ",", "Frames", ".", "Frame", ")", "# Register v2.2 versions of v2.3/v2.4 frames if encoded by inheritance.", "if", "len", "(", "cls", ".", "__name__", ")", "==", "3", ":", "base", "="...
Register cls as a class representing an ID3 frame. Sets cls.frameid and cls._version if not present, and registers the new frame in Tag's known_frames dictionary. To be used as a decorator on the class definition: @frameclass class UFID(Frame): _framespec = (NullTerminatedStringSpec("owne...
[ "Register", "cls", "as", "a", "class", "representing", "an", "ID3", "frame", "." ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/tags.py#L119-L158
51,060
staggerpkg/stagger
stagger/tags.py
FrameOrder.key
def key(self, frame): "Return the sort key for the given frame." def keytuple(primary): if frame.frameno is None: return (primary, 1) return (primary, 0, frame.frameno) # Look up frame by exact match if type(frame) in self.frame_keys: ...
python
def key(self, frame): "Return the sort key for the given frame." def keytuple(primary): if frame.frameno is None: return (primary, 1) return (primary, 0, frame.frameno) # Look up frame by exact match if type(frame) in self.frame_keys: ...
[ "def", "key", "(", "self", ",", "frame", ")", ":", "def", "keytuple", "(", "primary", ")", ":", "if", "frame", ".", "frameno", "is", "None", ":", "return", "(", "primary", ",", "1", ")", "return", "(", "primary", ",", "0", ",", "frame", ".", "fra...
Return the sort key for the given frame.
[ "Return", "the", "sort", "key", "for", "the", "given", "frame", "." ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/tags.py#L191-L211
51,061
staggerpkg/stagger
stagger/tags.py
Tag.frames
def frames(self, key=None, orig_order=False): """Returns a list of frames in this tag. If KEY is None, returns all frames in the tag; otherwise returns all frames whose frameid matches KEY. If ORIG_ORDER is True, then the frames are returned in their original order. Othe...
python
def frames(self, key=None, orig_order=False): """Returns a list of frames in this tag. If KEY is None, returns all frames in the tag; otherwise returns all frames whose frameid matches KEY. If ORIG_ORDER is True, then the frames are returned in their original order. Othe...
[ "def", "frames", "(", "self", ",", "key", "=", "None", ",", "orig_order", "=", "False", ")", ":", "if", "key", "is", "not", "None", ":", "# If there are multiple frames, then they are already in original order.", "key", "=", "self", ".", "_normalize_key", "(", "...
Returns a list of frames in this tag. If KEY is None, returns all frames in the tag; otherwise returns all frames whose frameid matches KEY. If ORIG_ORDER is True, then the frames are returned in their original order. Otherwise the frames are sorted in canonical order according ...
[ "Returns", "a", "list", "of", "frames", "in", "this", "tag", ".", "If", "KEY", "is", "None", "returns", "all", "frames", "in", "the", "tag", ";", "otherwise", "returns", "all", "frames", "whose", "frameid", "matches", "KEY", ".", "If", "ORIG_ORDER", "is"...
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/tags.py#L233-L261
51,062
staggerpkg/stagger
stagger/tags.py
Tag.read
def read(cls, filename, offset=0): """Read an ID3v2 tag from a file.""" i = 0 with fileutil.opened(filename, "rb") as file: file.seek(offset) tag = cls() tag._read_header(file) for (frameid, bflags, data) in tag._read_frames(file): ...
python
def read(cls, filename, offset=0): """Read an ID3v2 tag from a file.""" i = 0 with fileutil.opened(filename, "rb") as file: file.seek(offset) tag = cls() tag._read_header(file) for (frameid, bflags, data) in tag._read_frames(file): ...
[ "def", "read", "(", "cls", ",", "filename", ",", "offset", "=", "0", ")", ":", "i", "=", "0", "with", "fileutil", ".", "opened", "(", "filename", ",", "\"rb\"", ")", "as", "file", ":", "file", ".", "seek", "(", "offset", ")", "tag", "=", "cls", ...
Read an ID3v2 tag from a file.
[ "Read", "an", "ID3v2", "tag", "from", "a", "file", "." ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/tags.py#L575-L598
51,063
yyuu/botornado
boto/gs/key.py
Key.add_email_grant
def add_email_grant(self, permission, email_address): """ Convenience method that provides a quick way to add an email grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new A...
python
def add_email_grant(self, permission, email_address): """ Convenience method that provides a quick way to add an email grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new A...
[ "def", "add_email_grant", "(", "self", ",", "permission", ",", "email_address", ")", ":", "acl", "=", "self", ".", "get_acl", "(", ")", "acl", ".", "add_email_grant", "(", "permission", ",", "email_address", ")", "self", ".", "set_acl", "(", "acl", ")" ]
Convenience method that provides a quick way to add an email grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ACL back to GS. :type permission: string :param permission...
[ "Convenience", "method", "that", "provides", "a", "quick", "way", "to", "add", "an", "email", "grant", "to", "a", "key", ".", "This", "method", "retrieves", "the", "current", "ACL", "creates", "a", "new", "grant", "based", "on", "the", "parameters", "passe...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/key.py#L28-L47
51,064
yyuu/botornado
boto/gs/key.py
Key.add_user_grant
def add_user_grant(self, permission, user_id): """ Convenience method that provides a quick way to add a canonical user grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ...
python
def add_user_grant(self, permission, user_id): """ Convenience method that provides a quick way to add a canonical user grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ...
[ "def", "add_user_grant", "(", "self", ",", "permission", ",", "user_id", ")", ":", "acl", "=", "self", ".", "get_acl", "(", ")", "acl", ".", "add_user_grant", "(", "permission", ",", "user_id", ")", "self", ".", "set_acl", "(", "acl", ")" ]
Convenience method that provides a quick way to add a canonical user grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ACL back to GS. :type permission: string :param pe...
[ "Convenience", "method", "that", "provides", "a", "quick", "way", "to", "add", "a", "canonical", "user", "grant", "to", "a", "key", ".", "This", "method", "retrieves", "the", "current", "ACL", "creates", "a", "new", "grant", "based", "on", "the", "paramete...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/key.py#L49-L68
51,065
yyuu/botornado
boto/gs/key.py
Key.add_group_email_grant
def add_group_email_grant(self, permission, email_address, headers=None): """ Convenience method that provides a quick way to add an email group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and ...
python
def add_group_email_grant(self, permission, email_address, headers=None): """ Convenience method that provides a quick way to add an email group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and ...
[ "def", "add_group_email_grant", "(", "self", ",", "permission", ",", "email_address", ",", "headers", "=", "None", ")", ":", "acl", "=", "self", ".", "get_acl", "(", "headers", "=", "headers", ")", "acl", ".", "add_group_email_grant", "(", "permission", ",",...
Convenience method that provides a quick way to add an email group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ACL back to GS. :type permission: string :param perm...
[ "Convenience", "method", "that", "provides", "a", "quick", "way", "to", "add", "an", "email", "group", "grant", "to", "a", "key", ".", "This", "method", "retrieves", "the", "current", "ACL", "creates", "a", "new", "grant", "based", "on", "the", "parameters...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/key.py#L70-L89
51,066
yyuu/botornado
boto/gs/key.py
Key.add_group_grant
def add_group_grant(self, permission, group_id): """ Convenience method that provides a quick way to add a canonical group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the n...
python
def add_group_grant(self, permission, group_id): """ Convenience method that provides a quick way to add a canonical group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the n...
[ "def", "add_group_grant", "(", "self", ",", "permission", ",", "group_id", ")", ":", "acl", "=", "self", ".", "get_acl", "(", ")", "acl", ".", "add_group_grant", "(", "permission", ",", "group_id", ")", "self", ".", "set_acl", "(", "acl", ")" ]
Convenience method that provides a quick way to add a canonical group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT's the new ACL back to GS. :type permission: string :param p...
[ "Convenience", "method", "that", "provides", "a", "quick", "way", "to", "add", "a", "canonical", "group", "grant", "to", "a", "key", ".", "This", "method", "retrieves", "the", "current", "ACL", "creates", "a", "new", "grant", "based", "on", "the", "paramet...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/key.py#L91-L110
51,067
yyuu/botornado
boto/gs/key.py
Key.set_contents_from_file
def set_contents_from_file(self, fp, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None, res_upload_handler=None, size=None): """ Store an object in GS using the name of the Key object as the key in GS and the conte...
python
def set_contents_from_file(self, fp, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None, res_upload_handler=None, size=None): """ Store an object in GS using the name of the Key object as the key in GS and the conte...
[ "def", "set_contents_from_file", "(", "self", ",", "fp", ",", "headers", "=", "None", ",", "replace", "=", "True", ",", "cb", "=", "None", ",", "num_cb", "=", "10", ",", "policy", "=", "None", ",", "md5", "=", "None", ",", "res_upload_handler", "=", ...
Store an object in GS using the name of the Key object as the key in GS and the contents of the file pointed to by 'fp' as the contents. :type fp: file :param fp: the file whose contents are to be uploaded :type headers: dict :param headers: additional HTTP headers to b...
[ "Store", "an", "object", "in", "GS", "using", "the", "name", "of", "the", "Key", "object", "as", "the", "key", "in", "GS", "and", "the", "contents", "of", "the", "file", "pointed", "to", "by", "fp", "as", "the", "contents", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/key.py#L112-L221
51,068
yyuu/botornado
boto/gs/key.py
Key.set_contents_from_string
def set_contents_from_string(self, s, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None): """ Store an object in S3 using the name of the Key object as the key in S3 and the string 's' as the contents. See set_contents_from_file method...
python
def set_contents_from_string(self, s, headers=None, replace=True, cb=None, num_cb=10, policy=None, md5=None): """ Store an object in S3 using the name of the Key object as the key in S3 and the string 's' as the contents. See set_contents_from_file method...
[ "def", "set_contents_from_string", "(", "self", ",", "s", ",", "headers", "=", "None", ",", "replace", "=", "True", ",", "cb", "=", "None", ",", "num_cb", "=", "10", ",", "policy", "=", "None", ",", "md5", "=", "None", ")", ":", "if", "isinstance", ...
Store an object in S3 using the name of the Key object as the key in S3 and the string 's' as the contents. See set_contents_from_file method for details about the parameters. :type headers: dict :param headers: Additional headers to pass along with the r...
[ "Store", "an", "object", "in", "S3", "using", "the", "name", "of", "the", "Key", "object", "as", "the", "key", "in", "S3", "and", "the", "string", "s", "as", "the", "contents", ".", "See", "set_contents_from_file", "method", "for", "details", "about", "t...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/key.py#L278-L329
51,069
yyuu/botornado
boto/emr/connection.py
EmrConnection.describe_jobflow
def describe_jobflow(self, jobflow_id): """ Describes a single Elastic MapReduce job flow :type jobflow_id: str :param jobflow_id: The job flow id of interest """ jobflows = self.describe_jobflows(jobflow_ids=[jobflow_id]) if jobflows: return jobflows...
python
def describe_jobflow(self, jobflow_id): """ Describes a single Elastic MapReduce job flow :type jobflow_id: str :param jobflow_id: The job flow id of interest """ jobflows = self.describe_jobflows(jobflow_ids=[jobflow_id]) if jobflows: return jobflows...
[ "def", "describe_jobflow", "(", "self", ",", "jobflow_id", ")", ":", "jobflows", "=", "self", ".", "describe_jobflows", "(", "jobflow_ids", "=", "[", "jobflow_id", "]", ")", "if", "jobflows", ":", "return", "jobflows", "[", "0", "]" ]
Describes a single Elastic MapReduce job flow :type jobflow_id: str :param jobflow_id: The job flow id of interest
[ "Describes", "a", "single", "Elastic", "MapReduce", "job", "flow" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L67-L76
51,070
yyuu/botornado
boto/emr/connection.py
EmrConnection.describe_jobflows
def describe_jobflows(self, states=None, jobflow_ids=None, created_after=None, created_before=None): """ Retrieve all the Elastic MapReduce job flows on your account :type states: list :param states: A list of strings with job flow states wanted :type...
python
def describe_jobflows(self, states=None, jobflow_ids=None, created_after=None, created_before=None): """ Retrieve all the Elastic MapReduce job flows on your account :type states: list :param states: A list of strings with job flow states wanted :type...
[ "def", "describe_jobflows", "(", "self", ",", "states", "=", "None", ",", "jobflow_ids", "=", "None", ",", "created_after", "=", "None", ",", "created_before", "=", "None", ")", ":", "params", "=", "{", "}", "if", "states", ":", "self", ".", "build_list_...
Retrieve all the Elastic MapReduce job flows on your account :type states: list :param states: A list of strings with job flow states wanted :type jobflow_ids: list :param jobflow_ids: A list of job flow IDs :type created_after: datetime :param created_after: Bound on j...
[ "Retrieve", "all", "the", "Elastic", "MapReduce", "job", "flows", "on", "your", "account" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L78-L107
51,071
yyuu/botornado
boto/emr/connection.py
EmrConnection.terminate_jobflows
def terminate_jobflows(self, jobflow_ids): """ Terminate an Elastic MapReduce job flow :type jobflow_ids: list :param jobflow_ids: A list of job flow IDs """ params = {} self.build_list_params(params, jobflow_ids, 'JobFlowIds.member') return self.get_stat...
python
def terminate_jobflows(self, jobflow_ids): """ Terminate an Elastic MapReduce job flow :type jobflow_ids: list :param jobflow_ids: A list of job flow IDs """ params = {} self.build_list_params(params, jobflow_ids, 'JobFlowIds.member') return self.get_stat...
[ "def", "terminate_jobflows", "(", "self", ",", "jobflow_ids", ")", ":", "params", "=", "{", "}", "self", ".", "build_list_params", "(", "params", ",", "jobflow_ids", ",", "'JobFlowIds.member'", ")", "return", "self", ".", "get_status", "(", "'TerminateJobFlows'"...
Terminate an Elastic MapReduce job flow :type jobflow_ids: list :param jobflow_ids: A list of job flow IDs
[ "Terminate", "an", "Elastic", "MapReduce", "job", "flow" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L118-L127
51,072
yyuu/botornado
boto/emr/connection.py
EmrConnection.add_jobflow_steps
def add_jobflow_steps(self, jobflow_id, steps): """ Adds steps to a jobflow :type jobflow_id: str :param jobflow_id: The job flow id :type steps: list(boto.emr.Step) :param steps: A list of steps to add to the job """ if type(steps) != types.ListType: ...
python
def add_jobflow_steps(self, jobflow_id, steps): """ Adds steps to a jobflow :type jobflow_id: str :param jobflow_id: The job flow id :type steps: list(boto.emr.Step) :param steps: A list of steps to add to the job """ if type(steps) != types.ListType: ...
[ "def", "add_jobflow_steps", "(", "self", ",", "jobflow_id", ",", "steps", ")", ":", "if", "type", "(", "steps", ")", "!=", "types", ".", "ListType", ":", "steps", "=", "[", "steps", "]", "params", "=", "{", "}", "params", "[", "'JobFlowId'", "]", "="...
Adds steps to a jobflow :type jobflow_id: str :param jobflow_id: The job flow id :type steps: list(boto.emr.Step) :param steps: A list of steps to add to the job
[ "Adds", "steps", "to", "a", "jobflow" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L129-L148
51,073
yyuu/botornado
boto/emr/connection.py
EmrConnection.add_instance_groups
def add_instance_groups(self, jobflow_id, instance_groups): """ Adds instance groups to a running cluster. :type jobflow_id: str :param jobflow_id: The id of the jobflow which will take the new instance groups :type instance_groups: list(boto.emr.Instanc...
python
def add_instance_groups(self, jobflow_id, instance_groups): """ Adds instance groups to a running cluster. :type jobflow_id: str :param jobflow_id: The id of the jobflow which will take the new instance groups :type instance_groups: list(boto.emr.Instanc...
[ "def", "add_instance_groups", "(", "self", ",", "jobflow_id", ",", "instance_groups", ")", ":", "if", "type", "(", "instance_groups", ")", "!=", "types", ".", "ListType", ":", "instance_groups", "=", "[", "instance_groups", "]", "params", "=", "{", "}", "par...
Adds instance groups to a running cluster. :type jobflow_id: str :param jobflow_id: The id of the jobflow which will take the new instance groups :type instance_groups: list(boto.emr.InstanceGroup) :param instance_groups: A list of instance groups to add to the ...
[ "Adds", "instance", "groups", "to", "a", "running", "cluster", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L150-L168
51,074
yyuu/botornado
boto/emr/connection.py
EmrConnection.modify_instance_groups
def modify_instance_groups(self, instance_group_ids, new_sizes): """ Modify the number of nodes and configuration settings in an instance group. :type instance_group_ids: list(str) :param instance_group_ids: A list of the ID's of the instance groups to be modified ...
python
def modify_instance_groups(self, instance_group_ids, new_sizes): """ Modify the number of nodes and configuration settings in an instance group. :type instance_group_ids: list(str) :param instance_group_ids: A list of the ID's of the instance groups to be modified ...
[ "def", "modify_instance_groups", "(", "self", ",", "instance_group_ids", ",", "new_sizes", ")", ":", "if", "type", "(", "instance_group_ids", ")", "!=", "types", ".", "ListType", ":", "instance_group_ids", "=", "[", "instance_group_ids", "]", "if", "type", "(", ...
Modify the number of nodes and configuration settings in an instance group. :type instance_group_ids: list(str) :param instance_group_ids: A list of the ID's of the instance groups to be modified :type new_sizes: list(int) :param new_sizes: A list of the...
[ "Modify", "the", "number", "of", "nodes", "and", "configuration", "settings", "in", "an", "instance", "group", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L170-L198
51,075
yyuu/botornado
boto/emr/connection.py
EmrConnection.set_termination_protection
def set_termination_protection(self, jobflow_id, termination_protection_status): """ Set termination protection on specified Elastic MapReduce job flows :type jobflow_ids: list or str :param jobflow_ids: A list of job flow IDs :type te...
python
def set_termination_protection(self, jobflow_id, termination_protection_status): """ Set termination protection on specified Elastic MapReduce job flows :type jobflow_ids: list or str :param jobflow_ids: A list of job flow IDs :type te...
[ "def", "set_termination_protection", "(", "self", ",", "jobflow_id", ",", "termination_protection_status", ")", ":", "assert", "termination_protection_status", "in", "(", "True", ",", "False", ")", "params", "=", "{", "}", "params", "[", "'TerminationProtected'", "]...
Set termination protection on specified Elastic MapReduce job flows :type jobflow_ids: list or str :param jobflow_ids: A list of job flow IDs :type termination_protection_status: bool :param termination_protection_status: Termination protection status
[ "Set", "termination", "protection", "on", "specified", "Elastic", "MapReduce", "job", "flows" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L356-L373
51,076
yyuu/botornado
boto/emr/connection.py
EmrConnection._build_instance_group_args
def _build_instance_group_args(self, instance_group): """ Takes an InstanceGroup; returns a dict that, when its keys are properly prefixed, can be used for describing InstanceGroups in RunJobFlow or AddInstanceGroups requests. """ params = { 'InstanceCount' : ...
python
def _build_instance_group_args(self, instance_group): """ Takes an InstanceGroup; returns a dict that, when its keys are properly prefixed, can be used for describing InstanceGroups in RunJobFlow or AddInstanceGroups requests. """ params = { 'InstanceCount' : ...
[ "def", "_build_instance_group_args", "(", "self", ",", "instance_group", ")", ":", "params", "=", "{", "'InstanceCount'", ":", "instance_group", ".", "num_instances", ",", "'InstanceRole'", ":", "instance_group", ".", "role", ",", "'InstanceType'", ":", "instance_gr...
Takes an InstanceGroup; returns a dict that, when its keys are properly prefixed, can be used for describing InstanceGroups in RunJobFlow or AddInstanceGroups requests.
[ "Takes", "an", "InstanceGroup", ";", "returns", "a", "dict", "that", "when", "its", "keys", "are", "properly", "prefixed", "can", "be", "used", "for", "describing", "InstanceGroups", "in", "RunJobFlow", "or", "AddInstanceGroups", "requests", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L461-L476
51,077
yyuu/botornado
boto/emr/connection.py
EmrConnection._build_instance_group_list_args
def _build_instance_group_list_args(self, instance_groups): """ Takes a list of InstanceGroups, or a single InstanceGroup. Returns a comparable dict for use in making a RunJobFlow or AddInstanceGroups request. """ if type(instance_groups) != types.ListType: in...
python
def _build_instance_group_list_args(self, instance_groups): """ Takes a list of InstanceGroups, or a single InstanceGroup. Returns a comparable dict for use in making a RunJobFlow or AddInstanceGroups request. """ if type(instance_groups) != types.ListType: in...
[ "def", "_build_instance_group_list_args", "(", "self", ",", "instance_groups", ")", ":", "if", "type", "(", "instance_groups", ")", "!=", "types", ".", "ListType", ":", "instance_groups", "=", "[", "instance_groups", "]", "params", "=", "{", "}", "for", "i", ...
Takes a list of InstanceGroups, or a single InstanceGroup. Returns a comparable dict for use in making a RunJobFlow or AddInstanceGroups request.
[ "Takes", "a", "list", "of", "InstanceGroups", "or", "a", "single", "InstanceGroup", ".", "Returns", "a", "comparable", "dict", "for", "use", "in", "making", "a", "RunJobFlow", "or", "AddInstanceGroups", "request", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/emr/connection.py#L478-L492
51,078
yyuu/botornado
boto/route53/connection.py
Route53Connection.get_all_hosted_zones
def get_all_hosted_zones(self, start_marker=None, zone_list=None): """ Returns a Python data structure with information about all Hosted Zones defined for the AWS account. :param int start_marker: start marker to pass when fetching additional results after a truncated list ...
python
def get_all_hosted_zones(self, start_marker=None, zone_list=None): """ Returns a Python data structure with information about all Hosted Zones defined for the AWS account. :param int start_marker: start marker to pass when fetching additional results after a truncated list ...
[ "def", "get_all_hosted_zones", "(", "self", ",", "start_marker", "=", "None", ",", "zone_list", "=", "None", ")", ":", "params", "=", "{", "}", "if", "start_marker", ":", "params", "=", "{", "'marker'", ":", "start_marker", "}", "response", "=", "self", ...
Returns a Python data structure with information about all Hosted Zones defined for the AWS account. :param int start_marker: start marker to pass when fetching additional results after a truncated list :param list zone_list: a HostedZones list to prepend to results
[ "Returns", "a", "Python", "data", "structure", "with", "information", "about", "all", "Hosted", "Zones", "defined", "for", "the", "AWS", "account", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/connection.py#L78-L108
51,079
yyuu/botornado
boto/route53/connection.py
Route53Connection.get_change
def get_change(self, change_id): """ Get information about a proposed set of changes, as submitted by the change_rrsets method. Returns a Python data structure with status information about the changes. :type change_id: str :param change_id: The unique identifier...
python
def get_change(self, change_id): """ Get information about a proposed set of changes, as submitted by the change_rrsets method. Returns a Python data structure with status information about the changes. :type change_id: str :param change_id: The unique identifier...
[ "def", "get_change", "(", "self", ",", "change_id", ")", ":", "uri", "=", "'/%s/change/%s'", "%", "(", "self", ".", "Version", ",", "change_id", ")", "response", "=", "self", ".", "make_request", "(", "'GET'", ",", "uri", ")", "body", "=", "response", ...
Get information about a proposed set of changes, as submitted by the change_rrsets method. Returns a Python data structure with status information about the changes. :type change_id: str :param change_id: The unique identifier for the set of changes. This ID is retur...
[ "Get", "information", "about", "a", "proposed", "set", "of", "changes", "as", "submitted", "by", "the", "change_rrsets", "method", ".", "Returns", "a", "Python", "data", "structure", "with", "status", "information", "about", "the", "changes", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/connection.py#L297-L320
51,080
getsentry/symsynd
symsynd/heuristics.py
find_best_instruction
def find_best_instruction(addr, cpu_name, meta=None): """Given an instruction and meta information this attempts to find the best instruction for the frame. In some circumstances we can fix it up a bit to improve the accuracy. For more information see `symbolize_frame`. """ addr = rv = parse_a...
python
def find_best_instruction(addr, cpu_name, meta=None): """Given an instruction and meta information this attempts to find the best instruction for the frame. In some circumstances we can fix it up a bit to improve the accuracy. For more information see `symbolize_frame`. """ addr = rv = parse_a...
[ "def", "find_best_instruction", "(", "addr", ",", "cpu_name", ",", "meta", "=", "None", ")", ":", "addr", "=", "rv", "=", "parse_addr", "(", "addr", ")", "# In case we're not on the crashing frame we apply a simple heuristic:", "# since we're most likely dealing with return...
Given an instruction and meta information this attempts to find the best instruction for the frame. In some circumstances we can fix it up a bit to improve the accuracy. For more information see `symbolize_frame`.
[ "Given", "an", "instruction", "and", "meta", "information", "this", "attempts", "to", "find", "the", "best", "instruction", "for", "the", "frame", ".", "In", "some", "circumstances", "we", "can", "fix", "it", "up", "a", "bit", "to", "improve", "the", "accu...
13825f10bfb9291fe7bcd13937ddf398e7104234
https://github.com/getsentry/symsynd/blob/13825f10bfb9291fe7bcd13937ddf398e7104234/symsynd/heuristics.py#L46-L75
51,081
yyuu/botornado
boto/s3/bucket.py
Bucket.list
def list(self, prefix='', delimiter='', marker='', headers=None): """ List key objects within a bucket. This returns an instance of an BucketListResultSet that automatically handles all of the result paging, etc. from S3. You just need to keep iterating until there are no more ...
python
def list(self, prefix='', delimiter='', marker='', headers=None): """ List key objects within a bucket. This returns an instance of an BucketListResultSet that automatically handles all of the result paging, etc. from S3. You just need to keep iterating until there are no more ...
[ "def", "list", "(", "self", ",", "prefix", "=", "''", ",", "delimiter", "=", "''", ",", "marker", "=", "''", ",", "headers", "=", "None", ")", ":", "return", "BucketListResultSet", "(", "self", ",", "prefix", ",", "delimiter", ",", "marker", ",", "he...
List key objects within a bucket. This returns an instance of an BucketListResultSet that automatically handles all of the result paging, etc. from S3. You just need to keep iterating until there are no more results. Called with no arguments, this will return an iterator objec...
[ "List", "key", "objects", "within", "a", "bucket", ".", "This", "returns", "an", "instance", "of", "an", "BucketListResultSet", "that", "automatically", "handles", "all", "of", "the", "result", "paging", "etc", ".", "from", "S3", ".", "You", "just", "need", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L208-L245
51,082
yyuu/botornado
boto/s3/bucket.py
Bucket.copy_key
def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata=None, src_version_id=None, storage_class='STANDARD', preserve_acl=False, encrypt_key=False, headers=None, query_args=None): """ Create a new key in the bucket by copying another ex...
python
def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata=None, src_version_id=None, storage_class='STANDARD', preserve_acl=False, encrypt_key=False, headers=None, query_args=None): """ Create a new key in the bucket by copying another ex...
[ "def", "copy_key", "(", "self", ",", "new_key_name", ",", "src_bucket_name", ",", "src_key_name", ",", "metadata", "=", "None", ",", "src_version_id", "=", "None", ",", "storage_class", "=", "'STANDARD'", ",", "preserve_acl", "=", "False", ",", "encrypt_key", ...
Create a new key in the bucket by copying another existing key. :type new_key_name: string :param new_key_name: The name of the new key :type src_bucket_name: string :param src_bucket_name: The name of the source bucket :type src_key_name: string :param src_key_name: T...
[ "Create", "a", "new", "key", "in", "the", "bucket", "by", "copying", "another", "existing", "key", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L596-L699
51,083
yyuu/botornado
boto/s3/bucket.py
Bucket.set_subresource
def set_subresource(self, subresource, value, key_name = '', headers=None, version_id=None): """ Set a subresource for a bucket or key. :type subresource: string :param subresource: The subresource to set. :type value: string :param value: The va...
python
def set_subresource(self, subresource, value, key_name = '', headers=None, version_id=None): """ Set a subresource for a bucket or key. :type subresource: string :param subresource: The subresource to set. :type value: string :param value: The va...
[ "def", "set_subresource", "(", "self", ",", "subresource", ",", "value", ",", "key_name", "=", "''", ",", "headers", "=", "None", ",", "version_id", "=", "None", ")", ":", "if", "not", "subresource", ":", "raise", "TypeError", "(", "'set_subresource called w...
Set a subresource for a bucket or key. :type subresource: string :param subresource: The subresource to set. :type value: string :param value: The value of the subresource. :type key_name: string :param key_name: The key to operate on, or None to operate on the ...
[ "Set", "a", "subresource", "for", "a", "bucket", "or", "key", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L771-L806
51,084
yyuu/botornado
boto/s3/bucket.py
Bucket.get_subresource
def get_subresource(self, subresource, key_name='', headers=None, version_id=None): """ Get a subresource for a bucket or key. :type subresource: string :param subresource: The subresource to get. :type key_name: string :param key_name: The key t...
python
def get_subresource(self, subresource, key_name='', headers=None, version_id=None): """ Get a subresource for a bucket or key. :type subresource: string :param subresource: The subresource to get. :type key_name: string :param key_name: The key t...
[ "def", "get_subresource", "(", "self", ",", "subresource", ",", "key_name", "=", "''", ",", "headers", "=", "None", ",", "version_id", "=", "None", ")", ":", "if", "not", "subresource", ":", "raise", "TypeError", "(", "'get_subresource called with subresource=No...
Get a subresource for a bucket or key. :type subresource: string :param subresource: The subresource to get. :type key_name: string :param key_name: The key to operate on, or None to operate on the bucket. :type headers: dict :param headers: Ad...
[ "Get", "a", "subresource", "for", "a", "bucket", "or", "key", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L808-L843
51,085
yyuu/botornado
boto/s3/bucket.py
Bucket.get_location
def get_location(self): """ Returns the LocationConstraint for the bucket. :rtype: str :return: The LocationConstraint for the bucket or the empty string if no constraint was specified when bucket was created. """ response = self.connect...
python
def get_location(self): """ Returns the LocationConstraint for the bucket. :rtype: str :return: The LocationConstraint for the bucket or the empty string if no constraint was specified when bucket was created. """ response = self.connect...
[ "def", "get_location", "(", "self", ")", ":", "response", "=", "self", ".", "connection", ".", "make_request", "(", "'GET'", ",", "self", ".", "name", ",", "query_args", "=", "'location'", ")", "body", "=", "response", ".", "read", "(", ")", "if", "res...
Returns the LocationConstraint for the bucket. :rtype: str :return: The LocationConstraint for the bucket or the empty string if no constraint was specified when bucket was created.
[ "Returns", "the", "LocationConstraint", "for", "the", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L931-L950
51,086
yyuu/botornado
boto/s3/bucket.py
Bucket.get_versioning_status
def get_versioning_status(self, headers=None): """ Returns the current status of versioning on the bucket. :rtype: dict :returns: A dictionary containing a key named 'Versioning' that can have a value of either Enabled, Disabled, or Suspended. Also, i...
python
def get_versioning_status(self, headers=None): """ Returns the current status of versioning on the bucket. :rtype: dict :returns: A dictionary containing a key named 'Versioning' that can have a value of either Enabled, Disabled, or Suspended. Also, i...
[ "def", "get_versioning_status", "(", "self", ",", "headers", "=", "None", ")", ":", "response", "=", "self", ".", "connection", ".", "make_request", "(", "'GET'", ",", "self", ".", "name", ",", "query_args", "=", "'versioning'", ",", "headers", "=", "heade...
Returns the current status of versioning on the bucket. :rtype: dict :returns: A dictionary containing a key named 'Versioning' that can have a value of either Enabled, Disabled, or Suspended. Also, if MFADelete has ever been enabled on the bucket, ...
[ "Returns", "the", "current", "status", "of", "versioning", "on", "the", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1065-L1092
51,087
yyuu/botornado
boto/s3/bucket.py
Bucket.get_lifecycle_config
def get_lifecycle_config(self, headers=None): """ Returns the current lifecycle configuration on the bucket. :rtype: :class:`boto.s3.lifecycle.Lifecycle` :returns: A LifecycleConfig object that describes all current lifecycle rules in effect for the bucket. """ ...
python
def get_lifecycle_config(self, headers=None): """ Returns the current lifecycle configuration on the bucket. :rtype: :class:`boto.s3.lifecycle.Lifecycle` :returns: A LifecycleConfig object that describes all current lifecycle rules in effect for the bucket. """ ...
[ "def", "get_lifecycle_config", "(", "self", ",", "headers", "=", "None", ")", ":", "response", "=", "self", ".", "connection", ".", "make_request", "(", "'GET'", ",", "self", ".", "name", ",", "query_args", "=", "'lifecycle'", ",", "headers", "=", "headers...
Returns the current lifecycle configuration on the bucket. :rtype: :class:`boto.s3.lifecycle.Lifecycle` :returns: A LifecycleConfig object that describes all current lifecycle rules in effect for the bucket.
[ "Returns", "the", "current", "lifecycle", "configuration", "on", "the", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1119-L1138
51,088
yyuu/botornado
boto/s3/bucket.py
Bucket.configure_website
def configure_website(self, suffix, error_key='', headers=None): """ Configure this bucket to act as a website :type suffix: str :param suffix: Suffix that is appended to a request that is for a "directory" on the website endpoint (e.g. if the suffix ...
python
def configure_website(self, suffix, error_key='', headers=None): """ Configure this bucket to act as a website :type suffix: str :param suffix: Suffix that is appended to a request that is for a "directory" on the website endpoint (e.g. if the suffix ...
[ "def", "configure_website", "(", "self", ",", "suffix", ",", "error_key", "=", "''", ",", "headers", "=", "None", ")", ":", "if", "error_key", ":", "error_frag", "=", "self", ".", "WebsiteErrorFragment", "%", "error_key", "else", ":", "error_frag", "=", "'...
Configure this bucket to act as a website :type suffix: str :param suffix: Suffix that is appended to a request that is for a "directory" on the website endpoint (e.g. if the suffix is index.html and you make a request to samplebucket...
[ "Configure", "this", "bucket", "to", "act", "as", "a", "website" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1155-L1186
51,089
yyuu/botornado
boto/s3/bucket.py
Bucket.get_website_configuration
def get_website_configuration(self, headers=None): """ Returns the current status of website configuration on the bucket. :rtype: dict :returns: A dictionary containing a Python representation of the XML response from S3. The overall structure is: * WebsiteCon...
python
def get_website_configuration(self, headers=None): """ Returns the current status of website configuration on the bucket. :rtype: dict :returns: A dictionary containing a Python representation of the XML response from S3. The overall structure is: * WebsiteCon...
[ "def", "get_website_configuration", "(", "self", ",", "headers", "=", "None", ")", ":", "response", "=", "self", ".", "connection", ".", "make_request", "(", "'GET'", ",", "self", ".", "name", ",", "query_args", "=", "'website'", ",", "headers", "=", "head...
Returns the current status of website configuration on the bucket. :rtype: dict :returns: A dictionary containing a Python representation of the XML response from S3. The overall structure is: * WebsiteConfiguration * IndexDocument * Suffix : suffix th...
[ "Returns", "the", "current", "status", "of", "website", "configuration", "on", "the", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1188-L1217
51,090
yyuu/botornado
boto/s3/bucket.py
Bucket.delete_website_configuration
def delete_website_configuration(self, headers=None): """ Removes all website configuration from the bucket. """ response = self.connection.make_request('DELETE', self.name, query_args='website', headers=headers) body = response.read() boto.log.debug(body)...
python
def delete_website_configuration(self, headers=None): """ Removes all website configuration from the bucket. """ response = self.connection.make_request('DELETE', self.name, query_args='website', headers=headers) body = response.read() boto.log.debug(body)...
[ "def", "delete_website_configuration", "(", "self", ",", "headers", "=", "None", ")", ":", "response", "=", "self", ".", "connection", ".", "make_request", "(", "'DELETE'", ",", "self", ".", "name", ",", "query_args", "=", "'website'", ",", "headers", "=", ...
Removes all website configuration from the bucket.
[ "Removes", "all", "website", "configuration", "from", "the", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1219-L1231
51,091
yyuu/botornado
boto/s3/bucket.py
Bucket.get_website_endpoint
def get_website_endpoint(self): """ Returns the fully qualified hostname to use is you want to access this bucket as a website. This doesn't validate whether the bucket has been correctly configured as a website or not. """ l = [self.name] l.append(S3WebsiteEndpo...
python
def get_website_endpoint(self): """ Returns the fully qualified hostname to use is you want to access this bucket as a website. This doesn't validate whether the bucket has been correctly configured as a website or not. """ l = [self.name] l.append(S3WebsiteEndpo...
[ "def", "get_website_endpoint", "(", "self", ")", ":", "l", "=", "[", "self", ".", "name", "]", "l", ".", "append", "(", "S3WebsiteEndpointTranslate", ".", "translate_region", "(", "self", ".", "get_location", "(", ")", ")", ")", "l", ".", "append", "(", ...
Returns the fully qualified hostname to use is you want to access this bucket as a website. This doesn't validate whether the bucket has been correctly configured as a website or not.
[ "Returns", "the", "fully", "qualified", "hostname", "to", "use", "is", "you", "want", "to", "access", "this", "bucket", "as", "a", "website", ".", "This", "doesn", "t", "validate", "whether", "the", "bucket", "has", "been", "correctly", "configured", "as", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1233-L1242
51,092
yyuu/botornado
boto/s3/bucket.py
Bucket.set_policy
def set_policy(self, policy, headers=None): """ Add or replace the JSON policy associated with the bucket. :type policy: str :param policy: The JSON policy as a string. """ response = self.connection.make_request('PUT', self.name, ...
python
def set_policy(self, policy, headers=None): """ Add or replace the JSON policy associated with the bucket. :type policy: str :param policy: The JSON policy as a string. """ response = self.connection.make_request('PUT', self.name, ...
[ "def", "set_policy", "(", "self", ",", "policy", ",", "headers", "=", "None", ")", ":", "response", "=", "self", ".", "connection", ".", "make_request", "(", "'PUT'", ",", "self", ".", "name", ",", "data", "=", "policy", ",", "query_args", "=", "'polic...
Add or replace the JSON policy associated with the bucket. :type policy: str :param policy: The JSON policy as a string.
[ "Add", "or", "replace", "the", "JSON", "policy", "associated", "with", "the", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1258-L1274
51,093
yyuu/botornado
boto/s3/bucket.py
Bucket.initiate_multipart_upload
def initiate_multipart_upload(self, key_name, headers=None, reduced_redundancy=False, metadata=None, encrypt_key=False): """ Start a multipart upload operation. :type key_name: string :param key_name: The name of the ke...
python
def initiate_multipart_upload(self, key_name, headers=None, reduced_redundancy=False, metadata=None, encrypt_key=False): """ Start a multipart upload operation. :type key_name: string :param key_name: The name of the ke...
[ "def", "initiate_multipart_upload", "(", "self", ",", "key_name", ",", "headers", "=", "None", ",", "reduced_redundancy", "=", "False", ",", "metadata", "=", "None", ",", "encrypt_key", "=", "False", ")", ":", "query_args", "=", "'uploads'", "provider", "=", ...
Start a multipart upload operation. :type key_name: string :param key_name: The name of the key that will ultimately result from this multipart upload operation. This will be exactly as the key appears in the bucket after the upload ...
[ "Start", "a", "multipart", "upload", "operation", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1289-L1352
51,094
yyuu/botornado
boto/s3/bucket.py
Bucket.complete_multipart_upload
def complete_multipart_upload(self, key_name, upload_id, xml_body, headers=None): """ Complete a multipart upload operation. """ query_args = 'uploadId=%s' % upload_id if headers is None: headers = {} headers['Content-Type'] =...
python
def complete_multipart_upload(self, key_name, upload_id, xml_body, headers=None): """ Complete a multipart upload operation. """ query_args = 'uploadId=%s' % upload_id if headers is None: headers = {} headers['Content-Type'] =...
[ "def", "complete_multipart_upload", "(", "self", ",", "key_name", ",", "upload_id", ",", "xml_body", ",", "headers", "=", "None", ")", ":", "query_args", "=", "'uploadId=%s'", "%", "upload_id", "if", "headers", "is", "None", ":", "headers", "=", "{", "}", ...
Complete a multipart upload operation.
[ "Complete", "a", "multipart", "upload", "operation", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/bucket.py#L1354-L1381
51,095
yyuu/botornado
botornado/connection.py
AsyncConnection.get_http_connection
def get_http_connection(self, host, is_secure): """ Gets a connection from the pool for the named host. Returns None if there is no connection that can be reused. """ if is_secure: return AsyncHTTPSConnection(host, http_client=self._httpclient) else: ...
python
def get_http_connection(self, host, is_secure): """ Gets a connection from the pool for the named host. Returns None if there is no connection that can be reused. """ if is_secure: return AsyncHTTPSConnection(host, http_client=self._httpclient) else: ...
[ "def", "get_http_connection", "(", "self", ",", "host", ",", "is_secure", ")", ":", "if", "is_secure", ":", "return", "AsyncHTTPSConnection", "(", "host", ",", "http_client", "=", "self", ".", "_httpclient", ")", "else", ":", "return", "AsyncHTTPConnection", "...
Gets a connection from the pool for the named host. Returns None if there is no connection that can be reused.
[ "Gets", "a", "connection", "from", "the", "pool", "for", "the", "named", "host", ".", "Returns", "None", "if", "there", "is", "no", "connection", "that", "can", "be", "reused", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/botornado/connection.py#L193-L201
51,096
yyuu/botornado
boto/mturk/notification.py
NotificationMessage.verify
def verify(self, secret_key): """ Verifies the authenticity of a notification message. TODO: This is doing a form of authentication and this functionality should really be merged with the pluggable authentication mechanism at some point. """ ...
python
def verify(self, secret_key): """ Verifies the authenticity of a notification message. TODO: This is doing a form of authentication and this functionality should really be merged with the pluggable authentication mechanism at some point. """ ...
[ "def", "verify", "(", "self", ",", "secret_key", ")", ":", "verification_input", "=", "NotificationMessage", ".", "SERVICE_NAME", "verification_input", "+=", "NotificationMessage", ".", "OPERATION_NAME", "verification_input", "+=", "self", ".", "timestamp", "h", "=", ...
Verifies the authenticity of a notification message. TODO: This is doing a form of authentication and this functionality should really be merged with the pluggable authentication mechanism at some point.
[ "Verifies", "the", "authenticity", "of", "a", "notification", "message", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/mturk/notification.py#L74-L89
51,097
yyuu/botornado
boto/ec2/image.py
Image.update
def update(self, validate=False): """ Update the image's state information by making a call to fetch the current image attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the image the update method...
python
def update(self, validate=False): """ Update the image's state information by making a call to fetch the current image attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the image the update method...
[ "def", "update", "(", "self", ",", "validate", "=", "False", ")", ":", "rs", "=", "self", ".", "connection", ".", "get_all_images", "(", "[", "self", ".", "id", "]", ")", "if", "len", "(", "rs", ")", ">", "0", ":", "img", "=", "rs", "[", "0", ...
Update the image's state information by making a call to fetch the current image attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the image the update method returns quietly. If the val...
[ "Update", "the", "image", "s", "state", "information", "by", "making", "a", "call", "to", "fetch", "the", "current", "image", "attributes", "from", "the", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/image.py#L133-L152
51,098
yyuu/botornado
boto/s3/lifecycle.py
Lifecycle.to_xml
def to_xml(self): """ Returns a string containing the XML version of the Lifecycle configuration as defined by S3. """ s = '<LifecycleConfiguration>' for rule in self: s += rule.to_xml() s += '</LifecycleConfiguration>' return s
python
def to_xml(self): """ Returns a string containing the XML version of the Lifecycle configuration as defined by S3. """ s = '<LifecycleConfiguration>' for rule in self: s += rule.to_xml() s += '</LifecycleConfiguration>' return s
[ "def", "to_xml", "(", "self", ")", ":", "s", "=", "'<LifecycleConfiguration>'", "for", "rule", "in", "self", ":", "s", "+=", "rule", ".", "to_xml", "(", ")", "s", "+=", "'</LifecycleConfiguration>'", "return", "s" ]
Returns a string containing the XML version of the Lifecycle configuration as defined by S3.
[ "Returns", "a", "string", "containing", "the", "XML", "version", "of", "the", "Lifecycle", "configuration", "as", "defined", "by", "S3", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/lifecycle.py#L90-L99
51,099
carljm/django-adminfiles
adminfiles/views.py
download
def download(request): '''Saves image from URL and returns ID for use with AJAX script''' f = FileUpload() f.title = request.GET['title'] or 'untitled' f.description = request.GET['description'] url = urllib.unquote(request.GET['photo']) file_content = urllib.urlopen(url).read() file_name = ...
python
def download(request): '''Saves image from URL and returns ID for use with AJAX script''' f = FileUpload() f.title = request.GET['title'] or 'untitled' f.description = request.GET['description'] url = urllib.unquote(request.GET['photo']) file_content = urllib.urlopen(url).read() file_name = ...
[ "def", "download", "(", "request", ")", ":", "f", "=", "FileUpload", "(", ")", "f", ".", "title", "=", "request", ".", "GET", "[", "'title'", "]", "or", "'untitled'", "f", ".", "description", "=", "request", ".", "GET", "[", "'description'", "]", "ur...
Saves image from URL and returns ID for use with AJAX script
[ "Saves", "image", "from", "URL", "and", "returns", "ID", "for", "use", "with", "AJAX", "script" ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/views.py#L265-L275