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,200
yyuu/botornado
boto/rds/__init__.py
RDSConnection.get_all_dbinstances
def get_all_dbinstances(self, instance_id=None, max_records=None, marker=None): """ Retrieve all the DBInstances in your account. :type instance_id: str :param instance_id: DB Instance identifier. If supplied, only information thi...
python
def get_all_dbinstances(self, instance_id=None, max_records=None, marker=None): """ Retrieve all the DBInstances in your account. :type instance_id: str :param instance_id: DB Instance identifier. If supplied, only information thi...
[ "def", "get_all_dbinstances", "(", "self", ",", "instance_id", "=", "None", ",", "max_records", "=", "None", ",", "marker", "=", "None", ")", ":", "params", "=", "{", "}", "if", "instance_id", ":", "params", "[", "'DBInstanceIdentifier'", "]", "=", "instan...
Retrieve all the DBInstances in your account. :type instance_id: str :param instance_id: DB Instance identifier. If supplied, only information this instance will be returned. Otherwise, info about all DB Instances will ...
[ "Retrieve", "all", "the", "DBInstances", "in", "your", "account", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L103-L134
51,201
yyuu/botornado
boto/rds/__init__.py
RDSConnection.create_dbinstance
def create_dbinstance(self, id, allocated_storage, instance_class, master_username, master_password, port=3306, engine='MySQL5.1', db_name=None, param_group=None, security_groups=None, availability_zone=None, preferr...
python
def create_dbinstance(self, id, allocated_storage, instance_class, master_username, master_password, port=3306, engine='MySQL5.1', db_name=None, param_group=None, security_groups=None, availability_zone=None, preferr...
[ "def", "create_dbinstance", "(", "self", ",", "id", ",", "allocated_storage", ",", "instance_class", ",", "master_username", ",", "master_password", ",", "port", "=", "3306", ",", "engine", "=", "'MySQL5.1'", ",", "db_name", "=", "None", ",", "param_group", "=...
Create a new DBInstance. :type id: str :param id: Unique identifier for the new instance. Must contain 1-63 alphanumeric characters. First character must be a letter. May not end with a hyphen or contain two consecutive hyphens :type all...
[ "Create", "a", "new", "DBInstance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L136-L269
51,202
yyuu/botornado
boto/rds/__init__.py
RDSConnection.create_dbinstance_read_replica
def create_dbinstance_read_replica(self, id, source_id, instance_class=None, port=3306, availability_zone=None, auto_minor_version_upgrade=None): """ ...
python
def create_dbinstance_read_replica(self, id, source_id, instance_class=None, port=3306, availability_zone=None, auto_minor_version_upgrade=None): """ ...
[ "def", "create_dbinstance_read_replica", "(", "self", ",", "id", ",", "source_id", ",", "instance_class", "=", "None", ",", "port", "=", "3306", ",", "availability_zone", "=", "None", ",", "auto_minor_version_upgrade", "=", "None", ")", ":", "params", "=", "{"...
Create a new DBInstance Read Replica. :type id: str :param id: Unique identifier for the new instance. Must contain 1-63 alphanumeric characters. First character must be a letter. May not end with a hyphen or contain two consecutive hyphens ...
[ "Create", "a", "new", "DBInstance", "Read", "Replica", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L271-L338
51,203
yyuu/botornado
boto/rds/__init__.py
RDSConnection.modify_dbinstance
def modify_dbinstance(self, id, param_group=None, security_groups=None, preferred_maintenance_window=None, master_password=None, allocated_storage=None, instance_class=None, backup_retention_period=None, ...
python
def modify_dbinstance(self, id, param_group=None, security_groups=None, preferred_maintenance_window=None, master_password=None, allocated_storage=None, instance_class=None, backup_retention_period=None, ...
[ "def", "modify_dbinstance", "(", "self", ",", "id", ",", "param_group", "=", "None", ",", "security_groups", "=", "None", ",", "preferred_maintenance_window", "=", "None", ",", "master_password", "=", "None", ",", "allocated_storage", "=", "None", ",", "instance...
Modify an existing DBInstance. :type id: str :param id: Unique identifier for the new instance. :type security_groups: list of str or list of DBSecurityGroup objects :param security_groups: List of names of DBSecurityGroup to authorize on this DBInstance...
[ "Modify", "an", "existing", "DBInstance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L340-L438
51,204
yyuu/botornado
boto/rds/__init__.py
RDSConnection.delete_dbinstance
def delete_dbinstance(self, id, skip_final_snapshot=False, final_snapshot_id=''): """ Delete an existing DBInstance. :type id: str :param id: Unique identifier for the new instance. :type skip_final_snapshot: bool :param skip_final_snapshot: Th...
python
def delete_dbinstance(self, id, skip_final_snapshot=False, final_snapshot_id=''): """ Delete an existing DBInstance. :type id: str :param id: Unique identifier for the new instance. :type skip_final_snapshot: bool :param skip_final_snapshot: Th...
[ "def", "delete_dbinstance", "(", "self", ",", "id", ",", "skip_final_snapshot", "=", "False", ",", "final_snapshot_id", "=", "''", ")", ":", "params", "=", "{", "'DBInstanceIdentifier'", ":", "id", "}", "if", "skip_final_snapshot", ":", "params", "[", "'SkipFi...
Delete an existing DBInstance. :type id: str :param id: Unique identifier for the new instance. :type skip_final_snapshot: bool :param skip_final_snapshot: This parameter determines whether a final db snapshot is created before the instance ...
[ "Delete", "an", "existing", "DBInstance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L440-L468
51,205
yyuu/botornado
boto/rds/__init__.py
RDSConnection.get_all_dbparameter_groups
def get_all_dbparameter_groups(self, groupname=None, max_records=None, marker=None): """ Get all parameter groups associated with your account in a region. :type groupname: str :param groupname: The name of the DBParameter group to retrieve. ...
python
def get_all_dbparameter_groups(self, groupname=None, max_records=None, marker=None): """ Get all parameter groups associated with your account in a region. :type groupname: str :param groupname: The name of the DBParameter group to retrieve. ...
[ "def", "get_all_dbparameter_groups", "(", "self", ",", "groupname", "=", "None", ",", "max_records", "=", "None", ",", "marker", "=", "None", ")", ":", "params", "=", "{", "}", "if", "groupname", ":", "params", "[", "'DBParameterGroupName'", "]", "=", "gro...
Get all parameter groups associated with your account in a region. :type groupname: str :param groupname: The name of the DBParameter group to retrieve. If not provided, all DBParameter groups will be returned. :type max_records: int :param max_records: The ma...
[ "Get", "all", "parameter", "groups", "associated", "with", "your", "account", "in", "a", "region", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L486-L515
51,206
yyuu/botornado
boto/rds/__init__.py
RDSConnection.get_all_dbparameters
def get_all_dbparameters(self, groupname, source=None, max_records=None, marker=None): """ Get all parameters associated with a ParameterGroup :type groupname: str :param groupname: The name of the DBParameter group to retrieve. :type source: str ...
python
def get_all_dbparameters(self, groupname, source=None, max_records=None, marker=None): """ Get all parameters associated with a ParameterGroup :type groupname: str :param groupname: The name of the DBParameter group to retrieve. :type source: str ...
[ "def", "get_all_dbparameters", "(", "self", ",", "groupname", ",", "source", "=", "None", ",", "max_records", "=", "None", ",", "marker", "=", "None", ")", ":", "params", "=", "{", "'DBParameterGroupName'", ":", "groupname", "}", "if", "source", ":", "para...
Get all parameters associated with a ParameterGroup :type groupname: str :param groupname: The name of the DBParameter group to retrieve. :type source: str :param source: Specifies which parameters to return. If not specified, all parameters will be returned. ...
[ "Get", "all", "parameters", "associated", "with", "a", "ParameterGroup" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L517-L551
51,207
yyuu/botornado
boto/rds/__init__.py
RDSConnection.create_parameter_group
def create_parameter_group(self, name, engine='MySQL5.1', description=''): """ Create a new dbparameter group for your account. :type name: string :param name: The name of the new dbparameter group :type engine: str :param engine: Name of database engine. :type...
python
def create_parameter_group(self, name, engine='MySQL5.1', description=''): """ Create a new dbparameter group for your account. :type name: string :param name: The name of the new dbparameter group :type engine: str :param engine: Name of database engine. :type...
[ "def", "create_parameter_group", "(", "self", ",", "name", ",", "engine", "=", "'MySQL5.1'", ",", "description", "=", "''", ")", ":", "params", "=", "{", "'DBParameterGroupName'", ":", "name", ",", "'DBParameterGroupFamily'", ":", "engine", ",", "'Description'",...
Create a new dbparameter group for your account. :type name: string :param name: The name of the new dbparameter group :type engine: str :param engine: Name of database engine. :type description: string :param description: The description of the new security group ...
[ "Create", "a", "new", "dbparameter", "group", "for", "your", "account", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L553-L572
51,208
yyuu/botornado
boto/rds/__init__.py
RDSConnection.modify_parameter_group
def modify_parameter_group(self, name, parameters=None): """ Modify a parameter group for your account. :type name: string :param name: The name of the new parameter group :type parameters: list of :class:`boto.rds.parametergroup.Parameter` :param parameters: The new pa...
python
def modify_parameter_group(self, name, parameters=None): """ Modify a parameter group for your account. :type name: string :param name: The name of the new parameter group :type parameters: list of :class:`boto.rds.parametergroup.Parameter` :param parameters: The new pa...
[ "def", "modify_parameter_group", "(", "self", ",", "name", ",", "parameters", "=", "None", ")", ":", "params", "=", "{", "'DBParameterGroupName'", ":", "name", "}", "for", "i", "in", "range", "(", "0", ",", "len", "(", "parameters", ")", ")", ":", "par...
Modify a parameter group for your account. :type name: string :param name: The name of the new parameter group :type parameters: list of :class:`boto.rds.parametergroup.Parameter` :param parameters: The new parameters :rtype: :class:`boto.rds.parametergroup.ParameterGroup` ...
[ "Modify", "a", "parameter", "group", "for", "your", "account", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L574-L592
51,209
yyuu/botornado
boto/rds/__init__.py
RDSConnection.reset_parameter_group
def reset_parameter_group(self, name, reset_all_params=False, parameters=None): """ Resets some or all of the parameters of a ParameterGroup to the default value :type key_name: string :param key_name: The name of the ParameterGroup to reset ...
python
def reset_parameter_group(self, name, reset_all_params=False, parameters=None): """ Resets some or all of the parameters of a ParameterGroup to the default value :type key_name: string :param key_name: The name of the ParameterGroup to reset ...
[ "def", "reset_parameter_group", "(", "self", ",", "name", ",", "reset_all_params", "=", "False", ",", "parameters", "=", "None", ")", ":", "params", "=", "{", "'DBParameterGroupName'", ":", "name", "}", "if", "reset_all_params", ":", "params", "[", "'ResetAllP...
Resets some or all of the parameters of a ParameterGroup to the default value :type key_name: string :param key_name: The name of the ParameterGroup to reset :type parameters: list of :class:`boto.rds.parametergroup.Parameter` :param parameters: The parameters to reset. If not...
[ "Resets", "some", "or", "all", "of", "the", "parameters", "of", "a", "ParameterGroup", "to", "the", "default", "value" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L594-L615
51,210
yyuu/botornado
boto/rds/__init__.py
RDSConnection.authorize_dbsecurity_group
def authorize_dbsecurity_group(self, group_name, cidr_ip=None, ec2_security_group_name=None, ec2_security_group_owner_id=None): """ Add a new rule to an existing security group. You need to pass in either src_security_group_na...
python
def authorize_dbsecurity_group(self, group_name, cidr_ip=None, ec2_security_group_name=None, ec2_security_group_owner_id=None): """ Add a new rule to an existing security group. You need to pass in either src_security_group_na...
[ "def", "authorize_dbsecurity_group", "(", "self", ",", "group_name", ",", "cidr_ip", "=", "None", ",", "ec2_security_group_name", "=", "None", ",", "ec2_security_group_owner_id", "=", "None", ")", ":", "params", "=", "{", "'DBSecurityGroupName'", ":", "group_name", ...
Add a new rule to an existing security group. You need to pass in either src_security_group_name and src_security_group_owner_id OR a CIDR block but not both. :type group_name: string :param group_name: The name of the security group you are adding the rule to...
[ "Add", "a", "new", "rule", "to", "an", "existing", "security", "group", ".", "You", "need", "to", "pass", "in", "either", "src_security_group_name", "and", "src_security_group_owner_id", "OR", "a", "CIDR", "block", "but", "not", "both", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L695-L731
51,211
yyuu/botornado
boto/rds/__init__.py
RDSConnection.revoke_dbsecurity_group
def revoke_dbsecurity_group(self, group_name, ec2_security_group_name=None, ec2_security_group_owner_id=None, cidr_ip=None): """ Remove an existing rule from an existing security group. You need to pass in either ec2_security_group_name and ec2_security_gr...
python
def revoke_dbsecurity_group(self, group_name, ec2_security_group_name=None, ec2_security_group_owner_id=None, cidr_ip=None): """ Remove an existing rule from an existing security group. You need to pass in either ec2_security_group_name and ec2_security_gr...
[ "def", "revoke_dbsecurity_group", "(", "self", ",", "group_name", ",", "ec2_security_group_name", "=", "None", ",", "ec2_security_group_owner_id", "=", "None", ",", "cidr_ip", "=", "None", ")", ":", "params", "=", "{", "'DBSecurityGroupName'", ":", "group_name", "...
Remove an existing rule from an existing security group. You need to pass in either ec2_security_group_name and ec2_security_group_owner_id OR a CIDR block. :type group_name: string :param group_name: The name of the security group you are removing the rule fr...
[ "Remove", "an", "existing", "rule", "from", "an", "existing", "security", "group", ".", "You", "need", "to", "pass", "in", "either", "ec2_security_group_name", "and", "ec2_security_group_owner_id", "OR", "a", "CIDR", "block", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L733-L768
51,212
yyuu/botornado
boto/rds/__init__.py
RDSConnection.get_all_dbsnapshots
def get_all_dbsnapshots(self, snapshot_id=None, instance_id=None, max_records=None, marker=None): """ Get information about DB Snapshots. :type snapshot_id: str :param snapshot_id: The unique identifier of an RDS snapshot. If not p...
python
def get_all_dbsnapshots(self, snapshot_id=None, instance_id=None, max_records=None, marker=None): """ Get information about DB Snapshots. :type snapshot_id: str :param snapshot_id: The unique identifier of an RDS snapshot. If not p...
[ "def", "get_all_dbsnapshots", "(", "self", ",", "snapshot_id", "=", "None", ",", "instance_id", "=", "None", ",", "max_records", "=", "None", ",", "marker", "=", "None", ")", ":", "params", "=", "{", "}", "if", "snapshot_id", ":", "params", "[", "'DBSnap...
Get information about DB Snapshots. :type snapshot_id: str :param snapshot_id: The unique identifier of an RDS snapshot. If not provided, all RDS snapshots will be returned. :type instance_id: str :param instance_id: The identifier of a DBInstance. If provi...
[ "Get", "information", "about", "DB", "Snapshots", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L776-L813
51,213
yyuu/botornado
boto/rds/__init__.py
RDSConnection.create_dbsnapshot
def create_dbsnapshot(self, snapshot_id, dbinstance_id): """ Create a new DB snapshot. :type snapshot_id: string :param snapshot_id: The identifier for the DBSnapshot :type dbinstance_id: string :param dbinstance_id: The source identifier for the RDS instance from ...
python
def create_dbsnapshot(self, snapshot_id, dbinstance_id): """ Create a new DB snapshot. :type snapshot_id: string :param snapshot_id: The identifier for the DBSnapshot :type dbinstance_id: string :param dbinstance_id: The source identifier for the RDS instance from ...
[ "def", "create_dbsnapshot", "(", "self", ",", "snapshot_id", ",", "dbinstance_id", ")", ":", "params", "=", "{", "'DBSnapshotIdentifier'", ":", "snapshot_id", ",", "'DBInstanceIdentifier'", ":", "dbinstance_id", "}", "return", "self", ".", "get_object", "(", "'Cre...
Create a new DB snapshot. :type snapshot_id: string :param snapshot_id: The identifier for the DBSnapshot :type dbinstance_id: string :param dbinstance_id: The source identifier for the RDS instance from which the snapshot is created. :rtype: :cla...
[ "Create", "a", "new", "DB", "snapshot", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L815-L831
51,214
yyuu/botornado
boto/rds/__init__.py
RDSConnection.restore_dbinstance_from_dbsnapshot
def restore_dbinstance_from_dbsnapshot(self, identifier, instance_id, instance_class, port=None, availability_zone=None): """ Create a new DBInstance from a DB snapshot. :type identifier: string :para...
python
def restore_dbinstance_from_dbsnapshot(self, identifier, instance_id, instance_class, port=None, availability_zone=None): """ Create a new DBInstance from a DB snapshot. :type identifier: string :para...
[ "def", "restore_dbinstance_from_dbsnapshot", "(", "self", ",", "identifier", ",", "instance_id", ",", "instance_class", ",", "port", "=", "None", ",", "availability_zone", "=", "None", ")", ":", "params", "=", "{", "'DBSnapshotIdentifier'", ":", "identifier", ",",...
Create a new DBInstance from a DB snapshot. :type identifier: string :param identifier: The identifier for the DBSnapshot :type instance_id: string :param instance_id: The source identifier for the RDS instance from which the snapshot is created. ...
[ "Create", "a", "new", "DBInstance", "from", "a", "DB", "snapshot", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L843-L882
51,215
yyuu/botornado
boto/rds/__init__.py
RDSConnection.restore_dbinstance_from_point_in_time
def restore_dbinstance_from_point_in_time(self, source_instance_id, target_instance_id, use_latest=False, restore_time=None, dbinstance_...
python
def restore_dbinstance_from_point_in_time(self, source_instance_id, target_instance_id, use_latest=False, restore_time=None, dbinstance_...
[ "def", "restore_dbinstance_from_point_in_time", "(", "self", ",", "source_instance_id", ",", "target_instance_id", ",", "use_latest", "=", "False", ",", "restore_time", "=", "None", ",", "dbinstance_class", "=", "None", ",", "port", "=", "None", ",", "availability_z...
Create a new DBInstance from a point in time. :type source_instance_id: string :param source_instance_id: The identifier for the source DBInstance. :type target_instance_id: string :param target_instance_id: The identifier of the new DBInstance. :type use_latest: bool ...
[ "Create", "a", "new", "DBInstance", "from", "a", "point", "in", "time", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L884-L939
51,216
yyuu/botornado
boto/rds/__init__.py
RDSConnection.get_all_events
def get_all_events(self, source_identifier=None, source_type=None, start_time=None, end_time=None, max_records=None, marker=None): """ Get information about events related to your DBInstances, DBSecurityGroups and DBParameterGroups. :type so...
python
def get_all_events(self, source_identifier=None, source_type=None, start_time=None, end_time=None, max_records=None, marker=None): """ Get information about events related to your DBInstances, DBSecurityGroups and DBParameterGroups. :type so...
[ "def", "get_all_events", "(", "self", ",", "source_identifier", "=", "None", ",", "source_type", "=", "None", ",", "start_time", "=", "None", ",", "end_time", "=", "None", ",", "max_records", "=", "None", ",", "marker", "=", "None", ")", ":", "params", "...
Get information about events related to your DBInstances, DBSecurityGroups and DBParameterGroups. :type source_identifier: str :param source_identifier: If supplied, the events returned will be limited to those that apply to the identified ...
[ "Get", "information", "about", "events", "related", "to", "your", "DBInstances", "DBSecurityGroups", "and", "DBParameterGroups", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L943-L998
51,217
staggerpkg/stagger
stagger/id3v1.py
Tag1.read
def read(cls, filename, offset=None, encoding="iso-8859-1"): """Read an ID3v1 tag from a file.""" with fileutil.opened(filename, "rb") as file: if offset is None: file.seek(-128, 2) else: file.seek(offset) data = file.read(128) ...
python
def read(cls, filename, offset=None, encoding="iso-8859-1"): """Read an ID3v1 tag from a file.""" with fileutil.opened(filename, "rb") as file: if offset is None: file.seek(-128, 2) else: file.seek(offset) data = file.read(128) ...
[ "def", "read", "(", "cls", ",", "filename", ",", "offset", "=", "None", ",", "encoding", "=", "\"iso-8859-1\"", ")", ":", "with", "fileutil", ".", "opened", "(", "filename", ",", "\"rb\"", ")", "as", "file", ":", "if", "offset", "is", "None", ":", "f...
Read an ID3v1 tag from a file.
[ "Read", "an", "ID3v1", "tag", "from", "a", "file", "." ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/id3v1.py#L120-L128
51,218
yyuu/botornado
boto/gs/bucket.py
Bucket.set_acl
def set_acl(self, acl_or_str, key_name='', headers=None, version_id=None): """sets or changes a bucket's acl. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ...
python
def set_acl(self, acl_or_str, key_name='', headers=None, version_id=None): """sets or changes a bucket's acl. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ...
[ "def", "set_acl", "(", "self", ",", "acl_or_str", ",", "key_name", "=", "''", ",", "headers", "=", "None", ",", "version_id", "=", "None", ")", ":", "if", "isinstance", "(", "acl_or_str", ",", "Policy", ")", ":", "raise", "InvalidAclError", "(", "'Attemp...
sets or changes a bucket's acl. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ignored here.
[ "sets", "or", "changes", "a", "bucket", "s", "acl", ".", "We", "include", "a", "version_id", "argument", "to", "support", "a", "polymorphic", "interface", "for", "callers", "however", "version_id", "is", "not", "relevant", "for", "Google", "Cloud", "Storage", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/bucket.py#L41-L51
51,219
yyuu/botornado
boto/gs/bucket.py
Bucket.set_def_acl
def set_def_acl(self, acl_or_str, key_name='', headers=None): """sets or changes a bucket's default object acl""" if isinstance(acl_or_str, Policy): raise InvalidAclError('Attempt to set S3 Policy on GS ACL') elif isinstance(acl_or_str, ACL): self.set_def_xml_acl(acl_or_s...
python
def set_def_acl(self, acl_or_str, key_name='', headers=None): """sets or changes a bucket's default object acl""" if isinstance(acl_or_str, Policy): raise InvalidAclError('Attempt to set S3 Policy on GS ACL') elif isinstance(acl_or_str, ACL): self.set_def_xml_acl(acl_or_s...
[ "def", "set_def_acl", "(", "self", ",", "acl_or_str", ",", "key_name", "=", "''", ",", "headers", "=", "None", ")", ":", "if", "isinstance", "(", "acl_or_str", ",", "Policy", ")", ":", "raise", "InvalidAclError", "(", "'Attempt to set S3 Policy on GS ACL'", ")...
sets or changes a bucket's default object acl
[ "sets", "or", "changes", "a", "bucket", "s", "default", "object", "acl" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/bucket.py#L53-L60
51,220
yyuu/botornado
boto/gs/bucket.py
Bucket.get_acl
def get_acl(self, key_name='', headers=None, version_id=None): """returns a bucket's acl. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ignored here.""" ...
python
def get_acl(self, key_name='', headers=None, version_id=None): """returns a bucket's acl. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ignored here.""" ...
[ "def", "get_acl", "(", "self", ",", "key_name", "=", "''", ",", "headers", "=", "None", ",", "version_id", "=", "None", ")", ":", "return", "self", ".", "get_acl_helper", "(", "key_name", ",", "headers", ",", "STANDARD_ACL", ")" ]
returns a bucket's acl. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ignored here.
[ "returns", "a", "bucket", "s", "acl", ".", "We", "include", "a", "version_id", "argument", "to", "support", "a", "polymorphic", "interface", "for", "callers", "however", "version_id", "is", "not", "relevant", "for", "Google", "Cloud", "Storage", "buckets", "an...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/bucket.py#L77-L82
51,221
yyuu/botornado
boto/gs/bucket.py
Bucket.set_def_xml_acl
def set_def_xml_acl(self, acl_str, key_name='', headers=None): """sets or changes a bucket's default object""" return self.set_xml_acl(acl_str, key_name, headers, query_args=DEF_OBJ_ACL)
python
def set_def_xml_acl(self, acl_str, key_name='', headers=None): """sets or changes a bucket's default object""" return self.set_xml_acl(acl_str, key_name, headers, query_args=DEF_OBJ_ACL)
[ "def", "set_def_xml_acl", "(", "self", ",", "acl_str", ",", "key_name", "=", "''", ",", "headers", "=", "None", ")", ":", "return", "self", ".", "set_xml_acl", "(", "acl_str", ",", "key_name", ",", "headers", ",", "query_args", "=", "DEF_OBJ_ACL", ")" ]
sets or changes a bucket's default object
[ "sets", "or", "changes", "a", "bucket", "s", "default", "object" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/bucket.py#L120-L123
51,222
yyuu/botornado
boto/manage/volume.py
Volume.get_snapshots
def get_snapshots(self): """ Returns a list of all completed snapshots for this volume ID. """ ec2 = self.get_ec2_connection() rs = ec2.get_all_snapshots() all_vols = [self.volume_id] + self.past_volume_ids snaps = [] for snapshot in rs: if sna...
python
def get_snapshots(self): """ Returns a list of all completed snapshots for this volume ID. """ ec2 = self.get_ec2_connection() rs = ec2.get_all_snapshots() all_vols = [self.volume_id] + self.past_volume_ids snaps = [] for snapshot in rs: if sna...
[ "def", "get_snapshots", "(", "self", ")", ":", "ec2", "=", "self", ".", "get_ec2_connection", "(", ")", "rs", "=", "ec2", ".", "get_all_snapshots", "(", ")", "all_vols", "=", "[", "self", ".", "volume_id", "]", "+", "self", ".", "past_volume_ids", "snaps...
Returns a list of all completed snapshots for this volume ID.
[ "Returns", "a", "list", "of", "all", "completed", "snapshots", "for", "this", "volume", "ID", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/manage/volume.py#L183-L198
51,223
yyuu/botornado
boto/manage/volume.py
Volume.trim_snapshots
def trim_snapshots(self, delete=False): """ Trim the number of snapshots for this volume. This method always keeps the oldest snapshot. It then uses the parameters passed in to determine how many others should be kept. The algorithm is to keep all snapshots from the current da...
python
def trim_snapshots(self, delete=False): """ Trim the number of snapshots for this volume. This method always keeps the oldest snapshot. It then uses the parameters passed in to determine how many others should be kept. The algorithm is to keep all snapshots from the current da...
[ "def", "trim_snapshots", "(", "self", ",", "delete", "=", "False", ")", ":", "snaps", "=", "self", ".", "get_snapshots", "(", ")", "# Always keep the oldest and the newest", "if", "len", "(", "snaps", ")", "<=", "2", ":", "return", "snaps", "snaps", "=", "...
Trim the number of snapshots for this volume. This method always keeps the oldest snapshot. It then uses the parameters passed in to determine how many others should be kept. The algorithm is to keep all snapshots from the current day. Then it will keep the first snapshot of the day ...
[ "Trim", "the", "number", "of", "snapshots", "for", "this", "volume", ".", "This", "method", "always", "keeps", "the", "oldest", "snapshot", ".", "It", "then", "uses", "the", "parameters", "passed", "in", "to", "determine", "how", "many", "others", "should", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/manage/volume.py#L333-L398
51,224
guyskk/flask-restaction
flask_restaction/auth.py
TokenAuth.generate_headers
def generate_headers(self, token): """Generate auth headers""" headers = {} token = self.encode_token(token) if self.config["header"]: headers[self.config["header"]] = token if self.config["cookie"]: headers["Set-Cookie"] = dump_cookie( sel...
python
def generate_headers(self, token): """Generate auth headers""" headers = {} token = self.encode_token(token) if self.config["header"]: headers[self.config["header"]] = token if self.config["cookie"]: headers["Set-Cookie"] = dump_cookie( sel...
[ "def", "generate_headers", "(", "self", ",", "token", ")", ":", "headers", "=", "{", "}", "token", "=", "self", ".", "encode_token", "(", "token", ")", "if", "self", ".", "config", "[", "\"header\"", "]", ":", "headers", "[", "self", ".", "config", "...
Generate auth headers
[ "Generate", "auth", "headers" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/auth.py#L43-L54
51,225
guyskk/flask-restaction
flask_restaction/auth.py
TokenAuth.calculate_expiration
def calculate_expiration(self, token): """ Calculate token expiration return expiration if the token need to set expiration or refresh, otherwise return None. Args: token (dict): a decoded token """ if not token: return None now =...
python
def calculate_expiration(self, token): """ Calculate token expiration return expiration if the token need to set expiration or refresh, otherwise return None. Args: token (dict): a decoded token """ if not token: return None now =...
[ "def", "calculate_expiration", "(", "self", ",", "token", ")", ":", "if", "not", "token", ":", "return", "None", "now", "=", "datetime", ".", "utcnow", "(", ")", "time_to_live", "=", "self", ".", "config", "[", "\"expiration\"", "]", "if", "\"exp\"", "no...
Calculate token expiration return expiration if the token need to set expiration or refresh, otherwise return None. Args: token (dict): a decoded token
[ "Calculate", "token", "expiration" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/auth.py#L56-L77
51,226
guyskk/flask-restaction
flask_restaction/auth.py
TokenAuth.decode_token
def decode_token(self, token): """Decode Authorization token, return None if token invalid""" key = current_app.secret_key if key is None: if current_app.debug: current_app.logger.debug("app.secret_key not set") return None try: return ...
python
def decode_token(self, token): """Decode Authorization token, return None if token invalid""" key = current_app.secret_key if key is None: if current_app.debug: current_app.logger.debug("app.secret_key not set") return None try: return ...
[ "def", "decode_token", "(", "self", ",", "token", ")", ":", "key", "=", "current_app", ".", "secret_key", "if", "key", "is", "None", ":", "if", "current_app", ".", "debug", ":", "current_app", ".", "logger", ".", "debug", "(", "\"app.secret_key not set\"", ...
Decode Authorization token, return None if token invalid
[ "Decode", "Authorization", "token", "return", "None", "if", "token", "invalid" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/auth.py#L79-L93
51,227
guyskk/flask-restaction
flask_restaction/auth.py
TokenAuth.encode_token
def encode_token(self, token): """Encode Authorization token, return bytes token""" key = current_app.secret_key if key is None: raise RuntimeError( "please set app.secret_key before generate token") return jwt.encode(token, key, algorithm=self.config["algorit...
python
def encode_token(self, token): """Encode Authorization token, return bytes token""" key = current_app.secret_key if key is None: raise RuntimeError( "please set app.secret_key before generate token") return jwt.encode(token, key, algorithm=self.config["algorit...
[ "def", "encode_token", "(", "self", ",", "token", ")", ":", "key", "=", "current_app", ".", "secret_key", "if", "key", "is", "None", ":", "raise", "RuntimeError", "(", "\"please set app.secret_key before generate token\"", ")", "return", "jwt", ".", "encode", "(...
Encode Authorization token, return bytes token
[ "Encode", "Authorization", "token", "return", "bytes", "token" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/auth.py#L95-L101
51,228
yyuu/botornado
boto/roboto/awsqueryservice.py
AWSQueryService.check_for_credential_file
def check_for_credential_file(self): """ Checks for the existance of an AWS credential file. If the environment variable AWS_CREDENTIAL_FILE is set and points to a file, that file will be read and will be searched credentials. Note that if credentials have been explicitel...
python
def check_for_credential_file(self): """ Checks for the existance of an AWS credential file. If the environment variable AWS_CREDENTIAL_FILE is set and points to a file, that file will be read and will be searched credentials. Note that if credentials have been explicitel...
[ "def", "check_for_credential_file", "(", "self", ")", ":", "if", "'AWS_CREDENTIAL_FILE'", "in", "os", ".", "environ", ":", "path", "=", "os", ".", "environ", "[", "'AWS_CREDENTIAL_FILE'", "]", "path", "=", "os", ".", "path", ".", "expanduser", "(", "path", ...
Checks for the existance of an AWS credential file. If the environment variable AWS_CREDENTIAL_FILE is set and points to a file, that file will be read and will be searched credentials. Note that if credentials have been explicitelypassed into the class constructor, those values ...
[ "Checks", "for", "the", "existance", "of", "an", "AWS", "credential", "file", ".", "If", "the", "environment", "variable", "AWS_CREDENTIAL_FILE", "is", "set", "and", "points", "to", "a", "file", "that", "file", "will", "be", "read", "and", "will", "be", "s...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/roboto/awsqueryservice.py#L49-L80
51,229
yyuu/botornado
boto/roboto/awsqueryservice.py
AWSQueryService.check_for_env_url
def check_for_env_url(self): """ First checks to see if a url argument was explicitly passed in. If so, that will be used. If not, it checks for the existence of the environment variable specified in ENV_URL. If this is set, it should contain a fully qualified URL to the ...
python
def check_for_env_url(self): """ First checks to see if a url argument was explicitly passed in. If so, that will be used. If not, it checks for the existence of the environment variable specified in ENV_URL. If this is set, it should contain a fully qualified URL to the ...
[ "def", "check_for_env_url", "(", "self", ")", ":", "url", "=", "self", ".", "args", ".", "get", "(", "'url'", ",", "None", ")", "if", "url", ":", "del", "self", ".", "args", "[", "'url'", "]", "if", "not", "url", "and", "self", ".", "EnvURL", "in...
First checks to see if a url argument was explicitly passed in. If so, that will be used. If not, it checks for the existence of the environment variable specified in ENV_URL. If this is set, it should contain a fully qualified URL to the service you want to use. Note that any ...
[ "First", "checks", "to", "see", "if", "a", "url", "argument", "was", "explicitly", "passed", "in", ".", "If", "so", "that", "will", "be", "used", ".", "If", "not", "it", "checks", "for", "the", "existence", "of", "the", "environment", "variable", "specif...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/roboto/awsqueryservice.py#L82-L117
51,230
emory-libraries/eulfedora
eulfedora/server.py
Repository.get_objects_with_cmodel
def get_objects_with_cmodel(self, cmodel_uri, type=None): """ Find objects in Fedora with the specified content model. :param cmodel_uri: content model URI (should be full URI in info:fedora/pid:### format) :param type: type of object to return (e.g., class:`DigitalObject`) :rt...
python
def get_objects_with_cmodel(self, cmodel_uri, type=None): """ Find objects in Fedora with the specified content model. :param cmodel_uri: content model URI (should be full URI in info:fedora/pid:### format) :param type: type of object to return (e.g., class:`DigitalObject`) :rt...
[ "def", "get_objects_with_cmodel", "(", "self", ",", "cmodel_uri", ",", "type", "=", "None", ")", ":", "uris", "=", "self", ".", "risearch", ".", "get_subjects", "(", "modelns", ".", "hasModel", ",", "cmodel_uri", ")", "return", "[", "self", ".", "get_objec...
Find objects in Fedora with the specified content model. :param cmodel_uri: content model URI (should be full URI in info:fedora/pid:### format) :param type: type of object to return (e.g., class:`DigitalObject`) :rtype: list of objects
[ "Find", "objects", "in", "Fedora", "with", "the", "specified", "content", "model", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/server.py#L262-L271
51,231
emory-libraries/eulfedora
eulfedora/server.py
Repository.get_object
def get_object(self, pid=None, type=None, create=None): """ Initialize a single object from Fedora, or create a new one, with the same Fedora configuration and credentials. :param pid: pid of the object to request, or a function that can be called to get one. if not ...
python
def get_object(self, pid=None, type=None, create=None): """ Initialize a single object from Fedora, or create a new one, with the same Fedora configuration and credentials. :param pid: pid of the object to request, or a function that can be called to get one. if not ...
[ "def", "get_object", "(", "self", ",", "pid", "=", "None", ",", "type", "=", "None", ",", "create", "=", "None", ")", ":", "objtype", "=", "type", "or", "self", ".", "default_object_type", "if", "pid", "is", "None", ":", "if", "create", "is", "None",...
Initialize a single object from Fedora, or create a new one, with the same Fedora configuration and credentials. :param pid: pid of the object to request, or a function that can be called to get one. if not specified, :meth:`get_next_pid` will be called if a pid ...
[ "Initialize", "a", "single", "object", "from", "Fedora", "or", "create", "a", "new", "one", "with", "the", "same", "Fedora", "configuration", "and", "credentials", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/server.py#L273-L296
51,232
tsroten/fcache
fcache/cache.py
FileCache.create
def create(self): """Create the write buffer and cache directory.""" if not self._sync and not hasattr(self, '_buffer'): self._buffer = {} if not os.path.exists(self.cache_dir): os.makedirs(self.cache_dir)
python
def create(self): """Create the write buffer and cache directory.""" if not self._sync and not hasattr(self, '_buffer'): self._buffer = {} if not os.path.exists(self.cache_dir): os.makedirs(self.cache_dir)
[ "def", "create", "(", "self", ")", ":", "if", "not", "self", ".", "_sync", "and", "not", "hasattr", "(", "self", ",", "'_buffer'", ")", ":", "self", ".", "_buffer", "=", "{", "}", "if", "not", "os", ".", "path", ".", "exists", "(", "self", ".", ...
Create the write buffer and cache directory.
[ "Create", "the", "write", "buffer", "and", "cache", "directory", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L136-L141
51,233
tsroten/fcache
fcache/cache.py
FileCache.delete
def delete(self): """Delete the write buffer and cache directory.""" if not self._sync: del self._buffer shutil.rmtree(self.cache_dir)
python
def delete(self): """Delete the write buffer and cache directory.""" if not self._sync: del self._buffer shutil.rmtree(self.cache_dir)
[ "def", "delete", "(", "self", ")", ":", "if", "not", "self", ".", "_sync", ":", "del", "self", ".", "_buffer", "shutil", ".", "rmtree", "(", "self", ".", "cache_dir", ")" ]
Delete the write buffer and cache directory.
[ "Delete", "the", "write", "buffer", "and", "cache", "directory", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L152-L156
51,234
tsroten/fcache
fcache/cache.py
FileCache.close
def close(self): """Sync the write buffer, then close the cache. If a closed :class:`FileCache` object's methods are called, a :exc:`ValueError` will be raised. """ self.sync() self.sync = self.create = self.delete = self._closed self._write_to_file = self._read...
python
def close(self): """Sync the write buffer, then close the cache. If a closed :class:`FileCache` object's methods are called, a :exc:`ValueError` will be raised. """ self.sync() self.sync = self.create = self.delete = self._closed self._write_to_file = self._read...
[ "def", "close", "(", "self", ")", ":", "self", ".", "sync", "(", ")", "self", ".", "sync", "=", "self", ".", "create", "=", "self", ".", "delete", "=", "self", ".", "_closed", "self", ".", "_write_to_file", "=", "self", ".", "_read_to_file", "=", "...
Sync the write buffer, then close the cache. If a closed :class:`FileCache` object's methods are called, a :exc:`ValueError` will be raised.
[ "Sync", "the", "write", "buffer", "then", "close", "the", "cache", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L158-L170
51,235
tsroten/fcache
fcache/cache.py
FileCache.sync
def sync(self): """Sync the write buffer with the cache files and clear the buffer. If the :class:`FileCache` object was opened with the optional ``'s'`` *flag* argument, then calling :meth:`sync` will do nothing. """ if self._sync: return # opened in sync mode, so ...
python
def sync(self): """Sync the write buffer with the cache files and clear the buffer. If the :class:`FileCache` object was opened with the optional ``'s'`` *flag* argument, then calling :meth:`sync` will do nothing. """ if self._sync: return # opened in sync mode, so ...
[ "def", "sync", "(", "self", ")", ":", "if", "self", ".", "_sync", ":", "return", "# opened in sync mode, so skip the manual sync", "self", ".", "_sync", "=", "True", "for", "ekey", "in", "self", ".", "_buffer", ":", "filename", "=", "self", ".", "_key_to_fil...
Sync the write buffer with the cache files and clear the buffer. If the :class:`FileCache` object was opened with the optional ``'s'`` *flag* argument, then calling :meth:`sync` will do nothing.
[ "Sync", "the", "write", "buffer", "with", "the", "cache", "files", "and", "clear", "the", "buffer", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L172-L185
51,236
tsroten/fcache
fcache/cache.py
FileCache._decode_key
def _decode_key(self, key): """Decode key using hex_codec to retrieve the original key. Keys are returned as :class:`str` if serialization is enabled. Keys are returned as :class:`bytes` if serialization is disabled. """ bkey = codecs.decode(key.encode(self._keyencoding), 'hex_...
python
def _decode_key(self, key): """Decode key using hex_codec to retrieve the original key. Keys are returned as :class:`str` if serialization is enabled. Keys are returned as :class:`bytes` if serialization is disabled. """ bkey = codecs.decode(key.encode(self._keyencoding), 'hex_...
[ "def", "_decode_key", "(", "self", ",", "key", ")", ":", "bkey", "=", "codecs", ".", "decode", "(", "key", ".", "encode", "(", "self", ".", "_keyencoding", ")", ",", "'hex_codec'", ")", "return", "bkey", ".", "decode", "(", "self", ".", "_keyencoding",...
Decode key using hex_codec to retrieve the original key. Keys are returned as :class:`str` if serialization is enabled. Keys are returned as :class:`bytes` if serialization is disabled.
[ "Decode", "key", "using", "hex_codec", "to", "retrieve", "the", "original", "key", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L204-L212
51,237
tsroten/fcache
fcache/cache.py
FileCache._all_filenames
def _all_filenames(self): """Return a list of absolute cache filenames""" try: return [os.path.join(self.cache_dir, filename) for filename in os.listdir(self.cache_dir)] except (FileNotFoundError, OSError): return []
python
def _all_filenames(self): """Return a list of absolute cache filenames""" try: return [os.path.join(self.cache_dir, filename) for filename in os.listdir(self.cache_dir)] except (FileNotFoundError, OSError): return []
[ "def", "_all_filenames", "(", "self", ")", ":", "try", ":", "return", "[", "os", ".", "path", ".", "join", "(", "self", ".", "cache_dir", ",", "filename", ")", "for", "filename", "in", "os", ".", "listdir", "(", "self", ".", "cache_dir", ")", "]", ...
Return a list of absolute cache filenames
[ "Return", "a", "list", "of", "absolute", "cache", "filenames" ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L228-L234
51,238
tsroten/fcache
fcache/cache.py
FileCache._all_keys
def _all_keys(self): """Return a list of all encoded key names.""" file_keys = [self._filename_to_key(fn) for fn in self._all_filenames()] if self._sync: return set(file_keys) else: return set(file_keys + list(self._buffer))
python
def _all_keys(self): """Return a list of all encoded key names.""" file_keys = [self._filename_to_key(fn) for fn in self._all_filenames()] if self._sync: return set(file_keys) else: return set(file_keys + list(self._buffer))
[ "def", "_all_keys", "(", "self", ")", ":", "file_keys", "=", "[", "self", ".", "_filename_to_key", "(", "fn", ")", "for", "fn", "in", "self", ".", "_all_filenames", "(", ")", "]", "if", "self", ".", "_sync", ":", "return", "set", "(", "file_keys", ")...
Return a list of all encoded key names.
[ "Return", "a", "list", "of", "all", "encoded", "key", "names", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L236-L242
51,239
tsroten/fcache
fcache/cache.py
FileCache._write_to_file
def _write_to_file(self, filename, bytesvalue): """Write bytesvalue to filename.""" fh, tmp = tempfile.mkstemp() with os.fdopen(fh, self._flag) as f: f.write(self._dumps(bytesvalue)) rename(tmp, filename) os.chmod(filename, self._mode)
python
def _write_to_file(self, filename, bytesvalue): """Write bytesvalue to filename.""" fh, tmp = tempfile.mkstemp() with os.fdopen(fh, self._flag) as f: f.write(self._dumps(bytesvalue)) rename(tmp, filename) os.chmod(filename, self._mode)
[ "def", "_write_to_file", "(", "self", ",", "filename", ",", "bytesvalue", ")", ":", "fh", ",", "tmp", "=", "tempfile", ".", "mkstemp", "(", ")", "with", "os", ".", "fdopen", "(", "fh", ",", "self", ".", "_flag", ")", "as", "f", ":", "f", ".", "wr...
Write bytesvalue to filename.
[ "Write", "bytesvalue", "to", "filename", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L244-L250
51,240
tsroten/fcache
fcache/cache.py
FileCache._read_from_file
def _read_from_file(self, filename): """Read data from filename.""" try: with open(filename, 'rb') as f: return self._loads(f.read()) except (IOError, OSError): logger.warning('Error opening file: {}'.format(filename)) return None
python
def _read_from_file(self, filename): """Read data from filename.""" try: with open(filename, 'rb') as f: return self._loads(f.read()) except (IOError, OSError): logger.warning('Error opening file: {}'.format(filename)) return None
[ "def", "_read_from_file", "(", "self", ",", "filename", ")", ":", "try", ":", "with", "open", "(", "filename", ",", "'rb'", ")", "as", "f", ":", "return", "self", ".", "_loads", "(", "f", ".", "read", "(", ")", ")", "except", "(", "IOError", ",", ...
Read data from filename.
[ "Read", "data", "from", "filename", "." ]
7ee3f385bc5f855e812f40d6af160ef7037a28e4
https://github.com/tsroten/fcache/blob/7ee3f385bc5f855e812f40d6af160ef7037a28e4/fcache/cache.py#L252-L259
51,241
emory-libraries/eulfedora
eulfedora/api.py
REST_API.getDatastreamDissemination
def getDatastreamDissemination(self, pid, dsID, asOfDateTime=None, stream=False, head=False, rqst_headers=None): """Get a single datastream on a Fedora object; optionally, get the version as of a particular date time. :param pid: object pid :param dsID: datastream id ...
python
def getDatastreamDissemination(self, pid, dsID, asOfDateTime=None, stream=False, head=False, rqst_headers=None): """Get a single datastream on a Fedora object; optionally, get the version as of a particular date time. :param pid: object pid :param dsID: datastream id ...
[ "def", "getDatastreamDissemination", "(", "self", ",", "pid", ",", "dsID", ",", "asOfDateTime", "=", "None", ",", "stream", "=", "False", ",", "head", "=", "False", ",", "rqst_headers", "=", "None", ")", ":", "# /objects/{pid}/datastreams/{dsID}/content ? [asOfDat...
Get a single datastream on a Fedora object; optionally, get the version as of a particular date time. :param pid: object pid :param dsID: datastream id :param asOfDateTime: optional datetime; ``must`` be a non-naive datetime so it can be converted to a date-time format Fedor...
[ "Get", "a", "single", "datastream", "on", "a", "Fedora", "object", ";", "optionally", "get", "the", "version", "as", "of", "a", "particular", "date", "time", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L199-L228
51,242
emory-libraries/eulfedora
eulfedora/api.py
REST_API.getDissemination
def getDissemination(self, pid, sdefPid, method, method_params=None): '''Get a service dissemination. .. NOTE: This method not available in REST API until Fedora 3.3 :param pid: object pid :param sDefPid: service definition pid :param method: service method name ...
python
def getDissemination(self, pid, sdefPid, method, method_params=None): '''Get a service dissemination. .. NOTE: This method not available in REST API until Fedora 3.3 :param pid: object pid :param sDefPid: service definition pid :param method: service method name ...
[ "def", "getDissemination", "(", "self", ",", "pid", ",", "sdefPid", ",", "method", ",", "method_params", "=", "None", ")", ":", "# /objects/{pid}/methods/{sdefPid}/{method} ? [method parameters]", "if", "method_params", "is", "None", ":", "method_params", "=", "{", ...
Get a service dissemination. .. NOTE: This method not available in REST API until Fedora 3.3 :param pid: object pid :param sDefPid: service definition pid :param method: service method name :param method_params: method parameters :rtype: :class:`requests.mo...
[ "Get", "a", "service", "dissemination", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L231-L249
51,243
emory-libraries/eulfedora
eulfedora/api.py
REST_API.getObjectProfile
def getObjectProfile(self, pid, asOfDateTime=None): """Get top-level information aboug a single Fedora object; optionally, retrieve information as of a particular date-time. :param pid: object pid :param asOfDateTime: optional datetime; ``must`` be a non-naive datetime so it...
python
def getObjectProfile(self, pid, asOfDateTime=None): """Get top-level information aboug a single Fedora object; optionally, retrieve information as of a particular date-time. :param pid: object pid :param asOfDateTime: optional datetime; ``must`` be a non-naive datetime so it...
[ "def", "getObjectProfile", "(", "self", ",", "pid", ",", "asOfDateTime", "=", "None", ")", ":", "# /objects/{pid} ? [format] [asOfDateTime]", "http_args", "=", "{", "}", "if", "asOfDateTime", ":", "http_args", "[", "'asOfDateTime'", "]", "=", "datetime_to_fedoratime...
Get top-level information aboug a single Fedora object; optionally, retrieve information as of a particular date-time. :param pid: object pid :param asOfDateTime: optional datetime; ``must`` be a non-naive datetime so it can be converted to a date-time format Fedora can understand ...
[ "Get", "top", "-", "level", "information", "aboug", "a", "single", "Fedora", "object", ";", "optionally", "retrieve", "information", "as", "of", "a", "particular", "date", "-", "time", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L261-L276
51,244
emory-libraries/eulfedora
eulfedora/api.py
REST_API.listMethods
def listMethods(self, pid, sdefpid=None): '''List available service methods. :param pid: object pid :param sDefPid: service definition pid :rtype: :class:`requests.models.Response` ''' # /objects/{pid}/methods ? [format, datetime] # /objects/{pid}/methods/{sdefpi...
python
def listMethods(self, pid, sdefpid=None): '''List available service methods. :param pid: object pid :param sDefPid: service definition pid :rtype: :class:`requests.models.Response` ''' # /objects/{pid}/methods ? [format, datetime] # /objects/{pid}/methods/{sdefpi...
[ "def", "listMethods", "(", "self", ",", "pid", ",", "sdefpid", "=", "None", ")", ":", "# /objects/{pid}/methods ? [format, datetime]", "# /objects/{pid}/methods/{sdefpid} ? [format, datetime]", "## NOTE: getting an error when sdefpid is specified; fedora issue?", "uri", "=", "'obje...
List available service methods. :param pid: object pid :param sDefPid: service definition pid :rtype: :class:`requests.models.Response`
[ "List", "available", "service", "methods", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L293-L308
51,245
emory-libraries/eulfedora
eulfedora/api.py
REST_API.addDatastream
def addDatastream(self, pid, dsID, dsLabel=None, mimeType=None, logMessage=None, controlGroup=None, dsLocation=None, altIDs=None, versionable=None, dsState=None, formatURI=None, checksumType=None, checksum=None, content=None): '''Add a new datastream to an existing object. On success, t...
python
def addDatastream(self, pid, dsID, dsLabel=None, mimeType=None, logMessage=None, controlGroup=None, dsLocation=None, altIDs=None, versionable=None, dsState=None, formatURI=None, checksumType=None, checksum=None, content=None): '''Add a new datastream to an existing object. On success, t...
[ "def", "addDatastream", "(", "self", ",", "pid", ",", "dsID", ",", "dsLabel", "=", "None", ",", "mimeType", "=", "None", ",", "logMessage", "=", "None", ",", "controlGroup", "=", "None", ",", "dsLocation", "=", "None", ",", "altIDs", "=", "None", ",", ...
Add a new datastream to an existing object. On success, the return response should have a status of 201 Created; if there is an error, the response body includes the error message. :param pid: object pid :param dsID: id for the new datastream :param dslabel: label for the new d...
[ "Add", "a", "new", "datastream", "to", "an", "existing", "object", ".", "On", "success", "the", "return", "response", "should", "have", "a", "status", "of", "201", "Created", ";", "if", "there", "is", "an", "error", "the", "response", "body", "includes", ...
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L312-L389
51,246
emory-libraries/eulfedora
eulfedora/api.py
REST_API.export
def export(self, pid, context=None, format=None, encoding=None, stream=False): '''Export an object to be migrated or archived. :param pid: object pid :param context: export context, one of: public, migrate, archive (default: public) :param format: export form...
python
def export(self, pid, context=None, format=None, encoding=None, stream=False): '''Export an object to be migrated or archived. :param pid: object pid :param context: export context, one of: public, migrate, archive (default: public) :param format: export form...
[ "def", "export", "(", "self", ",", "pid", ",", "context", "=", "None", ",", "format", "=", "None", ",", "encoding", "=", "None", ",", "stream", "=", "False", ")", ":", "http_args", "=", "{", "}", "if", "context", ":", "http_args", "[", "'context'", ...
Export an object to be migrated or archived. :param pid: object pid :param context: export context, one of: public, migrate, archive (default: public) :param format: export format (Fedora default is foxml 1.1) :param encoding: encoding (Fedora default is UTF-8) :para...
[ "Export", "an", "object", "to", "be", "migrated", "or", "archived", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L434-L456
51,247
emory-libraries/eulfedora
eulfedora/api.py
REST_API.getDatastream
def getDatastream(self, pid, dsID, asOfDateTime=None, validateChecksum=False): """Get information about a single datastream on a Fedora object; optionally, get information for the version of the datastream as of a particular date time. :param pid: object pid :param dsID: datastream id ...
python
def getDatastream(self, pid, dsID, asOfDateTime=None, validateChecksum=False): """Get information about a single datastream on a Fedora object; optionally, get information for the version of the datastream as of a particular date time. :param pid: object pid :param dsID: datastream id ...
[ "def", "getDatastream", "(", "self", ",", "pid", ",", "dsID", ",", "asOfDateTime", "=", "None", ",", "validateChecksum", "=", "False", ")", ":", "# /objects/{pid}/datastreams/{dsID} ? [asOfDateTime] [format] [validateChecksum]", "http_args", "=", "{", "}", "if", "vali...
Get information about a single datastream on a Fedora object; optionally, get information for the version of the datastream as of a particular date time. :param pid: object pid :param dsID: datastream id :param asOfDateTime: optional datetime; ``must`` be a non-naive datetime ...
[ "Get", "information", "about", "a", "single", "datastream", "on", "a", "Fedora", "object", ";", "optionally", "get", "information", "for", "the", "version", "of", "the", "datastream", "as", "of", "a", "particular", "date", "time", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L458-L479
51,248
emory-libraries/eulfedora
eulfedora/api.py
REST_API.getDatastreamHistory
def getDatastreamHistory(self, pid, dsid, format=None): '''Get history information for a datastream. :param pid: object pid :param dsid: datastream id :param format: format :rtype: :class:`requests.models.Response` ''' http_args = {} if format is not None...
python
def getDatastreamHistory(self, pid, dsid, format=None): '''Get history information for a datastream. :param pid: object pid :param dsid: datastream id :param format: format :rtype: :class:`requests.models.Response` ''' http_args = {} if format is not None...
[ "def", "getDatastreamHistory", "(", "self", ",", "pid", ",", "dsid", ",", "format", "=", "None", ")", ":", "http_args", "=", "{", "}", "if", "format", "is", "not", "None", ":", "http_args", "[", "'format'", "]", "=", "format", "# Fedora docs say the url sh...
Get history information for a datastream. :param pid: object pid :param dsid: datastream id :param format: format :rtype: :class:`requests.models.Response`
[ "Get", "history", "information", "for", "a", "datastream", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L481-L497
51,249
emory-libraries/eulfedora
eulfedora/api.py
REST_API.getRelationships
def getRelationships(self, pid, subject=None, predicate=None, format=None): '''Get information about relationships on an object. Wrapper function for `Fedora REST API getRelationships <https://wiki.duraspace.org/display/FEDORA34/REST+API#RESTAPI-getRelationships>`_ :param pid: object ...
python
def getRelationships(self, pid, subject=None, predicate=None, format=None): '''Get information about relationships on an object. Wrapper function for `Fedora REST API getRelationships <https://wiki.duraspace.org/display/FEDORA34/REST+API#RESTAPI-getRelationships>`_ :param pid: object ...
[ "def", "getRelationships", "(", "self", ",", "pid", ",", "subject", "=", "None", ",", "predicate", "=", "None", ",", "format", "=", "None", ")", ":", "http_args", "=", "{", "}", "if", "subject", "is", "not", "None", ":", "http_args", "[", "'subject'", ...
Get information about relationships on an object. Wrapper function for `Fedora REST API getRelationships <https://wiki.duraspace.org/display/FEDORA34/REST+API#RESTAPI-getRelationships>`_ :param pid: object pid :param subject: subject (optional) :param predicate: predicate (opt...
[ "Get", "information", "about", "relationships", "on", "an", "object", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L530-L551
51,250
emory-libraries/eulfedora
eulfedora/api.py
REST_API.ingest
def ingest(self, text, logMessage=None): """Ingest a new object into Fedora. Returns the pid of the new object on success. Return response should have a status of 201 Created on success, and the content of the response will be the newly created pid. Wrapper function for `Fedora REST API...
python
def ingest(self, text, logMessage=None): """Ingest a new object into Fedora. Returns the pid of the new object on success. Return response should have a status of 201 Created on success, and the content of the response will be the newly created pid. Wrapper function for `Fedora REST API...
[ "def", "ingest", "(", "self", ",", "text", ",", "logMessage", "=", "None", ")", ":", "# NOTE: ingest method supports additional options for", "# label/format/namespace/ownerId, etc - but we generally set", "# those in the foxml that is passed in", "http_args", "=", "{", "}", "i...
Ingest a new object into Fedora. Returns the pid of the new object on success. Return response should have a status of 201 Created on success, and the content of the response will be the newly created pid. Wrapper function for `Fedora REST API ingest <http://fedora-commons.org/confluence/displa...
[ "Ingest", "a", "new", "object", "into", "Fedora", ".", "Returns", "the", "pid", "of", "the", "new", "object", "on", "success", ".", "Return", "response", "should", "have", "a", "status", "of", "201", "Created", "on", "success", "and", "the", "content", "...
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L553-L581
51,251
emory-libraries/eulfedora
eulfedora/api.py
REST_API.modifyObject
def modifyObject(self, pid, label, ownerId, state, logMessage=None): '''Modify object properties. Returned response should have a status of 200 on succuss. :param pid: object pid :param label: object label :param ownerId: object owner :param state: object state ...
python
def modifyObject(self, pid, label, ownerId, state, logMessage=None): '''Modify object properties. Returned response should have a status of 200 on succuss. :param pid: object pid :param label: object label :param ownerId: object owner :param state: object state ...
[ "def", "modifyObject", "(", "self", ",", "pid", ",", "label", ",", "ownerId", ",", "state", ",", "logMessage", "=", "None", ")", ":", "# /objects/{pid} ? [label] [ownerId] [state] [logMessage]", "http_args", "=", "{", "'label'", ":", "label", ",", "'ownerId'", "...
Modify object properties. Returned response should have a status of 200 on succuss. :param pid: object pid :param label: object label :param ownerId: object owner :param state: object state :param logMessage: optional log message :rtype: :class:`requests.models...
[ "Modify", "object", "properties", ".", "Returned", "response", "should", "have", "a", "status", "of", "200", "on", "succuss", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L660-L679
51,252
emory-libraries/eulfedora
eulfedora/api.py
REST_API.purgeDatastream
def purgeDatastream(self, pid, dsID, startDT=None, endDT=None, logMessage=None, force=False): """Purge a datastream, or specific versions of a dastream, from a Fedora object. On success, response content will include a list of timestamps for the purged datastream versions; on failur...
python
def purgeDatastream(self, pid, dsID, startDT=None, endDT=None, logMessage=None, force=False): """Purge a datastream, or specific versions of a dastream, from a Fedora object. On success, response content will include a list of timestamps for the purged datastream versions; on failur...
[ "def", "purgeDatastream", "(", "self", ",", "pid", ",", "dsID", ",", "startDT", "=", "None", ",", "endDT", "=", "None", ",", "logMessage", "=", "None", ",", "force", "=", "False", ")", ":", "# /objects/{pid}/datastreams/{dsID} ? [startDT] [endDT] [logMessage] [for...
Purge a datastream, or specific versions of a dastream, from a Fedora object. On success, response content will include a list of timestamps for the purged datastream versions; on failure, response content may contain an error message. :param pid: object pid :param dsID: datast...
[ "Purge", "a", "datastream", "or", "specific", "versions", "of", "a", "dastream", "from", "a", "Fedora", "object", ".", "On", "success", "response", "content", "will", "include", "a", "list", "of", "timestamps", "for", "the", "purged", "datastream", "versions",...
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L682-L709
51,253
emory-libraries/eulfedora
eulfedora/api.py
REST_API.purgeObject
def purgeObject(self, pid, logMessage=None): """Purge an object from Fedora. Returned response shoudl have a status of 200 on success; response content is a timestamp. Wrapper function for `REST API purgeObject <http://fedora-commons.org/confluence/display/FCR30/REST+API#RESTAPI...
python
def purgeObject(self, pid, logMessage=None): """Purge an object from Fedora. Returned response shoudl have a status of 200 on success; response content is a timestamp. Wrapper function for `REST API purgeObject <http://fedora-commons.org/confluence/display/FCR30/REST+API#RESTAPI...
[ "def", "purgeObject", "(", "self", ",", "pid", ",", "logMessage", "=", "None", ")", ":", "http_args", "=", "{", "}", "if", "logMessage", ":", "http_args", "[", "'logMessage'", "]", "=", "logMessage", "url", "=", "'objects/%(pid)s'", "%", "{", "'pid'", ":...
Purge an object from Fedora. Returned response shoudl have a status of 200 on success; response content is a timestamp. Wrapper function for `REST API purgeObject <http://fedora-commons.org/confluence/display/FCR30/REST+API#RESTAPI-purgeObject>`_ :param pid: pid of the object t...
[ "Purge", "an", "object", "from", "Fedora", ".", "Returned", "response", "shoudl", "have", "a", "status", "of", "200", "on", "success", ";", "response", "content", "is", "a", "timestamp", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L724-L741
51,254
emory-libraries/eulfedora
eulfedora/api.py
REST_API.purgeRelationship
def purgeRelationship(self, pid, subject, predicate, object, isLiteral=False, datatype=None): '''Remove a relationship from an object. Wrapper function for `Fedora REST API purgeRelationship <https://wiki.duraspace.org/display/FEDORA34/REST+API#RESTAPI-purgeRelationship>...
python
def purgeRelationship(self, pid, subject, predicate, object, isLiteral=False, datatype=None): '''Remove a relationship from an object. Wrapper function for `Fedora REST API purgeRelationship <https://wiki.duraspace.org/display/FEDORA34/REST+API#RESTAPI-purgeRelationship>...
[ "def", "purgeRelationship", "(", "self", ",", "pid", ",", "subject", ",", "predicate", ",", "object", ",", "isLiteral", "=", "False", ",", "datatype", "=", "None", ")", ":", "http_args", "=", "{", "'subject'", ":", "subject", ",", "'predicate'", ":", "pr...
Remove a relationship from an object. Wrapper function for `Fedora REST API purgeRelationship <https://wiki.duraspace.org/display/FEDORA34/REST+API#RESTAPI-purgeRelationship>`_ :param pid: object pid :param subject: relationship subject :param predicate: relationship predicate ...
[ "Remove", "a", "relationship", "from", "an", "object", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L745-L771
51,255
emory-libraries/eulfedora
eulfedora/api.py
REST_API.setDatastreamState
def setDatastreamState(self, pid, dsID, dsState): '''Update datastream state. :param pid: object pid :param dsID: datastream id :param dsState: datastream state :returns: boolean success ''' # /objects/{pid}/datastreams/{dsID} ? [dsState] http_args = {'ds...
python
def setDatastreamState(self, pid, dsID, dsState): '''Update datastream state. :param pid: object pid :param dsID: datastream id :param dsState: datastream state :returns: boolean success ''' # /objects/{pid}/datastreams/{dsID} ? [dsState] http_args = {'ds...
[ "def", "setDatastreamState", "(", "self", ",", "pid", ",", "dsID", ",", "dsState", ")", ":", "# /objects/{pid}/datastreams/{dsID} ? [dsState]", "http_args", "=", "{", "'dsState'", ":", "dsState", "}", "url", "=", "'objects/%(pid)s/datastreams/%(dsid)s'", "%", "{", "...
Update datastream state. :param pid: object pid :param dsID: datastream id :param dsState: datastream state :returns: boolean success
[ "Update", "datastream", "state", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L773-L786
51,256
emory-libraries/eulfedora
eulfedora/api.py
REST_API.setDatastreamVersionable
def setDatastreamVersionable(self, pid, dsID, versionable): '''Update datastream versionable setting. :param pid: object pid :param dsID: datastream id :param versionable: boolean :returns: boolean success ''' # /objects/{pid}/datastreams/{dsID} ? [versionable] ...
python
def setDatastreamVersionable(self, pid, dsID, versionable): '''Update datastream versionable setting. :param pid: object pid :param dsID: datastream id :param versionable: boolean :returns: boolean success ''' # /objects/{pid}/datastreams/{dsID} ? [versionable] ...
[ "def", "setDatastreamVersionable", "(", "self", ",", "pid", ",", "dsID", ",", "versionable", ")", ":", "# /objects/{pid}/datastreams/{dsID} ? [versionable]", "http_args", "=", "{", "'versionable'", ":", "versionable", "}", "url", "=", "'objects/%(pid)s/datastreams/%(dsid)...
Update datastream versionable setting. :param pid: object pid :param dsID: datastream id :param versionable: boolean :returns: boolean success
[ "Update", "datastream", "versionable", "setting", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L788-L801
51,257
emory-libraries/eulfedora
eulfedora/api.py
REST_API.upload
def upload(self, data, callback=None, content_type=None, size=None): ''' Upload a multi-part file for content to ingest. Returns a temporary upload id that can be used as a datstream location. :param data: content string, file-like object, or iterable with co...
python
def upload(self, data, callback=None, content_type=None, size=None): ''' Upload a multi-part file for content to ingest. Returns a temporary upload id that can be used as a datstream location. :param data: content string, file-like object, or iterable with co...
[ "def", "upload", "(", "self", ",", "data", ",", "callback", "=", "None", ",", "content_type", "=", "None", ",", "size", "=", "None", ")", ":", "url", "=", "'upload'", "# fedora only expects content uploaded as multipart file;", "# make string content into a file-like ...
Upload a multi-part file for content to ingest. Returns a temporary upload id that can be used as a datstream location. :param data: content string, file-like object, or iterable with content to be uploaded :param callback: optional callback method to monitor the upload; ...
[ "Upload", "a", "multi", "-", "part", "file", "for", "content", "to", "ingest", ".", "Returns", "a", "temporary", "upload", "id", "that", "can", "be", "used", "as", "a", "datstream", "location", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L805-L868
51,258
emory-libraries/eulfedora
eulfedora/api.py
ResourceIndex.get_subjects
def get_subjects(self, predicate, object): """ Search for all subjects related to the specified predicate and object. :param predicate: :param object: :rtype: generator of RDF statements """ for statement in self.spo_search(predicate=predicate, object=object): ...
python
def get_subjects(self, predicate, object): """ Search for all subjects related to the specified predicate and object. :param predicate: :param object: :rtype: generator of RDF statements """ for statement in self.spo_search(predicate=predicate, object=object): ...
[ "def", "get_subjects", "(", "self", ",", "predicate", ",", "object", ")", ":", "for", "statement", "in", "self", ".", "spo_search", "(", "predicate", "=", "predicate", ",", "object", "=", "object", ")", ":", "yield", "str", "(", "statement", "[", "0", ...
Search for all subjects related to the specified predicate and object. :param predicate: :param object: :rtype: generator of RDF statements
[ "Search", "for", "all", "subjects", "related", "to", "the", "specified", "predicate", "and", "object", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L1034-L1043
51,259
emory-libraries/eulfedora
eulfedora/api.py
ResourceIndex.get_predicates
def get_predicates(self, subject, object): """ Search for all subjects related to the specified subject and object. :param subject: :param object: :rtype: generator of RDF statements """ for statement in self.spo_search(subject=subject, object=object): ...
python
def get_predicates(self, subject, object): """ Search for all subjects related to the specified subject and object. :param subject: :param object: :rtype: generator of RDF statements """ for statement in self.spo_search(subject=subject, object=object): ...
[ "def", "get_predicates", "(", "self", ",", "subject", ",", "object", ")", ":", "for", "statement", "in", "self", ".", "spo_search", "(", "subject", "=", "subject", ",", "object", "=", "object", ")", ":", "yield", "str", "(", "statement", "[", "1", "]",...
Search for all subjects related to the specified subject and object. :param subject: :param object: :rtype: generator of RDF statements
[ "Search", "for", "all", "subjects", "related", "to", "the", "specified", "subject", "and", "object", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L1045-L1054
51,260
emory-libraries/eulfedora
eulfedora/api.py
ResourceIndex.get_objects
def get_objects(self, subject, predicate): """ Search for all subjects related to the specified subject and predicate. :param subject: :param object: :rtype: generator of RDF statements """ for statement in self.spo_search(subject=subject, predicate=predicate): ...
python
def get_objects(self, subject, predicate): """ Search for all subjects related to the specified subject and predicate. :param subject: :param object: :rtype: generator of RDF statements """ for statement in self.spo_search(subject=subject, predicate=predicate): ...
[ "def", "get_objects", "(", "self", ",", "subject", ",", "predicate", ")", ":", "for", "statement", "in", "self", ".", "spo_search", "(", "subject", "=", "subject", ",", "predicate", "=", "predicate", ")", ":", "yield", "str", "(", "statement", "[", "2", ...
Search for all subjects related to the specified subject and predicate. :param subject: :param object: :rtype: generator of RDF statements
[ "Search", "for", "all", "subjects", "related", "to", "the", "specified", "subject", "and", "predicate", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L1056-L1065
51,261
emory-libraries/eulfedora
eulfedora/api.py
ResourceIndex.sparql_query
def sparql_query(self, query, flush=None, limit=None): """ Run a Sparql query. :param query: sparql query string :rtype: list of dictionary """ return self.find_statements(query, language='sparql', type='tuples', flush=flush, limit=limit)
python
def sparql_query(self, query, flush=None, limit=None): """ Run a Sparql query. :param query: sparql query string :rtype: list of dictionary """ return self.find_statements(query, language='sparql', type='tuples', flush=flush, limit=limit)
[ "def", "sparql_query", "(", "self", ",", "query", ",", "flush", "=", "None", ",", "limit", "=", "None", ")", ":", "return", "self", ".", "find_statements", "(", "query", ",", "language", "=", "'sparql'", ",", "type", "=", "'tuples'", ",", "flush", "=",...
Run a Sparql query. :param query: sparql query string :rtype: list of dictionary
[ "Run", "a", "Sparql", "query", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L1067-L1075
51,262
emory-libraries/eulfedora
eulfedora/api.py
ResourceIndex.sparql_count
def sparql_count(self, query, flush=None): """ Count results for a Sparql query. :param query: sparql query string :rtype: int """ return self.count_statements(query, language='sparql', type='tuples', flush=flush)
python
def sparql_count(self, query, flush=None): """ Count results for a Sparql query. :param query: sparql query string :rtype: int """ return self.count_statements(query, language='sparql', type='tuples', flush=flush)
[ "def", "sparql_count", "(", "self", ",", "query", ",", "flush", "=", "None", ")", ":", "return", "self", ".", "count_statements", "(", "query", ",", "language", "=", "'sparql'", ",", "type", "=", "'tuples'", ",", "flush", "=", "flush", ")" ]
Count results for a Sparql query. :param query: sparql query string :rtype: int
[ "Count", "results", "for", "a", "Sparql", "query", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/api.py#L1077-L1085
51,263
yyuu/botornado
boto/cloudformation/connection.py
CloudFormationConnection.create_stack
def create_stack(self, stack_name, template_body=None, template_url=None, parameters=[], notification_arns=[], disable_rollback=False, timeout_in_minutes=None, capabilities=None): """ Creates a CloudFormation Stack as specified by the template. :type stack_name: string ...
python
def create_stack(self, stack_name, template_body=None, template_url=None, parameters=[], notification_arns=[], disable_rollback=False, timeout_in_minutes=None, capabilities=None): """ Creates a CloudFormation Stack as specified by the template. :type stack_name: string ...
[ "def", "create_stack", "(", "self", ",", "stack_name", ",", "template_body", "=", "None", ",", "template_url", "=", "None", ",", "parameters", "=", "[", "]", ",", "notification_arns", "=", "[", "]", ",", "disable_rollback", "=", "False", ",", "timeout_in_min...
Creates a CloudFormation Stack as specified by the template. :type stack_name: string :param stack_name: The name of the Stack, must be unique amoung running Stacks :type template_body: string :param template_body: The template body (JSON string) :t...
[ "Creates", "a", "CloudFormation", "Stack", "as", "specified", "by", "the", "template", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudformation/connection.py#L70-L143
51,264
yyuu/botornado
boto/route53/record.py
ResourceRecordSets.add_change
def add_change(self, action, name, type, ttl=600, alias_hosted_zone_id=None, alias_dns_name=None, identifier=None, weight=None): """Add a change request""" change = Record(name, type, ttl, alias_hosted_zone_id=alias_hosted_zone_id, alias_dns_name=a...
python
def add_change(self, action, name, type, ttl=600, alias_hosted_zone_id=None, alias_dns_name=None, identifier=None, weight=None): """Add a change request""" change = Record(name, type, ttl, alias_hosted_zone_id=alias_hosted_zone_id, alias_dns_name=a...
[ "def", "add_change", "(", "self", ",", "action", ",", "name", ",", "type", ",", "ttl", "=", "600", ",", "alias_hosted_zone_id", "=", "None", ",", "alias_dns_name", "=", "None", ",", "identifier", "=", "None", ",", "weight", "=", "None", ")", ":", "chan...
Add a change request
[ "Add", "a", "change", "request" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/record.py#L54-L63
51,265
yyuu/botornado
boto/route53/record.py
ResourceRecordSets.to_xml
def to_xml(self): """Convert this ResourceRecordSet into XML to be saved via the ChangeResourceRecordSetsRequest""" changesXML = "" for change in self.changes: changeParams = {"action": change[0], "record": change[1].to_xml()} changesXML += self.ChangeXML % change...
python
def to_xml(self): """Convert this ResourceRecordSet into XML to be saved via the ChangeResourceRecordSetsRequest""" changesXML = "" for change in self.changes: changeParams = {"action": change[0], "record": change[1].to_xml()} changesXML += self.ChangeXML % change...
[ "def", "to_xml", "(", "self", ")", ":", "changesXML", "=", "\"\"", "for", "change", "in", "self", ".", "changes", ":", "changeParams", "=", "{", "\"action\"", ":", "change", "[", "0", "]", ",", "\"record\"", ":", "change", "[", "1", "]", ".", "to_xml...
Convert this ResourceRecordSet into XML to be saved via the ChangeResourceRecordSetsRequest
[ "Convert", "this", "ResourceRecordSet", "into", "XML", "to", "be", "saved", "via", "the", "ChangeResourceRecordSetsRequest" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/record.py#L65-L73
51,266
yyuu/botornado
boto/route53/record.py
ResourceRecordSets.commit
def commit(self): """Commit this change""" if not self.connection: import boto self.connection = boto.connect_route53() return self.connection.change_rrsets(self.hosted_zone_id, self.to_xml())
python
def commit(self): """Commit this change""" if not self.connection: import boto self.connection = boto.connect_route53() return self.connection.change_rrsets(self.hosted_zone_id, self.to_xml())
[ "def", "commit", "(", "self", ")", ":", "if", "not", "self", ".", "connection", ":", "import", "boto", "self", ".", "connection", "=", "boto", ".", "connect_route53", "(", ")", "return", "self", ".", "connection", ".", "change_rrsets", "(", "self", ".", ...
Commit this change
[ "Commit", "this", "change" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/record.py#L75-L80
51,267
yyuu/botornado
boto/route53/record.py
ResourceRecordSets.endElement
def endElement(self, name, value, connection): """Overwritten to also add the NextRecordName and NextRecordType to the base object""" if name == 'NextRecordName': self.next_record_name = value elif name == 'NextRecordType': self.next_record_type = value el...
python
def endElement(self, name, value, connection): """Overwritten to also add the NextRecordName and NextRecordType to the base object""" if name == 'NextRecordName': self.next_record_name = value elif name == 'NextRecordType': self.next_record_type = value el...
[ "def", "endElement", "(", "self", ",", "name", ",", "value", ",", "connection", ")", ":", "if", "name", "==", "'NextRecordName'", ":", "self", ".", "next_record_name", "=", "value", "elif", "name", "==", "'NextRecordType'", ":", "self", ".", "next_record_typ...
Overwritten to also add the NextRecordName and NextRecordType to the base object
[ "Overwritten", "to", "also", "add", "the", "NextRecordName", "and", "NextRecordType", "to", "the", "base", "object" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/record.py#L82-L90
51,268
yyuu/botornado
boto/route53/record.py
Record.set_alias
def set_alias(self, alias_hosted_zone_id, alias_dns_name): """Make this an alias resource record set""" self.alias_hosted_zone_id = alias_hosted_zone_id self.alias_dns_name = alias_dns_name
python
def set_alias(self, alias_hosted_zone_id, alias_dns_name): """Make this an alias resource record set""" self.alias_hosted_zone_id = alias_hosted_zone_id self.alias_dns_name = alias_dns_name
[ "def", "set_alias", "(", "self", ",", "alias_hosted_zone_id", ",", "alias_dns_name", ")", ":", "self", ".", "alias_hosted_zone_id", "=", "alias_hosted_zone_id", "self", ".", "alias_dns_name", "=", "alias_dns_name" ]
Make this an alias resource record set
[ "Make", "this", "an", "alias", "resource", "record", "set" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/record.py#L156-L159
51,269
yyuu/botornado
boto/route53/record.py
Record.to_xml
def to_xml(self): """Spit this resource record set out as XML""" if self.alias_hosted_zone_id != None and self.alias_dns_name != None: # Use alias body = self.AliasBody % (self.alias_hosted_zone_id, self.alias_dns_name) else: # Use resource record(s) ...
python
def to_xml(self): """Spit this resource record set out as XML""" if self.alias_hosted_zone_id != None and self.alias_dns_name != None: # Use alias body = self.AliasBody % (self.alias_hosted_zone_id, self.alias_dns_name) else: # Use resource record(s) ...
[ "def", "to_xml", "(", "self", ")", ":", "if", "self", ".", "alias_hosted_zone_id", "!=", "None", "and", "self", ".", "alias_dns_name", "!=", "None", ":", "# Use alias", "body", "=", "self", ".", "AliasBody", "%", "(", "self", ".", "alias_hosted_zone_id", "...
Spit this resource record set out as XML
[ "Spit", "this", "resource", "record", "set", "out", "as", "XML" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/route53/record.py#L161-L185
51,270
yyuu/botornado
boto/dynamodb/table.py
Table.update_from_response
def update_from_response(self, response): """ Update the state of the Table object based on the response data received from Amazon DynamoDB. """ if 'Table' in response: self._dict.update(response['Table']) elif 'TableDescription' in response: self....
python
def update_from_response(self, response): """ Update the state of the Table object based on the response data received from Amazon DynamoDB. """ if 'Table' in response: self._dict.update(response['Table']) elif 'TableDescription' in response: self....
[ "def", "update_from_response", "(", "self", ",", "response", ")", ":", "if", "'Table'", "in", "response", ":", "self", ".", "_dict", ".", "update", "(", "response", "[", "'Table'", "]", ")", "elif", "'TableDescription'", "in", "response", ":", "self", ".",...
Update the state of the Table object based on the response data received from Amazon DynamoDB.
[ "Update", "the", "state", "of", "the", "Table", "object", "based", "on", "the", "response", "data", "received", "from", "Amazon", "DynamoDB", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/table.py#L92-L102
51,271
yyuu/botornado
boto/dynamodb/table.py
Table.refresh
def refresh(self, wait_for_active=False, retry_seconds=5): """ Refresh all of the fields of the Table object by calling the underlying DescribeTable request. :type wait_for_active: bool :param wait_for_active: If True, this command will not return until the table sta...
python
def refresh(self, wait_for_active=False, retry_seconds=5): """ Refresh all of the fields of the Table object by calling the underlying DescribeTable request. :type wait_for_active: bool :param wait_for_active: If True, this command will not return until the table sta...
[ "def", "refresh", "(", "self", ",", "wait_for_active", "=", "False", ",", "retry_seconds", "=", "5", ")", ":", "done", "=", "False", "while", "not", "done", ":", "response", "=", "self", ".", "layer2", ".", "describe_table", "(", "self", ".", "name", "...
Refresh all of the fields of the Table object by calling the underlying DescribeTable request. :type wait_for_active: bool :param wait_for_active: If True, this command will not return until the table status, as returned from Amazon DynamoDB, is 'ACTIVE'. :type ...
[ "Refresh", "all", "of", "the", "fields", "of", "the", "Table", "object", "by", "calling", "the", "underlying", "DescribeTable", "request", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/table.py#L104-L129
51,272
yyuu/botornado
boto/dynamodb/table.py
Table.new_item
def new_item(self, hash_key, range_key=None, attrs=None): """ Return an new, unsaved Item which can later be PUT to Amazon DynamoDB. """ return Item(self, hash_key, range_key, attrs)
python
def new_item(self, hash_key, range_key=None, attrs=None): """ Return an new, unsaved Item which can later be PUT to Amazon DynamoDB. """ return Item(self, hash_key, range_key, attrs)
[ "def", "new_item", "(", "self", ",", "hash_key", ",", "range_key", "=", "None", ",", "attrs", "=", "None", ")", ":", "return", "Item", "(", "self", ",", "hash_key", ",", "range_key", ",", "attrs", ")" ]
Return an new, unsaved Item which can later be PUT to Amazon DynamoDB.
[ "Return", "an", "new", "unsaved", "Item", "which", "can", "later", "be", "PUT", "to", "Amazon", "DynamoDB", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/table.py#L224-L229
51,273
yyuu/botornado
boto/dynamodb/table.py
Table.scan
def scan(self, scan_filter=None, attributes_to_get=None, request_limit=None, max_results=None, count=False, exclusive_start_key=None, item_class=Item): """ Scan through this table, this is a very long and expensive operation, and should be avoided if at all poss...
python
def scan(self, scan_filter=None, attributes_to_get=None, request_limit=None, max_results=None, count=False, exclusive_start_key=None, item_class=Item): """ Scan through this table, this is a very long and expensive operation, and should be avoided if at all poss...
[ "def", "scan", "(", "self", ",", "scan_filter", "=", "None", ",", "attributes_to_get", "=", "None", ",", "request_limit", "=", "None", ",", "max_results", "=", "None", ",", "count", "=", "False", ",", "exclusive_start_key", "=", "None", ",", "item_class", ...
Scan through this table, this is a very long and expensive operation, and should be avoided if at all possible. :type scan_filter: A list of tuples :param scan_filter: A list of tuples where each tuple consists of an attribute name, a comparison operator, and either ...
[ "Scan", "through", "this", "table", "this", "is", "a", "very", "long", "and", "expensive", "operation", "and", "should", "be", "avoided", "if", "at", "all", "possible", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/table.py#L302-L370
51,274
cordery/django-languages-plus
languages_plus/models.py
LanguageManager.get_by_code
def get_by_code(self, code): """ Retrieve a language by a code. :param code: iso code (any of the three) or its culture code :return: a Language object """ if any(x in code for x in ('_', '-')): cc = CultureCode.objects.get(code=code.replace('_', '-')) ...
python
def get_by_code(self, code): """ Retrieve a language by a code. :param code: iso code (any of the three) or its culture code :return: a Language object """ if any(x in code for x in ('_', '-')): cc = CultureCode.objects.get(code=code.replace('_', '-')) ...
[ "def", "get_by_code", "(", "self", ",", "code", ")", ":", "if", "any", "(", "x", "in", "code", "for", "x", "in", "(", "'_'", ",", "'-'", ")", ")", ":", "cc", "=", "CultureCode", ".", "objects", ".", "get", "(", "code", "=", "code", ".", "replac...
Retrieve a language by a code. :param code: iso code (any of the three) or its culture code :return: a Language object
[ "Retrieve", "a", "language", "by", "a", "code", "." ]
0ee6033643cf735739c7ed97223853bb75c08c02
https://github.com/cordery/django-languages-plus/blob/0ee6033643cf735739c7ed97223853bb75c08c02/languages_plus/models.py#L17-L37
51,275
cablehead/vanilla
vanilla/core.py
Hub.state
def state(self, state=vanilla.message.NoState): """ Returns a `State`_ `Pair`_. *state* if supplied sets the intial state. """ return vanilla.message.State(self, state=state)
python
def state(self, state=vanilla.message.NoState): """ Returns a `State`_ `Pair`_. *state* if supplied sets the intial state. """ return vanilla.message.State(self, state=state)
[ "def", "state", "(", "self", ",", "state", "=", "vanilla", ".", "message", ".", "NoState", ")", ":", "return", "vanilla", ".", "message", ".", "State", "(", "self", ",", "state", "=", "state", ")" ]
Returns a `State`_ `Pair`_. *state* if supplied sets the intial state.
[ "Returns", "a", "State", "_", "Pair", "_", "." ]
c9f5b86f45720a30e8840fb68b1429b919c4ca66
https://github.com/cablehead/vanilla/blob/c9f5b86f45720a30e8840fb68b1429b919c4ca66/vanilla/core.py#L243-L249
51,276
yyuu/botornado
boto/mashups/server.py
Server.Inventory
def Inventory(cls): """ Returns a list of Server instances, one for each Server object persisted in the db """ l = ServerSet() rs = cls.find() for server in rs: l.append(server) return l
python
def Inventory(cls): """ Returns a list of Server instances, one for each Server object persisted in the db """ l = ServerSet() rs = cls.find() for server in rs: l.append(server) return l
[ "def", "Inventory", "(", "cls", ")", ":", "l", "=", "ServerSet", "(", ")", "rs", "=", "cls", ".", "find", "(", ")", "for", "server", "in", "rs", ":", "l", ".", "append", "(", "server", ")", "return", "l" ]
Returns a list of Server instances, one for each Server object persisted in the db
[ "Returns", "a", "list", "of", "Server", "instances", "one", "for", "each", "Server", "object", "persisted", "in", "the", "db" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/mashups/server.py#L69-L78
51,277
yyuu/botornado
boto/mashups/server.py
Server.set_config
def set_config(self, config): """ Set SDB based config """ self._config = config self._config.dump_to_sdb("botoConfigs", self.id)
python
def set_config(self, config): """ Set SDB based config """ self._config = config self._config.dump_to_sdb("botoConfigs", self.id)
[ "def", "set_config", "(", "self", ",", "config", ")", ":", "self", ".", "_config", "=", "config", "self", ".", "_config", ".", "dump_to_sdb", "(", "\"botoConfigs\"", ",", "self", ".", "id", ")" ]
Set SDB based config
[ "Set", "SDB", "based", "config" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/mashups/server.py#L197-L202
51,278
yyuu/botornado
boto/mashups/server.py
Server.attach_volume
def attach_volume(self, volume, device="/dev/sdp"): """ Attach an EBS volume to this server :param volume: EBS Volume to attach :type volume: boto.ec2.volume.Volume :param device: Device to attach to (default to /dev/sdp) :type device: string """ if hasa...
python
def attach_volume(self, volume, device="/dev/sdp"): """ Attach an EBS volume to this server :param volume: EBS Volume to attach :type volume: boto.ec2.volume.Volume :param device: Device to attach to (default to /dev/sdp) :type device: string """ if hasa...
[ "def", "attach_volume", "(", "self", ",", "volume", ",", "device", "=", "\"/dev/sdp\"", ")", ":", "if", "hasattr", "(", "volume", ",", "\"id\"", ")", ":", "volume_id", "=", "volume", ".", "id", "else", ":", "volume_id", "=", "volume", "return", "self", ...
Attach an EBS volume to this server :param volume: EBS Volume to attach :type volume: boto.ec2.volume.Volume :param device: Device to attach to (default to /dev/sdp) :type device: string
[ "Attach", "an", "EBS", "volume", "to", "this", "server" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/mashups/server.py#L357-L371
51,279
yyuu/botornado
boto/mashups/server.py
Server.detach_volume
def detach_volume(self, volume): """ Detach an EBS volume from this server :param volume: EBS Volume to detach :type volume: boto.ec2.volume.Volume """ if hasattr(volume, "id"): volume_id = volume.id else: volume_id = volume return...
python
def detach_volume(self, volume): """ Detach an EBS volume from this server :param volume: EBS Volume to detach :type volume: boto.ec2.volume.Volume """ if hasattr(volume, "id"): volume_id = volume.id else: volume_id = volume return...
[ "def", "detach_volume", "(", "self", ",", "volume", ")", ":", "if", "hasattr", "(", "volume", ",", "\"id\"", ")", ":", "volume_id", "=", "volume", ".", "id", "else", ":", "volume_id", "=", "volume", "return", "self", ".", "ec2", ".", "detach_volume", "...
Detach an EBS volume from this server :param volume: EBS Volume to detach :type volume: boto.ec2.volume.Volume
[ "Detach", "an", "EBS", "volume", "from", "this", "server" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/mashups/server.py#L373-L384
51,280
yyuu/botornado
boto/gs/resumable_upload_handler.py
ResumableUploadHandler._save_tracker_uri_to_file
def _save_tracker_uri_to_file(self): """ Saves URI to tracker file if one was passed to constructor. """ if not self.tracker_file_name: return f = None try: f = open(self.tracker_file_name, 'w') f.write(self.tracker_uri) except ...
python
def _save_tracker_uri_to_file(self): """ Saves URI to tracker file if one was passed to constructor. """ if not self.tracker_file_name: return f = None try: f = open(self.tracker_file_name, 'w') f.write(self.tracker_uri) except ...
[ "def", "_save_tracker_uri_to_file", "(", "self", ")", ":", "if", "not", "self", ".", "tracker_file_name", ":", "return", "f", "=", "None", "try", ":", "f", "=", "open", "(", "self", ".", "tracker_file_name", ",", "'w'", ")", "f", ".", "write", "(", "se...
Saves URI to tracker file if one was passed to constructor.
[ "Saves", "URI", "to", "tracker", "file", "if", "one", "was", "passed", "to", "constructor", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/resumable_upload_handler.py#L116-L136
51,281
yyuu/botornado
boto/gs/resumable_upload_handler.py
ResumableUploadHandler._set_tracker_uri
def _set_tracker_uri(self, uri): """ Called when we start a new resumable upload or get a new tracker URI for the upload. Saves URI and resets upload state. Raises InvalidUriError if URI is syntactically invalid. """ parse_result = urlparse.urlparse(uri) if (pars...
python
def _set_tracker_uri(self, uri): """ Called when we start a new resumable upload or get a new tracker URI for the upload. Saves URI and resets upload state. Raises InvalidUriError if URI is syntactically invalid. """ parse_result = urlparse.urlparse(uri) if (pars...
[ "def", "_set_tracker_uri", "(", "self", ",", "uri", ")", ":", "parse_result", "=", "urlparse", ".", "urlparse", "(", "uri", ")", "if", "(", "parse_result", ".", "scheme", ".", "lower", "(", ")", "not", "in", "[", "'http'", ",", "'https'", "]", "or", ...
Called when we start a new resumable upload or get a new tracker URI for the upload. Saves URI and resets upload state. Raises InvalidUriError if URI is syntactically invalid.
[ "Called", "when", "we", "start", "a", "new", "resumable", "upload", "or", "get", "a", "new", "tracker", "URI", "for", "the", "upload", ".", "Saves", "URI", "and", "resets", "upload", "state", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/resumable_upload_handler.py#L138-L156
51,282
yyuu/botornado
boto/gs/resumable_upload_handler.py
ResumableUploadHandler._query_server_state
def _query_server_state(self, conn, file_length): """ Queries server to find out state of given upload. Note that this method really just makes special case use of the fact that the upload server always returns the current start/end state whenever a PUT doesn't complete. ...
python
def _query_server_state(self, conn, file_length): """ Queries server to find out state of given upload. Note that this method really just makes special case use of the fact that the upload server always returns the current start/end state whenever a PUT doesn't complete. ...
[ "def", "_query_server_state", "(", "self", ",", "conn", ",", "file_length", ")", ":", "# Send an empty PUT so that server replies with this resumable", "# transfer's state.", "put_headers", "=", "{", "}", "put_headers", "[", "'Content-Range'", "]", "=", "(", "self", "."...
Queries server to find out state of given upload. Note that this method really just makes special case use of the fact that the upload server always returns the current start/end state whenever a PUT doesn't complete. Returns HTTP response from sending request. Raises Resumabl...
[ "Queries", "server", "to", "find", "out", "state", "of", "given", "upload", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/resumable_upload_handler.py#L172-L194
51,283
yyuu/botornado
boto/gs/resumable_upload_handler.py
ResumableUploadHandler._query_server_pos
def _query_server_pos(self, conn, file_length): """ Queries server to find out what bytes it currently has. Returns (server_start, server_end), where the values are inclusive. For example, (0, 2) would mean that the server has bytes 0, 1, *and* 2. Raises ResumableUploadExceptio...
python
def _query_server_pos(self, conn, file_length): """ Queries server to find out what bytes it currently has. Returns (server_start, server_end), where the values are inclusive. For example, (0, 2) would mean that the server has bytes 0, 1, *and* 2. Raises ResumableUploadExceptio...
[ "def", "_query_server_pos", "(", "self", ",", "conn", ",", "file_length", ")", ":", "resp", "=", "self", ".", "_query_server_state", "(", "conn", ",", "file_length", ")", "if", "resp", ".", "status", "==", "200", ":", "return", "(", "0", ",", "file_lengt...
Queries server to find out what bytes it currently has. Returns (server_start, server_end), where the values are inclusive. For example, (0, 2) would mean that the server has bytes 0, 1, *and* 2. Raises ResumableUploadException if problem querying server.
[ "Queries", "server", "to", "find", "out", "what", "bytes", "it", "currently", "has", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/resumable_upload_handler.py#L196-L240
51,284
yyuu/botornado
boto/gs/resumable_upload_handler.py
ResumableUploadHandler._start_new_resumable_upload
def _start_new_resumable_upload(self, key, headers=None): """ Starts a new resumable upload. Raises ResumableUploadException if any errors occur. """ conn = key.bucket.connection if conn.debug >= 1: print 'Starting new resumable upload.' self.server_h...
python
def _start_new_resumable_upload(self, key, headers=None): """ Starts a new resumable upload. Raises ResumableUploadException if any errors occur. """ conn = key.bucket.connection if conn.debug >= 1: print 'Starting new resumable upload.' self.server_h...
[ "def", "_start_new_resumable_upload", "(", "self", ",", "key", ",", "headers", "=", "None", ")", ":", "conn", "=", "key", ".", "bucket", ".", "connection", "if", "conn", ".", "debug", ">=", "1", ":", "print", "'Starting new resumable upload.'", "self", ".", ...
Starts a new resumable upload. Raises ResumableUploadException if any errors occur.
[ "Starts", "a", "new", "resumable", "upload", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/resumable_upload_handler.py#L242-L298
51,285
yyuu/botornado
boto/gs/resumable_upload_handler.py
ResumableUploadHandler._upload_file_bytes
def _upload_file_bytes(self, conn, http_conn, fp, file_length, total_bytes_uploaded, cb, num_cb): """ Makes one attempt to upload file bytes, using an existing resumable upload connection. Returns etag from server upon success. Raises ResumableUploadE...
python
def _upload_file_bytes(self, conn, http_conn, fp, file_length, total_bytes_uploaded, cb, num_cb): """ Makes one attempt to upload file bytes, using an existing resumable upload connection. Returns etag from server upon success. Raises ResumableUploadE...
[ "def", "_upload_file_bytes", "(", "self", ",", "conn", ",", "http_conn", ",", "fp", ",", "file_length", ",", "total_bytes_uploaded", ",", "cb", ",", "num_cb", ")", ":", "buf", "=", "fp", ".", "read", "(", "self", ".", "BUFFER_SIZE", ")", "if", "cb", ":...
Makes one attempt to upload file bytes, using an existing resumable upload connection. Returns etag from server upon success. Raises ResumableUploadException if any problems occur.
[ "Makes", "one", "attempt", "to", "upload", "file", "bytes", "using", "an", "existing", "resumable", "upload", "connection", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/resumable_upload_handler.py#L300-L378
51,286
yyuu/botornado
boto/gs/resumable_upload_handler.py
ResumableUploadHandler._attempt_resumable_upload
def _attempt_resumable_upload(self, key, fp, file_length, headers, cb, num_cb): """ Attempts a resumable upload. Returns etag from server upon success. Raises ResumableUploadException if any problems occur. """ (server_start, server_end...
python
def _attempt_resumable_upload(self, key, fp, file_length, headers, cb, num_cb): """ Attempts a resumable upload. Returns etag from server upon success. Raises ResumableUploadException if any problems occur. """ (server_start, server_end...
[ "def", "_attempt_resumable_upload", "(", "self", ",", "key", ",", "fp", ",", "file_length", ",", "headers", ",", "cb", ",", "num_cb", ")", ":", "(", "server_start", ",", "server_end", ")", "=", "self", ".", "SERVER_HAS_NOTHING", "conn", "=", "key", ".", ...
Attempts a resumable upload. Returns etag from server upon success. Raises ResumableUploadException if any problems occur.
[ "Attempts", "a", "resumable", "upload", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/resumable_upload_handler.py#L380-L453
51,287
yyuu/botornado
boto/cloudfront/distribution.py
Distribution.set_permissions
def set_permissions(self, object, replace=False): """ Sets the S3 ACL grants for the given object to the appropriate value based on the type of Distribution. If the Distribution is serving private content the ACL will be set to include the Origin Access Identity associated with ...
python
def set_permissions(self, object, replace=False): """ Sets the S3 ACL grants for the given object to the appropriate value based on the type of Distribution. If the Distribution is serving private content the ACL will be set to include the Origin Access Identity associated with ...
[ "def", "set_permissions", "(", "self", ",", "object", ",", "replace", "=", "False", ")", ":", "if", "isinstance", "(", "self", ".", "config", ".", "origin", ",", "S3Origin", ")", ":", "if", "self", ".", "config", ".", "origin", ".", "origin_access_identi...
Sets the S3 ACL grants for the given object to the appropriate value based on the type of Distribution. If the Distribution is serving private content the ACL will be set to include the Origin Access Identity associated with the Distribution. If the Distribution is serving public conte...
[ "Sets", "the", "S3", "ACL", "grants", "for", "the", "given", "object", "to", "the", "appropriate", "value", "based", "on", "the", "type", "of", "Distribution", ".", "If", "the", "Distribution", "is", "serving", "private", "content", "the", "ACL", "will", "...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L416-L446
51,288
yyuu/botornado
boto/cloudfront/distribution.py
Distribution.set_permissions_all
def set_permissions_all(self, replace=False): """ Sets the S3 ACL grants for all objects in the Distribution to the appropriate value based on the type of Distribution. :type replace: bool :param replace: If False, the Origin Access Identity will be appen...
python
def set_permissions_all(self, replace=False): """ Sets the S3 ACL grants for all objects in the Distribution to the appropriate value based on the type of Distribution. :type replace: bool :param replace: If False, the Origin Access Identity will be appen...
[ "def", "set_permissions_all", "(", "self", ",", "replace", "=", "False", ")", ":", "bucket", "=", "self", ".", "_get_bucket", "(", ")", "for", "key", "in", "bucket", ":", "self", ".", "set_permissions", "(", "key", ",", "replace", ")" ]
Sets the S3 ACL grants for all objects in the Distribution to the appropriate value based on the type of Distribution. :type replace: bool :param replace: If False, the Origin Access Identity will be appended to the existing ACL for the object. If...
[ "Sets", "the", "S3", "ACL", "grants", "for", "all", "objects", "in", "the", "Distribution", "to", "the", "appropriate", "value", "based", "on", "the", "type", "of", "Distribution", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L448-L463
51,289
yyuu/botornado
boto/cloudfront/distribution.py
Distribution.add_object
def add_object(self, name, content, headers=None, replace=True): """ Adds a new content object to the Distribution. The content for the object will be copied to a new Key in the S3 Bucket and the permissions will be set appropriately for the type of Distribution. :type ...
python
def add_object(self, name, content, headers=None, replace=True): """ Adds a new content object to the Distribution. The content for the object will be copied to a new Key in the S3 Bucket and the permissions will be set appropriately for the type of Distribution. :type ...
[ "def", "add_object", "(", "self", ",", "name", ",", "content", ",", "headers", "=", "None", ",", "replace", "=", "True", ")", ":", "if", "self", ".", "config", ".", "origin", ".", "origin_access_identity", ":", "policy", "=", "'private'", "else", ":", ...
Adds a new content object to the Distribution. The content for the object will be copied to a new Key in the S3 Bucket and the permissions will be set appropriately for the type of Distribution. :type name: str or unicode :param name: The name or key of the new object. ...
[ "Adds", "a", "new", "content", "object", "to", "the", "Distribution", ".", "The", "content", "for", "the", "object", "will", "be", "copied", "to", "a", "new", "Key", "in", "the", "S3", "Bucket", "and", "the", "permissions", "will", "be", "set", "appropri...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L465-L496
51,290
yyuu/botornado
boto/cloudfront/distribution.py
Distribution.create_signed_url
def create_signed_url(self, url, keypair_id, expire_time=None, valid_after_time=None, ip_address=None, policy_url=None, private_key_file=None, private_key_string=None): """ Creates a signed CloudFront URL that is only valid wi...
python
def create_signed_url(self, url, keypair_id, expire_time=None, valid_after_time=None, ip_address=None, policy_url=None, private_key_file=None, private_key_string=None): """ Creates a signed CloudFront URL that is only valid wi...
[ "def", "create_signed_url", "(", "self", ",", "url", ",", "keypair_id", ",", "expire_time", "=", "None", ",", "valid_after_time", "=", "None", ",", "ip_address", "=", "None", ",", "policy_url", "=", "None", ",", "private_key_file", "=", "None", ",", "private...
Creates a signed CloudFront URL that is only valid within the specified parameters. :type url: str :param url: The URL of the protected object. :type keypair_id: str :param keypair_id: The keypair ID of the Amazon KeyPair used to sign theURL. This ID MUST correspon...
[ "Creates", "a", "signed", "CloudFront", "URL", "that", "is", "only", "valid", "within", "the", "specified", "parameters", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L498-L571
51,291
yyuu/botornado
boto/cloudfront/distribution.py
Distribution._create_signing_params
def _create_signing_params(self, url, keypair_id, expire_time=None, valid_after_time=None, ip_address=None, policy_url=None, private_key_file=None, private_key_string=None): """ Creates the required URL parameters for a signed...
python
def _create_signing_params(self, url, keypair_id, expire_time=None, valid_after_time=None, ip_address=None, policy_url=None, private_key_file=None, private_key_string=None): """ Creates the required URL parameters for a signed...
[ "def", "_create_signing_params", "(", "self", ",", "url", ",", "keypair_id", ",", "expire_time", "=", "None", ",", "valid_after_time", "=", "None", ",", "ip_address", "=", "None", ",", "policy_url", "=", "None", ",", "private_key_file", "=", "None", ",", "pr...
Creates the required URL parameters for a signed URL.
[ "Creates", "the", "required", "URL", "parameters", "for", "a", "signed", "URL", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L573-L604
51,292
yyuu/botornado
boto/cloudfront/distribution.py
Distribution._custom_policy
def _custom_policy(resource, expires=None, valid_after=None, ip_address=None): """ Creates a custom policy string based on the supplied parameters. """ condition = {} if expires: condition["DateLessThan"] = {"AWS:EpochTime": expires} if valid_after: ...
python
def _custom_policy(resource, expires=None, valid_after=None, ip_address=None): """ Creates a custom policy string based on the supplied parameters. """ condition = {} if expires: condition["DateLessThan"] = {"AWS:EpochTime": expires} if valid_after: ...
[ "def", "_custom_policy", "(", "resource", ",", "expires", "=", "None", ",", "valid_after", "=", "None", ",", "ip_address", "=", "None", ")", ":", "condition", "=", "{", "}", "if", "expires", ":", "condition", "[", "\"DateLessThan\"", "]", "=", "{", "\"AW...
Creates a custom policy string based on the supplied parameters.
[ "Creates", "a", "custom", "policy", "string", "based", "on", "the", "supplied", "parameters", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L617-L633
51,293
yyuu/botornado
boto/cloudfront/distribution.py
Distribution._sign_string
def _sign_string(message, private_key_file=None, private_key_string=None): """ Signs a string for use with Amazon CloudFront. Requires the M2Crypto library be installed. """ try: from M2Crypto import EVP except ImportError: raise NotImplementedErr...
python
def _sign_string(message, private_key_file=None, private_key_string=None): """ Signs a string for use with Amazon CloudFront. Requires the M2Crypto library be installed. """ try: from M2Crypto import EVP except ImportError: raise NotImplementedErr...
[ "def", "_sign_string", "(", "message", ",", "private_key_file", "=", "None", ",", "private_key_string", "=", "None", ")", ":", "try", ":", "from", "M2Crypto", "import", "EVP", "except", "ImportError", ":", "raise", "NotImplementedError", "(", "\"Boto depends on th...
Signs a string for use with Amazon CloudFront. Requires the M2Crypto library be installed.
[ "Signs", "a", "string", "for", "use", "with", "Amazon", "CloudFront", ".", "Requires", "the", "M2Crypto", "library", "be", "installed", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L636-L664
51,294
yyuu/botornado
boto/cloudfront/distribution.py
Distribution._url_base64_encode
def _url_base64_encode(msg): """ Base64 encodes a string using the URL-safe characters specified by Amazon. """ msg_base64 = base64.b64encode(msg) msg_base64 = msg_base64.replace('+', '-') msg_base64 = msg_base64.replace('=', '_') msg_base64 = msg_base64.r...
python
def _url_base64_encode(msg): """ Base64 encodes a string using the URL-safe characters specified by Amazon. """ msg_base64 = base64.b64encode(msg) msg_base64 = msg_base64.replace('+', '-') msg_base64 = msg_base64.replace('=', '_') msg_base64 = msg_base64.r...
[ "def", "_url_base64_encode", "(", "msg", ")", ":", "msg_base64", "=", "base64", ".", "b64encode", "(", "msg", ")", "msg_base64", "=", "msg_base64", ".", "replace", "(", "'+'", ",", "'-'", ")", "msg_base64", "=", "msg_base64", ".", "replace", "(", "'='", ...
Base64 encodes a string using the URL-safe characters specified by Amazon.
[ "Base64", "encodes", "a", "string", "using", "the", "URL", "-", "safe", "characters", "specified", "by", "Amazon", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/distribution.py#L667-L676
51,295
carljm/django-adminfiles
adminfiles/listeners.py
_update_content
def _update_content(sender, instance, created=None, **kwargs): """ Re-save any content models referencing the just-modified ``FileUpload``. We don't do anything special to the content model, we just re-save it. If signals are in use, we assume that the content model has incorporated ``render_up...
python
def _update_content(sender, instance, created=None, **kwargs): """ Re-save any content models referencing the just-modified ``FileUpload``. We don't do anything special to the content model, we just re-save it. If signals are in use, we assume that the content model has incorporated ``render_up...
[ "def", "_update_content", "(", "sender", ",", "instance", ",", "created", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "created", ":", "# a brand new FileUpload won't be referenced", "return", "for", "ref", "in", "FileUploadReference", ".", "objects", "...
Re-save any content models referencing the just-modified ``FileUpload``. We don't do anything special to the content model, we just re-save it. If signals are in use, we assume that the content model has incorporated ``render_uploads`` into some kind of rendering that happens automatically at save-...
[ "Re", "-", "save", "any", "content", "models", "referencing", "the", "just", "-", "modified", "FileUpload", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/listeners.py#L50-L69
51,296
yyuu/botornado
boto/ec2/connection.py
EC2Connection.get_params
def get_params(self): """ Returns a dictionary containing the value of of all of the keyword arguments passed when constructing this connection. """ param_names = ['aws_access_key_id', 'aws_secret_access_key', 'is_secure', 'port', 'proxy', 'proxy_port', ...
python
def get_params(self): """ Returns a dictionary containing the value of of all of the keyword arguments passed when constructing this connection. """ param_names = ['aws_access_key_id', 'aws_secret_access_key', 'is_secure', 'port', 'proxy', 'proxy_port', ...
[ "def", "get_params", "(", "self", ")", ":", "param_names", "=", "[", "'aws_access_key_id'", ",", "'aws_secret_access_key'", ",", "'is_secure'", ",", "'port'", ",", "'proxy'", ",", "'proxy_port'", ",", "'proxy_user'", ",", "'proxy_pass'", ",", "'debug'", ",", "'h...
Returns a dictionary containing the value of of all of the keyword arguments passed when constructing this connection.
[ "Returns", "a", "dictionary", "containing", "the", "value", "of", "of", "all", "of", "the", "keyword", "arguments", "passed", "when", "constructing", "this", "connection", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/connection.py#L94-L106
51,297
yyuu/botornado
boto/ec2/connection.py
EC2Connection.get_all_images
def get_all_images(self, image_ids=None, owners=None, executable_by=None, filters=None): """ Retrieve all the EC2 images available on your account. :type image_ids: list :param image_ids: A list of strings with the image IDs wanted :type owners: list ...
python
def get_all_images(self, image_ids=None, owners=None, executable_by=None, filters=None): """ Retrieve all the EC2 images available on your account. :type image_ids: list :param image_ids: A list of strings with the image IDs wanted :type owners: list ...
[ "def", "get_all_images", "(", "self", ",", "image_ids", "=", "None", ",", "owners", "=", "None", ",", "executable_by", "=", "None", ",", "filters", "=", "None", ")", ":", "params", "=", "{", "}", "if", "image_ids", ":", "self", ".", "build_list_params", ...
Retrieve all the EC2 images available on your account. :type image_ids: list :param image_ids: A list of strings with the image IDs wanted :type owners: list :param owners: A list of owner IDs :type executable_by: list :param executable_by: Returns AMIs for which the s...
[ "Retrieve", "all", "the", "EC2", "images", "available", "on", "your", "account", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/connection.py#L126-L164
51,298
yyuu/botornado
boto/ec2/connection.py
EC2Connection.get_all_kernels
def get_all_kernels(self, kernel_ids=None, owners=None): """ Retrieve all the EC2 kernels available on your account. Constructs a filter to allow the processing to happen server side. :type kernel_ids: list :param kernel_ids: A list of strings with the image IDs wanted ...
python
def get_all_kernels(self, kernel_ids=None, owners=None): """ Retrieve all the EC2 kernels available on your account. Constructs a filter to allow the processing to happen server side. :type kernel_ids: list :param kernel_ids: A list of strings with the image IDs wanted ...
[ "def", "get_all_kernels", "(", "self", ",", "kernel_ids", "=", "None", ",", "owners", "=", "None", ")", ":", "params", "=", "{", "}", "if", "kernel_ids", ":", "self", ".", "build_list_params", "(", "params", ",", "kernel_ids", ",", "'ImageId'", ")", "if"...
Retrieve all the EC2 kernels available on your account. Constructs a filter to allow the processing to happen server side. :type kernel_ids: list :param kernel_ids: A list of strings with the image IDs wanted :type owners: list :param owners: A list of owner IDs :rtype...
[ "Retrieve", "all", "the", "EC2", "kernels", "available", "on", "your", "account", ".", "Constructs", "a", "filter", "to", "allow", "the", "processing", "to", "happen", "server", "side", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/connection.py#L166-L188
51,299
yyuu/botornado
boto/ec2/connection.py
EC2Connection.get_all_ramdisks
def get_all_ramdisks(self, ramdisk_ids=None, owners=None): """ Retrieve all the EC2 ramdisks available on your account. Constructs a filter to allow the processing to happen server side. :type ramdisk_ids: list :param ramdisk_ids: A list of strings with the image IDs wanted ...
python
def get_all_ramdisks(self, ramdisk_ids=None, owners=None): """ Retrieve all the EC2 ramdisks available on your account. Constructs a filter to allow the processing to happen server side. :type ramdisk_ids: list :param ramdisk_ids: A list of strings with the image IDs wanted ...
[ "def", "get_all_ramdisks", "(", "self", ",", "ramdisk_ids", "=", "None", ",", "owners", "=", "None", ")", ":", "params", "=", "{", "}", "if", "ramdisk_ids", ":", "self", ".", "build_list_params", "(", "params", ",", "ramdisk_ids", ",", "'ImageId'", ")", ...
Retrieve all the EC2 ramdisks available on your account. Constructs a filter to allow the processing to happen server side. :type ramdisk_ids: list :param ramdisk_ids: A list of strings with the image IDs wanted :type owners: list :param owners: A list of owner IDs :rt...
[ "Retrieve", "all", "the", "EC2", "ramdisks", "available", "on", "your", "account", ".", "Constructs", "a", "filter", "to", "allow", "the", "processing", "to", "happen", "server", "side", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/connection.py#L190-L212