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,100
carljm/django-adminfiles
adminfiles/views.py
BaseView.slug
def slug(cls): """ Return slug suitable for accessing this view in a URLconf. """ slug = cls.__name__.lower() if slug.endswith('view'): slug = slug[:-4] return slug
python
def slug(cls): """ Return slug suitable for accessing this view in a URLconf. """ slug = cls.__name__.lower() if slug.endswith('view'): slug = slug[:-4] return slug
[ "def", "slug", "(", "cls", ")", ":", "slug", "=", "cls", ".", "__name__", ".", "lower", "(", ")", "if", "slug", ".", "endswith", "(", "'view'", ")", ":", "slug", "=", "slug", "[", ":", "-", "4", "]", "return", "slug" ]
Return slug suitable for accessing this view in a URLconf.
[ "Return", "slug", "suitable", "for", "accessing", "this", "view", "in", "a", "URLconf", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/views.py#L32-L40
51,101
carljm/django-adminfiles
adminfiles/views.py
BaseView.link_text
def link_text(cls): """ Return link text for this view. """ link = cls.__name__ if link.endswith('View'): link = link[:-4] return link
python
def link_text(cls): """ Return link text for this view. """ link = cls.__name__ if link.endswith('View'): link = link[:-4] return link
[ "def", "link_text", "(", "cls", ")", ":", "link", "=", "cls", ".", "__name__", "if", "link", ".", "endswith", "(", "'View'", ")", ":", "link", "=", "link", "[", ":", "-", "4", "]", "return", "link" ]
Return link text for this view.
[ "Return", "link", "text", "for", "this", "view", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/views.py#L43-L51
51,102
yyuu/botornado
boto/dynamodb/item.py
Item.save
def save(self, expected_value=None, return_values=None): """ Commits pending updates to Amazon DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the na...
python
def save(self, expected_value=None, return_values=None): """ Commits pending updates to Amazon DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the na...
[ "def", "save", "(", "self", ",", "expected_value", "=", "None", ",", "return_values", "=", "None", ")", ":", "return", "self", ".", "table", ".", "layer2", ".", "update_item", "(", "self", ",", "expected_value", ",", "return_values", ")" ]
Commits pending updates to Amazon DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the name is the name of the attribute and the value is either the value...
[ "Commits", "pending", "updates", "to", "Amazon", "DynamoDB", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/item.py#L109-L131
51,103
yyuu/botornado
boto/dynamodb/item.py
Item.delete
def delete(self, expected_value=None, return_values=None): """ Delete the item from DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the name is the na...
python
def delete(self, expected_value=None, return_values=None): """ Delete the item from DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the name is the na...
[ "def", "delete", "(", "self", ",", "expected_value", "=", "None", ",", "return_values", "=", "None", ")", ":", "return", "self", ".", "table", ".", "layer2", ".", "delete_item", "(", "self", ",", "expected_value", ",", "return_values", ")" ]
Delete the item from DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have name/value pairs where the name is the name of the attribute and the value is either the value you are expec...
[ "Delete", "the", "item", "from", "DynamoDB", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/item.py#L133-L152
51,104
yyuu/botornado
boto/__init__.py
connect_ec2_endpoint
def connect_ec2_endpoint(url, aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ Connect to an EC2 Api endpoint. Additional arguments are passed through to connect_ec2. :type url: string :param url: A url for the ec2 api endpoint to connect to :type a...
python
def connect_ec2_endpoint(url, aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ Connect to an EC2 Api endpoint. Additional arguments are passed through to connect_ec2. :type url: string :param url: A url for the ec2 api endpoint to connect to :type a...
[ "def", "connect_ec2_endpoint", "(", "url", ",", "aws_access_key_id", "=", "None", ",", "aws_secret_access_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", "from", "boto", ".", "ec2", ".", "regioninfo", "import", "RegionInfo", "purl", "=", "urlparse", "....
Connect to an EC2 Api endpoint. Additional arguments are passed through to connect_ec2. :type url: string :param url: A url for the ec2 api endpoint to connect to :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param a...
[ "Connect", "to", "an", "EC2", "Api", "endpoint", ".", "Additional", "arguments", "are", "passed", "through", "to", "connect_ec2", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/__init__.py#L373-L405
51,105
yyuu/botornado
boto/__init__.py
connect_walrus
def connect_walrus(host=None, aws_access_key_id=None, aws_secret_access_key=None, port=8773, path='/services/Walrus', is_secure=False, **kwargs): """ Connect to a Walrus service. :type host: string :param host: the host name or ip address of the Walrus server ...
python
def connect_walrus(host=None, aws_access_key_id=None, aws_secret_access_key=None, port=8773, path='/services/Walrus', is_secure=False, **kwargs): """ Connect to a Walrus service. :type host: string :param host: the host name or ip address of the Walrus server ...
[ "def", "connect_walrus", "(", "host", "=", "None", ",", "aws_access_key_id", "=", "None", ",", "aws_secret_access_key", "=", "None", ",", "port", "=", "8773", ",", "path", "=", "'/services/Walrus'", ",", "is_secure", "=", "False", ",", "*", "*", "kwargs", ...
Connect to a Walrus service. :type host: string :param host: the host name or ip address of the Walrus server :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rty...
[ "Connect", "to", "a", "Walrus", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/__init__.py#L407-L443
51,106
yyuu/botornado
boto/__init__.py
connect_ia
def connect_ia(ia_access_key_id=None, ia_secret_access_key=None, is_secure=False, **kwargs): """ Connect to the Internet Archive via their S3-like API. :type ia_access_key_id: string :param ia_access_key_id: Your IA Access Key ID. This will also look in your ...
python
def connect_ia(ia_access_key_id=None, ia_secret_access_key=None, is_secure=False, **kwargs): """ Connect to the Internet Archive via their S3-like API. :type ia_access_key_id: string :param ia_access_key_id: Your IA Access Key ID. This will also look in your ...
[ "def", "connect_ia", "(", "ia_access_key_id", "=", "None", ",", "ia_secret_access_key", "=", "None", ",", "is_secure", "=", "False", ",", "*", "*", "kwargs", ")", ":", "from", "boto", ".", "s3", ".", "connection", "import", "S3Connection", "from", "boto", ...
Connect to the Internet Archive via their S3-like API. :type ia_access_key_id: string :param ia_access_key_id: Your IA Access Key ID. This will also look in your boto config file for an entry in the Credentials section called "ia_access_key_id" :t...
[ "Connect", "to", "the", "Internet", "Archive", "via", "their", "S3", "-", "like", "API", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/__init__.py#L473-L503
51,107
yyuu/botornado
boto/__init__.py
storage_uri
def storage_uri(uri_str, default_scheme='file', debug=0, validate=True, bucket_storage_uri_class=BucketStorageUri, suppress_consec_slashes=True): """ Instantiate a StorageUri from a URI string. :type uri_str: string :param uri_str: URI naming bucket + optional object. ...
python
def storage_uri(uri_str, default_scheme='file', debug=0, validate=True, bucket_storage_uri_class=BucketStorageUri, suppress_consec_slashes=True): """ Instantiate a StorageUri from a URI string. :type uri_str: string :param uri_str: URI naming bucket + optional object. ...
[ "def", "storage_uri", "(", "uri_str", ",", "default_scheme", "=", "'file'", ",", "debug", "=", "0", ",", "validate", "=", "True", ",", "bucket_storage_uri_class", "=", "BucketStorageUri", ",", "suppress_consec_slashes", "=", "True", ")", ":", "# Manually parse URI...
Instantiate a StorageUri from a URI string. :type uri_str: string :param uri_str: URI naming bucket + optional object. :type default_scheme: string :param default_scheme: default scheme for scheme-less URIs. :type debug: int :param debug: debug level to pass in to boto connection (range 0..2). ...
[ "Instantiate", "a", "StorageUri", "from", "a", "URI", "string", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/__init__.py#L558-L639
51,108
yyuu/botornado
boto/__init__.py
storage_uri_for_key
def storage_uri_for_key(key): """Returns a StorageUri for the given key. :type key: :class:`boto.s3.key.Key` or subclass :param key: URI naming bucket + optional object. """ if not isinstance(key, boto.s3.key.Key): raise InvalidUriError('Requested key (%s) is not a subclass of ' ...
python
def storage_uri_for_key(key): """Returns a StorageUri for the given key. :type key: :class:`boto.s3.key.Key` or subclass :param key: URI naming bucket + optional object. """ if not isinstance(key, boto.s3.key.Key): raise InvalidUriError('Requested key (%s) is not a subclass of ' ...
[ "def", "storage_uri_for_key", "(", "key", ")", ":", "if", "not", "isinstance", "(", "key", ",", "boto", ".", "s3", ".", "key", ".", "Key", ")", ":", "raise", "InvalidUriError", "(", "'Requested key (%s) is not a subclass of '", "'boto.s3.key.Key'", "%", "str", ...
Returns a StorageUri for the given key. :type key: :class:`boto.s3.key.Key` or subclass :param key: URI naming bucket + optional object.
[ "Returns", "a", "StorageUri", "for", "the", "given", "key", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/__init__.py#L641-L652
51,109
bugra/angel-list
angel/angel.py
AngelList.get_tags_users
def get_tags_users(self, id_): """ Get a particular user which are tagged based on the id_ """ return _get_request(_TAGS_USERS.format(c_api=_C_API_BEGINNING, api=_API_VERSION, ...
python
def get_tags_users(self, id_): """ Get a particular user which are tagged based on the id_ """ return _get_request(_TAGS_USERS.format(c_api=_C_API_BEGINNING, api=_API_VERSION, ...
[ "def", "get_tags_users", "(", "self", ",", "id_", ")", ":", "return", "_get_request", "(", "_TAGS_USERS", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "id_", "=", "id_", ",", "at", "=", "self", ".", "access_...
Get a particular user which are tagged based on the id_
[ "Get", "a", "particular", "user", "which", "are", "tagged", "based", "on", "the", "id_" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L366-L372
51,110
bugra/angel-list
angel/angel.py
AngelList.get_startup
def get_startup(self, id_): """ Get startup based on id """ return _get_request(_STARTUP.format(c_api=_C_API_BEGINNING, api=_API_VERSION, id_=id_, at=self.access_token))
python
def get_startup(self, id_): """ Get startup based on id """ return _get_request(_STARTUP.format(c_api=_C_API_BEGINNING, api=_API_VERSION, id_=id_, at=self.access_token))
[ "def", "get_startup", "(", "self", ",", "id_", ")", ":", "return", "_get_request", "(", "_STARTUP", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "id_", "=", "id_", ",", "at", "=", "self", ".", "access_token"...
Get startup based on id
[ "Get", "startup", "based", "on", "id" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L375-L381
51,111
bugra/angel-list
angel/angel.py
AngelList.get_startup_comments
def get_startup_comments(self, id_): """ Retrieve the comments of a particular startup """ return _get_request(_STARTUP_C.format(c_api=_C_API_BEGINNING, api=_API_VERSION, id_=id_, ...
python
def get_startup_comments(self, id_): """ Retrieve the comments of a particular startup """ return _get_request(_STARTUP_C.format(c_api=_C_API_BEGINNING, api=_API_VERSION, id_=id_, ...
[ "def", "get_startup_comments", "(", "self", ",", "id_", ")", ":", "return", "_get_request", "(", "_STARTUP_C", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "id_", "=", "id_", ",", "at", "=", "self", ".", "ac...
Retrieve the comments of a particular startup
[ "Retrieve", "the", "comments", "of", "a", "particular", "startup" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L405-L411
51,112
bugra/angel-list
angel/angel.py
AngelList.get_startups_filtered_by
def get_startups_filtered_by(self, filter_='raising'): """ Get startups based on which companies are raising funding """ url = _STARTUP_RAISING.format(c_api=_C_API_BEGINNING, api=_API_VERSION, ...
python
def get_startups_filtered_by(self, filter_='raising'): """ Get startups based on which companies are raising funding """ url = _STARTUP_RAISING.format(c_api=_C_API_BEGINNING, api=_API_VERSION, ...
[ "def", "get_startups_filtered_by", "(", "self", ",", "filter_", "=", "'raising'", ")", ":", "url", "=", "_STARTUP_RAISING", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "filter_", "=", "filter_", ",", "at", "=",...
Get startups based on which companies are raising funding
[ "Get", "startups", "based", "on", "which", "companies", "are", "raising", "funding" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L413-L420
51,113
bugra/angel-list
angel/angel.py
AngelList.get_status_updates
def get_status_updates(self, startup_id): """ Get status updates of a startup """ return _get_request(_STATUS_U.format(c_api=_C_API_BEGINNING, api=_API_VERSION, startup_id=startup_id, ...
python
def get_status_updates(self, startup_id): """ Get status updates of a startup """ return _get_request(_STATUS_U.format(c_api=_C_API_BEGINNING, api=_API_VERSION, startup_id=startup_id, ...
[ "def", "get_status_updates", "(", "self", ",", "startup_id", ")", ":", "return", "_get_request", "(", "_STATUS_U", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "startup_id", "=", "startup_id", ",", "at", "=", "s...
Get status updates of a startup
[ "Get", "status", "updates", "of", "a", "startup" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L422-L428
51,114
bugra/angel-list
angel/angel.py
AngelList.get_search_for_slugs
def get_search_for_slugs(self, slug): """ Search for a particular slug """ return _get_request(_SLUG_SEARCH.format(c_api=_C_API_BEGINNING, api=_API_VERSION, slug=_format_query(slug), ...
python
def get_search_for_slugs(self, slug): """ Search for a particular slug """ return _get_request(_SLUG_SEARCH.format(c_api=_C_API_BEGINNING, api=_API_VERSION, slug=_format_query(slug), ...
[ "def", "get_search_for_slugs", "(", "self", ",", "slug", ")", ":", "return", "_get_request", "(", "_SLUG_SEARCH", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "slug", "=", "_format_query", "(", "slug", ")", ",",...
Search for a particular slug
[ "Search", "for", "a", "particular", "slug" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L432-L438
51,115
bugra/angel-list
angel/angel.py
AngelList.get_reviews
def get_reviews(self, user_id): """ Get reviews for a particular user """ url = _REVIEWS_USER.format(c_api=_C_API_BEGINNING, api=_API_VERSION, user_id=user_id, at=s...
python
def get_reviews(self, user_id): """ Get reviews for a particular user """ url = _REVIEWS_USER.format(c_api=_C_API_BEGINNING, api=_API_VERSION, user_id=user_id, at=s...
[ "def", "get_reviews", "(", "self", ",", "user_id", ")", ":", "url", "=", "_REVIEWS_USER", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "user_id", "=", "user_id", ",", "at", "=", "self", ".", "access_token", ...
Get reviews for a particular user
[ "Get", "reviews", "for", "a", "particular", "user" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L455-L462
51,116
bugra/angel-list
angel/angel.py
AngelList.get_review_id
def get_review_id(self, id_): """ Get a particular review id, independent from the user_id and startup_id """ return _get_request(_REVIEW_ID.format(c_api=_C_API_BEGINNING, api=_API_VERSION, ...
python
def get_review_id(self, id_): """ Get a particular review id, independent from the user_id and startup_id """ return _get_request(_REVIEW_ID.format(c_api=_C_API_BEGINNING, api=_API_VERSION, ...
[ "def", "get_review_id", "(", "self", ",", "id_", ")", ":", "return", "_get_request", "(", "_REVIEW_ID", ".", "format", "(", "c_api", "=", "_C_API_BEGINNING", ",", "api", "=", "_API_VERSION", ",", "id_", "=", "id_", ",", "at", "=", "self", ".", "access_to...
Get a particular review id, independent from the user_id and startup_id
[ "Get", "a", "particular", "review", "id", "independent", "from", "the", "user_id", "and", "startup_id" ]
75ac453e873727675ba18e1f45b5bc0cfda26fd7
https://github.com/bugra/angel-list/blob/75ac453e873727675ba18e1f45b5bc0cfda26fd7/angel/angel.py#L465-L472
51,117
yyuu/botornado
boto/sdb/__init__.py
regions
def regions(): """ Get all available regions for the SDB service. :rtype: list :return: A list of :class:`boto.sdb.regioninfo.RegionInfo` instances """ return [SDBRegionInfo(name='us-east-1', endpoint='sdb.amazonaws.com'), SDBRegionInfo(name='eu-west-1', ...
python
def regions(): """ Get all available regions for the SDB service. :rtype: list :return: A list of :class:`boto.sdb.regioninfo.RegionInfo` instances """ return [SDBRegionInfo(name='us-east-1', endpoint='sdb.amazonaws.com'), SDBRegionInfo(name='eu-west-1', ...
[ "def", "regions", "(", ")", ":", "return", "[", "SDBRegionInfo", "(", "name", "=", "'us-east-1'", ",", "endpoint", "=", "'sdb.amazonaws.com'", ")", ",", "SDBRegionInfo", "(", "name", "=", "'eu-west-1'", ",", "endpoint", "=", "'sdb.eu-west-1.amazonaws.com'", ")",...
Get all available regions for the SDB service. :rtype: list :return: A list of :class:`boto.sdb.regioninfo.RegionInfo` instances
[ "Get", "all", "available", "regions", "for", "the", "SDB", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/__init__.py#L25-L46
51,118
yyuu/botornado
boto/pyami/installers/ubuntu/installer.py
Installer.add_init_script
def add_init_script(self, file, name): """ Add this file to the init.d directory """ f_path = os.path.join("/etc/init.d", name) f = open(f_path, "w") f.write(file) f.close() os.chmod(f_path, stat.S_IREAD| stat.S_IWRITE | stat.S_IEXEC) self.run("/us...
python
def add_init_script(self, file, name): """ Add this file to the init.d directory """ f_path = os.path.join("/etc/init.d", name) f = open(f_path, "w") f.write(file) f.close() os.chmod(f_path, stat.S_IREAD| stat.S_IWRITE | stat.S_IEXEC) self.run("/us...
[ "def", "add_init_script", "(", "self", ",", "file", ",", "name", ")", ":", "f_path", "=", "os", ".", "path", ".", "join", "(", "\"/etc/init.d\"", ",", "name", ")", "f", "=", "open", "(", "f_path", ",", "\"w\"", ")", "f", ".", "write", "(", "file", ...
Add this file to the init.d directory
[ "Add", "this", "file", "to", "the", "init", ".", "d", "directory" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/pyami/installers/ubuntu/installer.py#L51-L60
51,119
yyuu/botornado
boto/pyami/installers/ubuntu/installer.py
Installer.create_user
def create_user(self, user): """ Create a user on the local system """ self.run("useradd -m %s" % user) usr = getpwnam(user) return usr
python
def create_user(self, user): """ Create a user on the local system """ self.run("useradd -m %s" % user) usr = getpwnam(user) return usr
[ "def", "create_user", "(", "self", ",", "user", ")", ":", "self", ".", "run", "(", "\"useradd -m %s\"", "%", "user", ")", "usr", "=", "getpwnam", "(", "user", ")", "return", "usr" ]
Create a user on the local system
[ "Create", "a", "user", "on", "the", "local", "system" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/pyami/installers/ubuntu/installer.py#L82-L88
51,120
emory-libraries/eulfedora
eulfedora/syncutil.py
sync_object
def sync_object(src_obj, dest_repo, export_context='migrate', overwrite=False, show_progress=False, requires_auth=False, omit_checksums=False, verify=False): '''Copy an object from one repository to another using the Fedora export functionality. :param src_ob...
python
def sync_object(src_obj, dest_repo, export_context='migrate', overwrite=False, show_progress=False, requires_auth=False, omit_checksums=False, verify=False): '''Copy an object from one repository to another using the Fedora export functionality. :param src_ob...
[ "def", "sync_object", "(", "src_obj", ",", "dest_repo", ",", "export_context", "=", "'migrate'", ",", "overwrite", "=", "False", ",", "show_progress", "=", "False", ",", "requires_auth", "=", "False", ",", "omit_checksums", "=", "False", ",", "verify", "=", ...
Copy an object from one repository to another using the Fedora export functionality. :param src_obj: source :class:`~eulfedora.models.DigitalObject` to be copied :param dest_repo: destination :class:`~eulfedora.server.Repository` where the object will be copied to :param export_context...
[ "Copy", "an", "object", "from", "one", "repository", "to", "another", "using", "the", "Fedora", "export", "functionality", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/syncutil.py#L38-L138
51,121
emory-libraries/eulfedora
eulfedora/syncutil.py
binarycontent_sections
def binarycontent_sections(chunk): '''Split a chunk of data into sections by start and end binary content tags.''' # using string split because it is significantly faster than regex. # use common text of start and end tags to split the text # (i.e. without < or </ tag beginning) binary_content_...
python
def binarycontent_sections(chunk): '''Split a chunk of data into sections by start and end binary content tags.''' # using string split because it is significantly faster than regex. # use common text of start and end tags to split the text # (i.e. without < or </ tag beginning) binary_content_...
[ "def", "binarycontent_sections", "(", "chunk", ")", ":", "# using string split because it is significantly faster than regex.", "# use common text of start and end tags to split the text", "# (i.e. without < or </ tag beginning)", "binary_content_tag", "=", "BINARY_CONTENT_START", "[", "1"...
Split a chunk of data into sections by start and end binary content tags.
[ "Split", "a", "chunk", "of", "data", "into", "sections", "by", "start", "and", "end", "binary", "content", "tags", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/syncutil.py#L469-L501
51,122
emory-libraries/eulfedora
eulfedora/syncutil.py
estimate_object_size
def estimate_object_size(obj, archive=True): '''Calculate a rough estimate of object size, based on the sizes of all versions of all datastreams. If archive is true, adjusts the size estimate of managed datastreams for base64 encoded data. ''' size_estimate = 250000 # initial rough estimate for f...
python
def estimate_object_size(obj, archive=True): '''Calculate a rough estimate of object size, based on the sizes of all versions of all datastreams. If archive is true, adjusts the size estimate of managed datastreams for base64 encoded data. ''' size_estimate = 250000 # initial rough estimate for f...
[ "def", "estimate_object_size", "(", "obj", ",", "archive", "=", "True", ")", ":", "size_estimate", "=", "250000", "# initial rough estimate for foxml size", "for", "ds", "in", "obj", ".", "ds_list", ":", "dsobj", "=", "obj", ".", "getDatastreamObject", "(", "ds"...
Calculate a rough estimate of object size, based on the sizes of all versions of all datastreams. If archive is true, adjusts the size estimate of managed datastreams for base64 encoded data.
[ "Calculate", "a", "rough", "estimate", "of", "object", "size", "based", "on", "the", "sizes", "of", "all", "versions", "of", "all", "datastreams", ".", "If", "archive", "is", "true", "adjusts", "the", "size", "estimate", "of", "managed", "datastreams", "for"...
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/syncutil.py#L504-L518
51,123
emory-libraries/eulfedora
eulfedora/syncutil.py
endswith_partial
def endswith_partial(text, partial_str): '''Check if the text ends with any partial version of the specified string.''' # at the end of the content # we don't care about complete overlap, so start checking # for matches without the last character test_str = partial_str[:-1] # look for progre...
python
def endswith_partial(text, partial_str): '''Check if the text ends with any partial version of the specified string.''' # at the end of the content # we don't care about complete overlap, so start checking # for matches without the last character test_str = partial_str[:-1] # look for progre...
[ "def", "endswith_partial", "(", "text", ",", "partial_str", ")", ":", "# at the end of the content", "# we don't care about complete overlap, so start checking", "# for matches without the last character", "test_str", "=", "partial_str", "[", ":", "-", "1", "]", "# look for pro...
Check if the text ends with any partial version of the specified string.
[ "Check", "if", "the", "text", "ends", "with", "any", "partial", "version", "of", "the", "specified", "string", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/syncutil.py#L540-L552
51,124
emory-libraries/eulfedora
eulfedora/syncutil.py
ArchiveExport.object_data
def object_data(self): '''Process the archival export and return a buffer with foxml content for ingest into the destination repository. :returns: :class:`io.BytesIO` for ingest, with references to uploaded datastream content or content location urls ''' self.foxml_b...
python
def object_data(self): '''Process the archival export and return a buffer with foxml content for ingest into the destination repository. :returns: :class:`io.BytesIO` for ingest, with references to uploaded datastream content or content location urls ''' self.foxml_b...
[ "def", "object_data", "(", "self", ")", ":", "self", ".", "foxml_buffer", "=", "io", ".", "BytesIO", "(", ")", "if", "self", ".", "progress_bar", ":", "self", ".", "progress_bar", ".", "start", "(", ")", "previous_section", "=", "None", "while", "True", ...
Process the archival export and return a buffer with foxml content for ingest into the destination repository. :returns: :class:`io.BytesIO` for ingest, with references to uploaded datastream content or content location urls
[ "Process", "the", "archival", "export", "and", "return", "a", "buffer", "with", "foxml", "content", "for", "ingest", "into", "the", "destination", "repository", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/syncutil.py#L315-L409
51,125
yyuu/botornado
boto/utils.py
compute_md5
def compute_md5(fp, buf_size=8192, size=None): """ Compute MD5 hash on passed file and return results in a tuple of values. :type fp: file :param fp: File pointer to the file to MD5 hash. The file pointer will be reset to its current location before the method returns. ...
python
def compute_md5(fp, buf_size=8192, size=None): """ Compute MD5 hash on passed file and return results in a tuple of values. :type fp: file :param fp: File pointer to the file to MD5 hash. The file pointer will be reset to its current location before the method returns. ...
[ "def", "compute_md5", "(", "fp", ",", "buf_size", "=", "8192", ",", "size", "=", "None", ")", ":", "m", "=", "md5", "(", ")", "spos", "=", "fp", ".", "tell", "(", ")", "if", "size", "and", "size", "<", "buf_size", ":", "s", "=", "fp", ".", "r...
Compute MD5 hash on passed file and return results in a tuple of values. :type fp: file :param fp: File pointer to the file to MD5 hash. The file pointer will be reset to its current location before the method returns. :type buf_size: integer :param buf_size: Number of b...
[ "Compute", "MD5", "hash", "on", "passed", "file", "and", "return", "results", "in", "a", "tuple", "of", "values", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/utils.py#L705-L753
51,126
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
regions
def regions(): """ Get all available regions for the CloudWatch service. :rtype: list :return: A list of :class:`boto.RegionInfo` instances """ regions = [] for region_name in RegionData: region = RegionInfo(name=region_name, endpoint=RegionData[region_na...
python
def regions(): """ Get all available regions for the CloudWatch service. :rtype: list :return: A list of :class:`boto.RegionInfo` instances """ regions = [] for region_name in RegionData: region = RegionInfo(name=region_name, endpoint=RegionData[region_na...
[ "def", "regions", "(", ")", ":", "regions", "=", "[", "]", "for", "region_name", "in", "RegionData", ":", "region", "=", "RegionInfo", "(", "name", "=", "region_name", ",", "endpoint", "=", "RegionData", "[", "region_name", "]", ",", "connection_cls", "=",...
Get all available regions for the CloudWatch service. :rtype: list :return: A list of :class:`boto.RegionInfo` instances
[ "Get", "all", "available", "regions", "for", "the", "CloudWatch", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L47-L60
51,127
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.get_metric_statistics
def get_metric_statistics(self, period, start_time, end_time, metric_name, namespace, statistics, dimensions=None, unit=None): """ Get time-series data for one or more statistics of a given metric. :type period: integer :param ...
python
def get_metric_statistics(self, period, start_time, end_time, metric_name, namespace, statistics, dimensions=None, unit=None): """ Get time-series data for one or more statistics of a given metric. :type period: integer :param ...
[ "def", "get_metric_statistics", "(", "self", ",", "period", ",", "start_time", ",", "end_time", ",", "metric_name", ",", "namespace", ",", "statistics", ",", "dimensions", "=", "None", ",", "unit", "=", "None", ")", ":", "params", "=", "{", "'Period'", ":"...
Get time-series data for one or more statistics of a given metric. :type period: integer :param period: The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60. ...
[ "Get", "time", "-", "series", "data", "for", "one", "or", "more", "statistics", "of", "a", "given", "metric", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L177-L227
51,128
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.list_metrics
def list_metrics(self, next_token=None, dimensions=None, metric_name=None, namespace=None): """ Returns a list of the valid metrics for which there is recorded data available. :type next_token: str :param next_token: A maximum of 500 metrics will be returned...
python
def list_metrics(self, next_token=None, dimensions=None, metric_name=None, namespace=None): """ Returns a list of the valid metrics for which there is recorded data available. :type next_token: str :param next_token: A maximum of 500 metrics will be returned...
[ "def", "list_metrics", "(", "self", ",", "next_token", "=", "None", ",", "dimensions", "=", "None", ",", "metric_name", "=", "None", ",", "namespace", "=", "None", ")", ":", "params", "=", "{", "}", "if", "next_token", ":", "params", "[", "'NextToken'", ...
Returns a list of the valid metrics for which there is recorded data available. :type next_token: str :param next_token: A maximum of 500 metrics will be returned at one time. If more results are available, the ResultSet returned will conta...
[ "Returns", "a", "list", "of", "the", "valid", "metrics", "for", "which", "there", "is", "recorded", "data", "available", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L229-L271
51,129
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.put_metric_data
def put_metric_data(self, namespace, name, value=None, timestamp=None, unit=None, dimensions=None, statistics=None): """ Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch associates the data points with the specified metric. If the specified ...
python
def put_metric_data(self, namespace, name, value=None, timestamp=None, unit=None, dimensions=None, statistics=None): """ Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch associates the data points with the specified metric. If the specified ...
[ "def", "put_metric_data", "(", "self", ",", "namespace", ",", "name", ",", "value", "=", "None", ",", "timestamp", "=", "None", ",", "unit", "=", "None", ",", "dimensions", "=", "None", ",", "statistics", "=", "None", ")", ":", "params", "=", "{", "'...
Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch associates the data points with the specified metric. If the specified metric does not exist, Amazon CloudWatch creates the metric. If a list is specified for some, but not all, of the arguments, the remaining argum...
[ "Publishes", "metric", "data", "points", "to", "Amazon", "CloudWatch", ".", "Amazon", "Cloudwatch", "associates", "the", "data", "points", "with", "the", "specified", "metric", ".", "If", "the", "specified", "metric", "does", "not", "exist", "Amazon", "CloudWatc...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L273-L319
51,130
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.describe_alarms
def describe_alarms(self, action_prefix=None, alarm_name_prefix=None, alarm_names=None, max_records=None, state_value=None, next_token=None): """ Retrieves alarms with the specified names. If no name is specified, all alarms for the user are return...
python
def describe_alarms(self, action_prefix=None, alarm_name_prefix=None, alarm_names=None, max_records=None, state_value=None, next_token=None): """ Retrieves alarms with the specified names. If no name is specified, all alarms for the user are return...
[ "def", "describe_alarms", "(", "self", ",", "action_prefix", "=", "None", ",", "alarm_name_prefix", "=", "None", ",", "alarm_names", "=", "None", ",", "max_records", "=", "None", ",", "state_value", "=", "None", ",", "next_token", "=", "None", ")", ":", "p...
Retrieves alarms with the specified names. If no name is specified, all alarms for the user are returned. Alarms can be retrieved by using only a prefix for the alarm name, the alarm state, or a prefix for any action. :type action_prefix: string :param action_name: The action na...
[ "Retrieves", "alarms", "with", "the", "specified", "names", ".", "If", "no", "name", "is", "specified", "all", "alarms", "for", "the", "user", "are", "returned", ".", "Alarms", "can", "be", "retrieved", "by", "using", "only", "a", "prefix", "for", "the", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L322-L368
51,131
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.describe_alarm_history
def describe_alarm_history(self, alarm_name=None, start_date=None, end_date=None, max_records=None, history_item_type=None, next_token=None): """ Retrieves history for the specified alarm. Filter alarms by date ...
python
def describe_alarm_history(self, alarm_name=None, start_date=None, end_date=None, max_records=None, history_item_type=None, next_token=None): """ Retrieves history for the specified alarm. Filter alarms by date ...
[ "def", "describe_alarm_history", "(", "self", ",", "alarm_name", "=", "None", ",", "start_date", "=", "None", ",", "end_date", "=", "None", ",", "max_records", "=", "None", ",", "history_item_type", "=", "None", ",", "next_token", "=", "None", ")", ":", "p...
Retrieves history for the specified alarm. Filter alarms by date range or item type. If an alarm name is not specified, Amazon CloudWatch returns histories for all of the owner's alarms. Amazon CloudWatch retains the history of deleted alarms for a period of six weeks. If an alarm has b...
[ "Retrieves", "history", "for", "the", "specified", "alarm", ".", "Filter", "alarms", "by", "date", "range", "or", "item", "type", ".", "If", "an", "alarm", "name", "is", "not", "specified", "Amazon", "CloudWatch", "returns", "histories", "for", "all", "of", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L370-L420
51,132
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.describe_alarms_for_metric
def describe_alarms_for_metric(self, metric_name, namespace, period=None, statistic=None, dimensions=None, unit=None): """ Retrieves all alarms for a single metric. Specify a statistic, period, or unit to filter the set of alarms further. :type metric_...
python
def describe_alarms_for_metric(self, metric_name, namespace, period=None, statistic=None, dimensions=None, unit=None): """ Retrieves all alarms for a single metric. Specify a statistic, period, or unit to filter the set of alarms further. :type metric_...
[ "def", "describe_alarms_for_metric", "(", "self", ",", "metric_name", ",", "namespace", ",", "period", "=", "None", ",", "statistic", "=", "None", ",", "dimensions", "=", "None", ",", "unit", "=", "None", ")", ":", "params", "=", "{", "'MetricName'", ":", ...
Retrieves all alarms for a single metric. Specify a statistic, period, or unit to filter the set of alarms further. :type metric_name: string :param metric_name: The name of the metric :type namespace: string :param namespace: The namespace of the metric. :type period:...
[ "Retrieves", "all", "alarms", "for", "a", "single", "metric", ".", "Specify", "a", "statistic", "period", "or", "unit", "to", "filter", "the", "set", "of", "alarms", "further", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L422-L465
51,133
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.put_metric_alarm
def put_metric_alarm(self, alarm): """ Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. Optionally, this operation can associate one or more Amazon Simple Notification Service resources with the alarm. When this operation creates an alar...
python
def put_metric_alarm(self, alarm): """ Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. Optionally, this operation can associate one or more Amazon Simple Notification Service resources with the alarm. When this operation creates an alar...
[ "def", "put_metric_alarm", "(", "self", ",", "alarm", ")", ":", "params", "=", "{", "'AlarmName'", ":", "alarm", ".", "name", ",", "'MetricName'", ":", "alarm", ".", "metric", ",", "'Namespace'", ":", "alarm", ".", "namespace", ",", "'Statistic'", ":", "...
Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. Optionally, this operation can associate one or more Amazon Simple Notification Service resources with the alarm. When this operation creates an alarm, the alarm state is immediately set to INSUFF...
[ "Creates", "or", "updates", "an", "alarm", "and", "associates", "it", "with", "the", "specified", "Amazon", "CloudWatch", "metric", ".", "Optionally", "this", "operation", "can", "associate", "one", "or", "more", "Amazon", "Simple", "Notification", "Service", "r...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L467-L511
51,134
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.delete_alarms
def delete_alarms(self, alarms): """ Deletes all specified alarms. In the event of an error, no alarms are deleted. :type alarms: list :param alarms: List of alarm names. """ params = {} self.build_list_params(params, alarms, 'AlarmNames.member.%s') ...
python
def delete_alarms(self, alarms): """ Deletes all specified alarms. In the event of an error, no alarms are deleted. :type alarms: list :param alarms: List of alarm names. """ params = {} self.build_list_params(params, alarms, 'AlarmNames.member.%s') ...
[ "def", "delete_alarms", "(", "self", ",", "alarms", ")", ":", "params", "=", "{", "}", "self", ".", "build_list_params", "(", "params", ",", "alarms", ",", "'AlarmNames.member.%s'", ")", "return", "self", ".", "get_status", "(", "'DeleteAlarms'", ",", "param...
Deletes all specified alarms. In the event of an error, no alarms are deleted. :type alarms: list :param alarms: List of alarm names.
[ "Deletes", "all", "specified", "alarms", ".", "In", "the", "event", "of", "an", "error", "no", "alarms", "are", "deleted", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L515-L525
51,135
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.enable_alarm_actions
def enable_alarm_actions(self, alarm_names): """ Enables actions for the specified alarms. :type alarms: list :param alarms: List of alarm names. """ params = {} self.build_list_params(params, alarm_names, 'AlarmNames.member.%s') return self.get_status('E...
python
def enable_alarm_actions(self, alarm_names): """ Enables actions for the specified alarms. :type alarms: list :param alarms: List of alarm names. """ params = {} self.build_list_params(params, alarm_names, 'AlarmNames.member.%s') return self.get_status('E...
[ "def", "enable_alarm_actions", "(", "self", ",", "alarm_names", ")", ":", "params", "=", "{", "}", "self", ".", "build_list_params", "(", "params", ",", "alarm_names", ",", "'AlarmNames.member.%s'", ")", "return", "self", ".", "get_status", "(", "'EnableAlarmAct...
Enables actions for the specified alarms. :type alarms: list :param alarms: List of alarm names.
[ "Enables", "actions", "for", "the", "specified", "alarms", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L556-L565
51,136
yyuu/botornado
boto/ec2/cloudwatch/__init__.py
CloudWatchConnection.disable_alarm_actions
def disable_alarm_actions(self, alarm_names): """ Disables actions for the specified alarms. :type alarms: list :param alarms: List of alarm names. """ params = {} self.build_list_params(params, alarm_names, 'AlarmNames.member.%s') return self.get_status(...
python
def disable_alarm_actions(self, alarm_names): """ Disables actions for the specified alarms. :type alarms: list :param alarms: List of alarm names. """ params = {} self.build_list_params(params, alarm_names, 'AlarmNames.member.%s') return self.get_status(...
[ "def", "disable_alarm_actions", "(", "self", ",", "alarm_names", ")", ":", "params", "=", "{", "}", "self", ".", "build_list_params", "(", "params", ",", "alarm_names", ",", "'AlarmNames.member.%s'", ")", "return", "self", ".", "get_status", "(", "'DisableAlarmA...
Disables actions for the specified alarms. :type alarms: list :param alarms: List of alarm names.
[ "Disables", "actions", "for", "the", "specified", "alarms", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/cloudwatch/__init__.py#L567-L576
51,137
yyuu/botornado
boto/manage/task.py
Task.check
def check(self): """ Determine how long until the next scheduled time for a Task. Returns the number of seconds until the next scheduled time or zero if the task needs to be run immediately. If it's an hourly task and it's never been run, run it now. If it's a daily task ...
python
def check(self): """ Determine how long until the next scheduled time for a Task. Returns the number of seconds until the next scheduled time or zero if the task needs to be run immediately. If it's an hourly task and it's never been run, run it now. If it's a daily task ...
[ "def", "check", "(", "self", ")", ":", "boto", ".", "log", ".", "info", "(", "'checking Task[%s]-now=%s, last=%s'", "%", "(", "self", ".", "name", ",", "self", ".", "now", ",", "self", ".", "last_executed", ")", ")", "if", "self", ".", "hourly", "and",...
Determine how long until the next scheduled time for a Task. Returns the number of seconds until the next scheduled time or zero if the task needs to be run immediately. If it's an hourly task and it's never been run, run it now. If it's a daily task and it's never been run and the hour ...
[ "Determine", "how", "long", "until", "the", "next", "scheduled", "time", "for", "a", "Task", ".", "Returns", "the", "number", "of", "seconds", "until", "the", "next", "scheduled", "time", "or", "zero", "if", "the", "task", "needs", "to", "be", "run", "im...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/manage/task.py#L67-L99
51,138
llazzaro/analyzerstrategies
analyzerstrategies/sma_portfolio_strategy.py
OneTraker.__buyIfMeet
def __buyIfMeet(self, tick): ''' place buy order if conditions meet ''' # place short sell order ''' if (self.__smaShort.getLastValue() < self.__smaLong.getLastValue() or self.__smaMid.getLastValue() < self.__smaLong.getLastValue()): if tick.close/self.__previousMovingLowWeek...
python
def __buyIfMeet(self, tick): ''' place buy order if conditions meet ''' # place short sell order ''' if (self.__smaShort.getLastValue() < self.__smaLong.getLastValue() or self.__smaMid.getLastValue() < self.__smaLong.getLastValue()): if tick.close/self.__previousMovingLowWeek...
[ "def", "__buyIfMeet", "(", "self", ",", "tick", ")", ":", "# place short sell order", "'''\n if (self.__smaShort.getLastValue() < self.__smaLong.getLastValue() or self.__smaMid.getLastValue() < self.__smaLong.getLastValue()):\n if tick.close/self.__previousMovingLowWeek < 0.95:\n...
place buy order if conditions meet
[ "place", "buy", "order", "if", "conditions", "meet" ]
3c647802f582bf2f06c6793f282bee0d26514cd6
https://github.com/llazzaro/analyzerstrategies/blob/3c647802f582bf2f06c6793f282bee0d26514cd6/analyzerstrategies/sma_portfolio_strategy.py#L102-L129
51,139
llazzaro/analyzerstrategies
analyzerstrategies/sma_portfolio_strategy.py
OneTraker.__placeSellShortOrder
def __placeSellShortOrder(self, tick): ''' place short sell order''' share=math.floor(self.__strategy.getAccountCopy().getCash() / float(tick.close)) sellShortOrder=Order(accountId=self.__strategy.accountId, action=Action.SELL_SHORT, ...
python
def __placeSellShortOrder(self, tick): ''' place short sell order''' share=math.floor(self.__strategy.getAccountCopy().getCash() / float(tick.close)) sellShortOrder=Order(accountId=self.__strategy.accountId, action=Action.SELL_SHORT, ...
[ "def", "__placeSellShortOrder", "(", "self", ",", "tick", ")", ":", "share", "=", "math", ".", "floor", "(", "self", ".", "__strategy", ".", "getAccountCopy", "(", ")", ".", "getCash", "(", ")", "/", "float", "(", "tick", ".", "close", ")", ")", "sel...
place short sell order
[ "place", "short", "sell", "order" ]
3c647802f582bf2f06c6793f282bee0d26514cd6
https://github.com/llazzaro/analyzerstrategies/blob/3c647802f582bf2f06c6793f282bee0d26514cd6/analyzerstrategies/sma_portfolio_strategy.py#L131-L150
51,140
llazzaro/analyzerstrategies
analyzerstrategies/sma_portfolio_strategy.py
OneTraker.__placeStopOrder
def __placeStopOrder(self, order): ''' place stop order ''' orderId=self.__strategy.placeOrder(order) if orderId: self.__stopOrderId=orderId self.__stopOrder=order else: LOG.error("Can't place stop order %s" % order)
python
def __placeStopOrder(self, order): ''' place stop order ''' orderId=self.__strategy.placeOrder(order) if orderId: self.__stopOrderId=orderId self.__stopOrder=order else: LOG.error("Can't place stop order %s" % order)
[ "def", "__placeStopOrder", "(", "self", ",", "order", ")", ":", "orderId", "=", "self", ".", "__strategy", ".", "placeOrder", "(", "order", ")", "if", "orderId", ":", "self", ".", "__stopOrderId", "=", "orderId", "self", ".", "__stopOrder", "=", "order", ...
place stop order
[ "place", "stop", "order" ]
3c647802f582bf2f06c6793f282bee0d26514cd6
https://github.com/llazzaro/analyzerstrategies/blob/3c647802f582bf2f06c6793f282bee0d26514cd6/analyzerstrategies/sma_portfolio_strategy.py#L184-L191
51,141
llazzaro/analyzerstrategies
analyzerstrategies/sma_portfolio_strategy.py
OneTraker.__adjustStopOrder
def __adjustStopOrder(self, tick): ''' update stop order if needed ''' if not self.__stopOrderId: return if self.__stopOrder.action == Action.SELL: orgStopPrice=self.__buyOrder.price * 0.95 newStopPrice=max(((tick.close + orgStopPrice) / 2), tick.close * 0.85...
python
def __adjustStopOrder(self, tick): ''' update stop order if needed ''' if not self.__stopOrderId: return if self.__stopOrder.action == Action.SELL: orgStopPrice=self.__buyOrder.price * 0.95 newStopPrice=max(((tick.close + orgStopPrice) / 2), tick.close * 0.85...
[ "def", "__adjustStopOrder", "(", "self", ",", "tick", ")", ":", "if", "not", "self", ".", "__stopOrderId", ":", "return", "if", "self", ".", "__stopOrder", ".", "action", "==", "Action", ".", "SELL", ":", "orgStopPrice", "=", "self", ".", "__buyOrder", "...
update stop order if needed
[ "update", "stop", "order", "if", "needed" ]
3c647802f582bf2f06c6793f282bee0d26514cd6
https://github.com/llazzaro/analyzerstrategies/blob/3c647802f582bf2f06c6793f282bee0d26514cd6/analyzerstrategies/sma_portfolio_strategy.py#L209-L243
51,142
llazzaro/analyzerstrategies
analyzerstrategies/sma_portfolio_strategy.py
OneTraker.__updatePreviousState
def __updatePreviousState(self, tick): ''' update previous state ''' self.__previousTick=tick self.__previousSmaShort=self.__smaShort.getLastValue() self.__previousSmaMid=self.__smaMid.getLastValue() self.__previousSmaLong=self.__smaLong.getLastValue() self.__previousSmaV...
python
def __updatePreviousState(self, tick): ''' update previous state ''' self.__previousTick=tick self.__previousSmaShort=self.__smaShort.getLastValue() self.__previousSmaMid=self.__smaMid.getLastValue() self.__previousSmaLong=self.__smaLong.getLastValue() self.__previousSmaV...
[ "def", "__updatePreviousState", "(", "self", ",", "tick", ")", ":", "self", ".", "__previousTick", "=", "tick", "self", ".", "__previousSmaShort", "=", "self", ".", "__smaShort", ".", "getLastValue", "(", ")", "self", ".", "__previousSmaMid", "=", "self", "....
update previous state
[ "update", "previous", "state" ]
3c647802f582bf2f06c6793f282bee0d26514cd6
https://github.com/llazzaro/analyzerstrategies/blob/3c647802f582bf2f06c6793f282bee0d26514cd6/analyzerstrategies/sma_portfolio_strategy.py#L245-L254
51,143
yyuu/botornado
boto/sdb/db/sequence.py
SequenceGenerator._inc
def _inc(self, val): """Increment a single value""" assert(len(val) == self.sequence_length) return self.sequence_string[(self.sequence_string.index(val)+1) % len(self.sequence_string)]
python
def _inc(self, val): """Increment a single value""" assert(len(val) == self.sequence_length) return self.sequence_string[(self.sequence_string.index(val)+1) % len(self.sequence_string)]
[ "def", "_inc", "(", "self", ",", "val", ")", ":", "assert", "(", "len", "(", "val", ")", "==", "self", ".", "sequence_length", ")", "return", "self", ".", "sequence_string", "[", "(", "self", ".", "sequence_string", ".", "index", "(", "val", ")", "+"...
Increment a single value
[ "Increment", "a", "single", "value" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/sequence.py#L71-L74
51,144
yyuu/botornado
boto/sdb/db/sequence.py
Sequence.get
def get(self): """Get the value""" val = self.db.get_attributes(self.id, consistent_read=True) if val: if val.has_key('timestamp'): self.timestamp = val['timestamp'] if val.has_key('current_value'): self._value = self.item_type(val['current...
python
def get(self): """Get the value""" val = self.db.get_attributes(self.id, consistent_read=True) if val: if val.has_key('timestamp'): self.timestamp = val['timestamp'] if val.has_key('current_value'): self._value = self.item_type(val['current...
[ "def", "get", "(", "self", ")", ":", "val", "=", "self", ".", "db", ".", "get_attributes", "(", "self", ".", "id", ",", "consistent_read", "=", "True", ")", "if", "val", ":", "if", "val", ".", "has_key", "(", "'timestamp'", ")", ":", "self", ".", ...
Get the value
[ "Get", "the", "value" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/sequence.py#L179-L189
51,145
yyuu/botornado
boto/sdb/db/sequence.py
Sequence._connect
def _connect(self): """Connect to our domain""" if not self._db: import boto sdb = boto.connect_sdb() if not self.domain_name: self.domain_name = boto.config.get("DB", "sequence_db", boto.config.get("DB", "db_name", "default")) try: ...
python
def _connect(self): """Connect to our domain""" if not self._db: import boto sdb = boto.connect_sdb() if not self.domain_name: self.domain_name = boto.config.get("DB", "sequence_db", boto.config.get("DB", "db_name", "default")) try: ...
[ "def", "_connect", "(", "self", ")", ":", "if", "not", "self", ".", "_db", ":", "import", "boto", "sdb", "=", "boto", ".", "connect_sdb", "(", ")", "if", "not", "self", ".", "domain_name", ":", "self", ".", "domain_name", "=", "boto", ".", "config", ...
Connect to our domain
[ "Connect", "to", "our", "domain" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/sequence.py#L202-L216
51,146
yyuu/botornado
boto/pyami/config.py
Config.load_credential_file
def load_credential_file(self, path): """Load a credential file as is setup like the Java utilities""" c_data = StringIO.StringIO() c_data.write("[Credentials]\n") for line in open(path, "r").readlines(): c_data.write(line.replace("AWSAccessKeyId", "aws_access_key_id").replac...
python
def load_credential_file(self, path): """Load a credential file as is setup like the Java utilities""" c_data = StringIO.StringIO() c_data.write("[Credentials]\n") for line in open(path, "r").readlines(): c_data.write(line.replace("AWSAccessKeyId", "aws_access_key_id").replac...
[ "def", "load_credential_file", "(", "self", ",", "path", ")", ":", "c_data", "=", "StringIO", ".", "StringIO", "(", ")", "c_data", ".", "write", "(", "\"[Credentials]\\n\"", ")", "for", "line", "in", "open", "(", "path", ",", "\"r\"", ")", ".", "readline...
Load a credential file as is setup like the Java utilities
[ "Load", "a", "credential", "file", "as", "is", "setup", "like", "the", "Java", "utilities" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/pyami/config.py#L77-L84
51,147
yyuu/botornado
boto/pyami/config.py
Config.save_option
def save_option(self, path, section, option, value): """ Write the specified Section.Option to the config file specified by path. Replace any previous value. If the path doesn't exist, create it. Also add the option the the in-memory config. """ config = ConfigParser.Saf...
python
def save_option(self, path, section, option, value): """ Write the specified Section.Option to the config file specified by path. Replace any previous value. If the path doesn't exist, create it. Also add the option the the in-memory config. """ config = ConfigParser.Saf...
[ "def", "save_option", "(", "self", ",", "path", ",", "section", ",", "option", ",", "value", ")", ":", "config", "=", "ConfigParser", ".", "SafeConfigParser", "(", ")", "config", ".", "read", "(", "path", ")", "if", "not", "config", ".", "has_section", ...
Write the specified Section.Option to the config file specified by path. Replace any previous value. If the path doesn't exist, create it. Also add the option the the in-memory config.
[ "Write", "the", "specified", "Section", ".", "Option", "to", "the", "config", "file", "specified", "by", "path", ".", "Replace", "any", "previous", "value", ".", "If", "the", "path", "doesn", "t", "exist", "create", "it", ".", "Also", "add", "the", "opti...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/pyami/config.py#L96-L112
51,148
yyuu/botornado
boto/storage_uri.py
BucketStorageUri.clone_replace_name
def clone_replace_name(self, new_name): """Instantiate a BucketStorageUri from the current BucketStorageUri, but replacing the object_name. @type new_name: string @param new_name: new object name """ if not self.bucket_name: raise InvalidUriError('clone_repla...
python
def clone_replace_name(self, new_name): """Instantiate a BucketStorageUri from the current BucketStorageUri, but replacing the object_name. @type new_name: string @param new_name: new object name """ if not self.bucket_name: raise InvalidUriError('clone_repla...
[ "def", "clone_replace_name", "(", "self", ",", "new_name", ")", ":", "if", "not", "self", ".", "bucket_name", ":", "raise", "InvalidUriError", "(", "'clone_replace_name() on bucket-less URI %s'", "%", "self", ".", "uri", ")", "return", "BucketStorageUri", "(", "se...
Instantiate a BucketStorageUri from the current BucketStorageUri, but replacing the object_name. @type new_name: string @param new_name: new object name
[ "Instantiate", "a", "BucketStorageUri", "from", "the", "current", "BucketStorageUri", "but", "replacing", "the", "object_name", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/storage_uri.py#L229-L241
51,149
yyuu/botornado
boto/storage_uri.py
BucketStorageUri.get_acl
def get_acl(self, validate=True, headers=None, version_id=None): """returns a bucket's acl""" if not self.bucket_name: raise InvalidUriError('get_acl on bucket-less URI (%s)' % self.uri) bucket = self.get_bucket(validate, headers) # This works for both bucket- and object- lev...
python
def get_acl(self, validate=True, headers=None, version_id=None): """returns a bucket's acl""" if not self.bucket_name: raise InvalidUriError('get_acl on bucket-less URI (%s)' % self.uri) bucket = self.get_bucket(validate, headers) # This works for both bucket- and object- lev...
[ "def", "get_acl", "(", "self", ",", "validate", "=", "True", ",", "headers", "=", "None", ",", "version_id", "=", "None", ")", ":", "if", "not", "self", ".", "bucket_name", ":", "raise", "InvalidUriError", "(", "'get_acl on bucket-less URI (%s)'", "%", "self...
returns a bucket's acl
[ "returns", "a", "bucket", "s", "acl" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/storage_uri.py#L243-L252
51,150
yyuu/botornado
boto/storage_uri.py
BucketStorageUri.set_acl
def set_acl(self, acl_or_str, key_name='', validate=True, headers=None, version_id=None): """sets or updates a bucket's acl""" if not self.bucket_name: raise InvalidUriError('set_acl on bucket-less URI (%s)' % self.uri) self.get_bucke...
python
def set_acl(self, acl_or_str, key_name='', validate=True, headers=None, version_id=None): """sets or updates a bucket's acl""" if not self.bucket_name: raise InvalidUriError('set_acl on bucket-less URI (%s)' % self.uri) self.get_bucke...
[ "def", "set_acl", "(", "self", ",", "acl_or_str", ",", "key_name", "=", "''", ",", "validate", "=", "True", ",", "headers", "=", "None", ",", "version_id", "=", "None", ")", ":", "if", "not", "self", ".", "bucket_name", ":", "raise", "InvalidUriError", ...
sets or updates a bucket's acl
[ "sets", "or", "updates", "a", "bucket", "s", "acl" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/storage_uri.py#L375-L382
51,151
slawek87/yql-finance
examples/stock_price.py
fetch_appl
def fetch_appl(): """Returns stock prices for Apple company.""" yql = YQL('AAPL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price') yql.select('AAPL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price')
python
def fetch_appl(): """Returns stock prices for Apple company.""" yql = YQL('AAPL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price') yql.select('AAPL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price')
[ "def", "fetch_appl", "(", ")", ":", "yql", "=", "YQL", "(", "'AAPL'", ",", "'2014-01-01'", ",", "'2014-01-10'", ")", "for", "item", "in", "yql", ":", "print", "item", ".", "get", "(", "'date'", ")", ",", "item", ".", "get", "(", "'price'", ")", "yq...
Returns stock prices for Apple company.
[ "Returns", "stock", "prices", "for", "Apple", "company", "." ]
52b1ac6720db09c4d8a9864b171506e90a8d3964
https://github.com/slawek87/yql-finance/blob/52b1ac6720db09c4d8a9864b171506e90a8d3964/examples/stock_price.py#L4-L14
51,152
slawek87/yql-finance
examples/stock_price.py
fetch_googl
def fetch_googl(): """Returns stock prices for Google company.""" yql = YQL('GOOGL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price') yql.select('GOOGL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price')
python
def fetch_googl(): """Returns stock prices for Google company.""" yql = YQL('GOOGL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price') yql.select('GOOGL', '2014-01-01', '2014-01-10') for item in yql: print item.get('date'), item.get('price')
[ "def", "fetch_googl", "(", ")", ":", "yql", "=", "YQL", "(", "'GOOGL'", ",", "'2014-01-01'", ",", "'2014-01-10'", ")", "for", "item", "in", "yql", ":", "print", "item", ".", "get", "(", "'date'", ")", ",", "item", ".", "get", "(", "'price'", ")", "...
Returns stock prices for Google company.
[ "Returns", "stock", "prices", "for", "Google", "company", "." ]
52b1ac6720db09c4d8a9864b171506e90a8d3964
https://github.com/slawek87/yql-finance/blob/52b1ac6720db09c4d8a9864b171506e90a8d3964/examples/stock_price.py#L17-L27
51,153
yyuu/botornado
boto/ec2/volume.py
Volume.update
def update(self, validate=False): """ Update the data associated with this volume by querying EC2. :type validate: bool :param validate: By default, if EC2 returns no data about the volume the update method returns quietly. If the valid...
python
def update(self, validate=False): """ Update the data associated with this volume by querying EC2. :type validate: bool :param validate: By default, if EC2 returns no data about the volume the update method returns quietly. If the valid...
[ "def", "update", "(", "self", ",", "validate", "=", "False", ")", ":", "# Check the resultset since Eucalyptus ignores the volumeId param", "unfiltered_rs", "=", "self", ".", "connection", ".", "get_all_volumes", "(", "[", "self", ".", "id", "]", ")", "rs", "=", ...
Update the data associated with this volume by querying EC2. :type validate: bool :param validate: By default, if EC2 returns no data about the volume the update method returns quietly. If the validate param is True, however, it will ...
[ "Update", "the", "data", "associated", "with", "this", "volume", "by", "querying", "EC2", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/volume.py#L76-L94
51,154
yyuu/botornado
boto/ec2/volume.py
Volume.attach
def attach(self, instance_id, device): """ Attach this EBS volume to an EC2 instance. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device: str :param device: The device on the insta...
python
def attach(self, instance_id, device): """ Attach this EBS volume to an EC2 instance. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device: str :param device: The device on the insta...
[ "def", "attach", "(", "self", ",", "instance_id", ",", "device", ")", ":", "return", "self", ".", "connection", ".", "attach_volume", "(", "self", ".", "id", ",", "instance_id", ",", "device", ")" ]
Attach this EBS volume to an EC2 instance. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device: str :param device: The device on the instance through which the volume will be...
[ "Attach", "this", "EBS", "volume", "to", "an", "EC2", "instance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/volume.py#L105-L120
51,155
yyuu/botornado
boto/ec2/volume.py
Volume.detach
def detach(self, force=False): """ Detach this EBS volume from an EC2 instance. :type force: bool :param force: Forces detachment if the previous detachment attempt did not occur cleanly. This option can lead to data loss or a corrupted file ...
python
def detach(self, force=False): """ Detach this EBS volume from an EC2 instance. :type force: bool :param force: Forces detachment if the previous detachment attempt did not occur cleanly. This option can lead to data loss or a corrupted file ...
[ "def", "detach", "(", "self", ",", "force", "=", "False", ")", ":", "instance_id", "=", "None", "if", "self", ".", "attach_data", ":", "instance_id", "=", "self", ".", "attach_data", ".", "instance_id", "device", "=", "None", "if", "self", ".", "attach_d...
Detach this EBS volume from an EC2 instance. :type force: bool :param force: Forces detachment if the previous detachment attempt did not occur cleanly. This option can lead to data loss or a corrupted file system. Use this option only as a last ...
[ "Detach", "this", "EBS", "volume", "from", "an", "EC2", "instance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/volume.py#L122-L144
51,156
yyuu/botornado
boto/ec2/volume.py
Volume.attachment_state
def attachment_state(self): """ Get the attachment state. """ state = None if self.attach_data: state = self.attach_data.status return state
python
def attachment_state(self): """ Get the attachment state. """ state = None if self.attach_data: state = self.attach_data.status return state
[ "def", "attachment_state", "(", "self", ")", ":", "state", "=", "None", "if", "self", ".", "attach_data", ":", "state", "=", "self", ".", "attach_data", ".", "status", "return", "state" ]
Get the attachment state.
[ "Get", "the", "attachment", "state", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/volume.py#L164-L171
51,157
yyuu/botornado
boto/ec2/volume.py
Volume.snapshots
def snapshots(self, owner=None, restorable_by=None): """ Get all snapshots related to this volume. Note that this requires that all available snapshots for the account be retrieved from EC2 first and then the list is filtered client-side to contain only those for this volume. ...
python
def snapshots(self, owner=None, restorable_by=None): """ Get all snapshots related to this volume. Note that this requires that all available snapshots for the account be retrieved from EC2 first and then the list is filtered client-side to contain only those for this volume. ...
[ "def", "snapshots", "(", "self", ",", "owner", "=", "None", ",", "restorable_by", "=", "None", ")", ":", "rs", "=", "self", ".", "connection", ".", "get_all_snapshots", "(", "owner", "=", "owner", ",", "restorable_by", "=", "restorable_by", ")", "mine", ...
Get all snapshots related to this volume. Note that this requires that all available snapshots for the account be retrieved from EC2 first and then the list is filtered client-side to contain only those for this volume. :type owner: str :param owner: If present, only the snapsh...
[ "Get", "all", "snapshots", "related", "to", "this", "volume", ".", "Note", "that", "this", "requires", "that", "all", "available", "snapshots", "for", "the", "account", "be", "retrieved", "from", "EC2", "first", "and", "then", "the", "list", "is", "filtered"...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/volume.py#L173-L199
51,158
emory-libraries/eulfedora
eulfedora/cryptutil.py
encrypt
def encrypt(text): 'Encrypt a string using an encryption key based on the django SECRET_KEY' crypt = EncryptionAlgorithm.new(_get_encryption_key()) return crypt.encrypt(to_blocksize(text))
python
def encrypt(text): 'Encrypt a string using an encryption key based on the django SECRET_KEY' crypt = EncryptionAlgorithm.new(_get_encryption_key()) return crypt.encrypt(to_blocksize(text))
[ "def", "encrypt", "(", "text", ")", ":", "crypt", "=", "EncryptionAlgorithm", ".", "new", "(", "_get_encryption_key", "(", ")", ")", "return", "crypt", ".", "encrypt", "(", "to_blocksize", "(", "text", ")", ")" ]
Encrypt a string using an encryption key based on the django SECRET_KEY
[ "Encrypt", "a", "string", "using", "an", "encryption", "key", "based", "on", "the", "django", "SECRET_KEY" ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/cryptutil.py#L63-L66
51,159
emory-libraries/eulfedora
eulfedora/cryptutil.py
decrypt
def decrypt(text): 'Decrypt a string using an encryption key based on the django SECRET_KEY' crypt = EncryptionAlgorithm.new(_get_encryption_key()) return crypt.decrypt(text).rstrip(ENCRYPT_PAD_CHARACTER)
python
def decrypt(text): 'Decrypt a string using an encryption key based on the django SECRET_KEY' crypt = EncryptionAlgorithm.new(_get_encryption_key()) return crypt.decrypt(text).rstrip(ENCRYPT_PAD_CHARACTER)
[ "def", "decrypt", "(", "text", ")", ":", "crypt", "=", "EncryptionAlgorithm", ".", "new", "(", "_get_encryption_key", "(", ")", ")", "return", "crypt", ".", "decrypt", "(", "text", ")", ".", "rstrip", "(", "ENCRYPT_PAD_CHARACTER", ")" ]
Decrypt a string using an encryption key based on the django SECRET_KEY
[ "Decrypt", "a", "string", "using", "an", "encryption", "key", "based", "on", "the", "django", "SECRET_KEY" ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/cryptutil.py#L69-L72
51,160
yyuu/botornado
boto/dynamodb/layer2.py
item_object_hook
def item_object_hook(dct): """ A custom object hook for use when decoding JSON item bodys. This hook will transform Amazon DynamoDB JSON responses to something that maps directly to native Python types. """ if len(dct.keys()) > 1: return dct if 'S' in dct: return dct['S'] ...
python
def item_object_hook(dct): """ A custom object hook for use when decoding JSON item bodys. This hook will transform Amazon DynamoDB JSON responses to something that maps directly to native Python types. """ if len(dct.keys()) > 1: return dct if 'S' in dct: return dct['S'] ...
[ "def", "item_object_hook", "(", "dct", ")", ":", "if", "len", "(", "dct", ".", "keys", "(", ")", ")", ">", "1", ":", "return", "dct", "if", "'S'", "in", "dct", ":", "return", "dct", "[", "'S'", "]", "if", "'N'", "in", "dct", ":", "return", "con...
A custom object hook for use when decoding JSON item bodys. This hook will transform Amazon DynamoDB JSON responses to something that maps directly to native Python types.
[ "A", "custom", "object", "hook", "for", "use", "when", "decoding", "JSON", "item", "bodys", ".", "This", "hook", "will", "transform", "Amazon", "DynamoDB", "JSON", "responses", "to", "something", "that", "maps", "directly", "to", "native", "Python", "types", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L48-L64
51,161
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.dynamize_attribute_updates
def dynamize_attribute_updates(self, pending_updates): """ Convert a set of pending item updates into the structure required by Layer1. """ d = {} for attr_name in pending_updates: action, value = pending_updates[attr_name] if value is None: ...
python
def dynamize_attribute_updates(self, pending_updates): """ Convert a set of pending item updates into the structure required by Layer1. """ d = {} for attr_name in pending_updates: action, value = pending_updates[attr_name] if value is None: ...
[ "def", "dynamize_attribute_updates", "(", "self", ",", "pending_updates", ")", ":", "d", "=", "{", "}", "for", "attr_name", "in", "pending_updates", ":", "action", ",", "value", "=", "pending_updates", "[", "attr_name", "]", "if", "value", "is", "None", ":",...
Convert a set of pending item updates into the structure required by Layer1.
[ "Convert", "a", "set", "of", "pending", "item", "updates", "into", "the", "structure", "required", "by", "Layer1", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L75-L89
51,162
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.dynamize_range_key_condition
def dynamize_range_key_condition(self, range_key_condition): """ Convert a layer2 range_key_condition parameter into the structure required by Layer1. """ d = None if range_key_condition: d = {} for range_value in range_key_condition: ...
python
def dynamize_range_key_condition(self, range_key_condition): """ Convert a layer2 range_key_condition parameter into the structure required by Layer1. """ d = None if range_key_condition: d = {} for range_value in range_key_condition: ...
[ "def", "dynamize_range_key_condition", "(", "self", ",", "range_key_condition", ")", ":", "d", "=", "None", "if", "range_key_condition", ":", "d", "=", "{", "}", "for", "range_value", "in", "range_key_condition", ":", "range_condition", "=", "range_key_condition", ...
Convert a layer2 range_key_condition parameter into the structure required by Layer1.
[ "Convert", "a", "layer2", "range_key_condition", "parameter", "into", "the", "structure", "required", "by", "Layer1", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L97-L120
51,163
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.dynamize_scan_filter
def dynamize_scan_filter(self, scan_filter): """ Convert a layer2 scan_filter parameter into the structure required by Layer1. """ d = None if scan_filter: d = {} for attr_name, op, value in scan_filter: if op == 'BETWEEN': ...
python
def dynamize_scan_filter(self, scan_filter): """ Convert a layer2 scan_filter parameter into the structure required by Layer1. """ d = None if scan_filter: d = {} for attr_name, op, value in scan_filter: if op == 'BETWEEN': ...
[ "def", "dynamize_scan_filter", "(", "self", ",", "scan_filter", ")", ":", "d", "=", "None", "if", "scan_filter", ":", "d", "=", "{", "}", "for", "attr_name", ",", "op", ",", "value", "in", "scan_filter", ":", "if", "op", "==", "'BETWEEN'", ":", "if", ...
Convert a layer2 scan_filter parameter into the structure required by Layer1.
[ "Convert", "a", "layer2", "scan_filter", "parameter", "into", "the", "structure", "required", "by", "Layer1", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L122-L148
51,164
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.dynamize_expected_value
def dynamize_expected_value(self, expected_value): """ Convert an expected_value parameter into the data structure required for Layer1. """ d = None if expected_value: d = {} for attr_name in expected_value: attr_value = expected_va...
python
def dynamize_expected_value(self, expected_value): """ Convert an expected_value parameter into the data structure required for Layer1. """ d = None if expected_value: d = {} for attr_name in expected_value: attr_value = expected_va...
[ "def", "dynamize_expected_value", "(", "self", ",", "expected_value", ")", ":", "d", "=", "None", "if", "expected_value", ":", "d", "=", "{", "}", "for", "attr_name", "in", "expected_value", ":", "attr_value", "=", "expected_value", "[", "attr_name", "]", "i...
Convert an expected_value parameter into the data structure required for Layer1.
[ "Convert", "an", "expected_value", "parameter", "into", "the", "data", "structure", "required", "for", "Layer1", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L150-L168
51,165
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.dynamize_last_evaluated_key
def dynamize_last_evaluated_key(self, last_evaluated_key): """ Convert a last_evaluated_key parameter into the data structure required for Layer1. """ d = None if last_evaluated_key: hash_key = last_evaluated_key['HashKeyElement'] d = {'HashKeyElem...
python
def dynamize_last_evaluated_key(self, last_evaluated_key): """ Convert a last_evaluated_key parameter into the data structure required for Layer1. """ d = None if last_evaluated_key: hash_key = last_evaluated_key['HashKeyElement'] d = {'HashKeyElem...
[ "def", "dynamize_last_evaluated_key", "(", "self", ",", "last_evaluated_key", ")", ":", "d", "=", "None", "if", "last_evaluated_key", ":", "hash_key", "=", "last_evaluated_key", "[", "'HashKeyElement'", "]", "d", "=", "{", "'HashKeyElement'", ":", "self", ".", "...
Convert a last_evaluated_key parameter into the data structure required for Layer1.
[ "Convert", "a", "last_evaluated_key", "parameter", "into", "the", "data", "structure", "required", "for", "Layer1", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L170-L182
51,166
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.dynamize_request_items
def dynamize_request_items(self, batch_list): """ Convert a request_items parameter into the data structure required for Layer1. """ d = None if batch_list: d = {} for batch in batch_list: batch_dict = {} key_list = ...
python
def dynamize_request_items(self, batch_list): """ Convert a request_items parameter into the data structure required for Layer1. """ d = None if batch_list: d = {} for batch in batch_list: batch_dict = {} key_list = ...
[ "def", "dynamize_request_items", "(", "self", ",", "batch_list", ")", ":", "d", "=", "None", "if", "batch_list", ":", "d", "=", "{", "}", "for", "batch", "in", "batch_list", ":", "batch_dict", "=", "{", "}", "key_list", "=", "[", "]", "for", "key", "...
Convert a request_items parameter into the data structure required for Layer1.
[ "Convert", "a", "request_items", "parameter", "into", "the", "data", "structure", "required", "for", "Layer1", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L184-L208
51,167
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.get_dynamodb_type
def get_dynamodb_type(self, val): """ Take a scalar Python value and return a string representing the corresponding Amazon DynamoDB type. If the value passed in is not a supported type, raise a TypeError. """ dynamodb_type = None if is_num(val): dynam...
python
def get_dynamodb_type(self, val): """ Take a scalar Python value and return a string representing the corresponding Amazon DynamoDB type. If the value passed in is not a supported type, raise a TypeError. """ dynamodb_type = None if is_num(val): dynam...
[ "def", "get_dynamodb_type", "(", "self", ",", "val", ")", ":", "dynamodb_type", "=", "None", "if", "is_num", "(", "val", ")", ":", "dynamodb_type", "=", "'N'", "elif", "is_str", "(", "val", ")", ":", "dynamodb_type", "=", "'S'", "elif", "isinstance", "("...
Take a scalar Python value and return a string representing the corresponding Amazon DynamoDB type. If the value passed in is not a supported type, raise a TypeError.
[ "Take", "a", "scalar", "Python", "value", "and", "return", "a", "string", "representing", "the", "corresponding", "Amazon", "DynamoDB", "type", ".", "If", "the", "value", "passed", "in", "is", "not", "a", "supported", "type", "raise", "a", "TypeError", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L210-L228
51,168
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.dynamize_value
def dynamize_value(self, val): """ Take a scalar Python value and return a dict consisting of the Amazon DynamoDB type specification and the value that needs to be sent to Amazon DynamoDB. If the type of the value is not supported, raise a TypeError """ def _str(...
python
def dynamize_value(self, val): """ Take a scalar Python value and return a dict consisting of the Amazon DynamoDB type specification and the value that needs to be sent to Amazon DynamoDB. If the type of the value is not supported, raise a TypeError """ def _str(...
[ "def", "dynamize_value", "(", "self", ",", "val", ")", ":", "def", "_str", "(", "val", ")", ":", "\"\"\"\n DynamoDB stores booleans as numbers. True is 1, False is 0.\n This function converts Python booleans into DynamoDB friendly\n representation.\n ...
Take a scalar Python value and return a dict consisting of the Amazon DynamoDB type specification and the value that needs to be sent to Amazon DynamoDB. If the type of the value is not supported, raise a TypeError
[ "Take", "a", "scalar", "Python", "value", "and", "return", "a", "dict", "consisting", "of", "the", "Amazon", "DynamoDB", "type", "specification", "and", "the", "value", "that", "needs", "to", "be", "sent", "to", "Amazon", "DynamoDB", ".", "If", "the", "typ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L230-L256
51,169
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.build_key_from_values
def build_key_from_values(self, schema, hash_key, range_key=None): """ Build a Key structure to be used for accessing items in Amazon DynamoDB. This method takes the supplied hash_key and optional range_key and validates them against the schema. If there is a mismatch, a TypeEr...
python
def build_key_from_values(self, schema, hash_key, range_key=None): """ Build a Key structure to be used for accessing items in Amazon DynamoDB. This method takes the supplied hash_key and optional range_key and validates them against the schema. If there is a mismatch, a TypeEr...
[ "def", "build_key_from_values", "(", "self", ",", "schema", ",", "hash_key", ",", "range_key", "=", "None", ")", ":", "dynamodb_key", "=", "{", "}", "dynamodb_value", "=", "self", ".", "dynamize_value", "(", "hash_key", ")", "if", "dynamodb_value", ".", "key...
Build a Key structure to be used for accessing items in Amazon DynamoDB. This method takes the supplied hash_key and optional range_key and validates them against the schema. If there is a mismatch, a TypeError is raised. Otherwise, a Python dict version of a Amazon DynamoDB Key ...
[ "Build", "a", "Key", "structure", "to", "be", "used", "for", "accessing", "items", "in", "Amazon", "DynamoDB", ".", "This", "method", "takes", "the", "supplied", "hash_key", "and", "optional", "range_key", "and", "validates", "them", "against", "the", "schema"...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L258-L290
51,170
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.get_table
def get_table(self, name): """ Retrieve the Table object for an existing table. :type name: str :param name: The name of the desired table. :rtype: :class:`boto.dynamodb.table.Table` :return: A Table object representing the table. """ response = self.lay...
python
def get_table(self, name): """ Retrieve the Table object for an existing table. :type name: str :param name: The name of the desired table. :rtype: :class:`boto.dynamodb.table.Table` :return: A Table object representing the table. """ response = self.lay...
[ "def", "get_table", "(", "self", ",", "name", ")", ":", "response", "=", "self", ".", "layer1", ".", "describe_table", "(", "name", ")", "return", "Table", "(", "self", ",", "response", ")" ]
Retrieve the Table object for an existing table. :type name: str :param name: The name of the desired table. :rtype: :class:`boto.dynamodb.table.Table` :return: A Table object representing the table.
[ "Retrieve", "the", "Table", "object", "for", "an", "existing", "table", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L328-L339
51,171
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.delete_table
def delete_table(self, table): """ Delete this table and all items in it. After calling this the Table objects status attribute will be set to 'DELETING'. :type table: :class:`boto.dynamodb.table.Table` :param table: The Table object that is being deleted. """ r...
python
def delete_table(self, table): """ Delete this table and all items in it. After calling this the Table objects status attribute will be set to 'DELETING'. :type table: :class:`boto.dynamodb.table.Table` :param table: The Table object that is being deleted. """ r...
[ "def", "delete_table", "(", "self", ",", "table", ")", ":", "response", "=", "self", ".", "layer1", ".", "delete_table", "(", "table", ".", "name", ")", "table", ".", "update_from_response", "(", "response", ")" ]
Delete this table and all items in it. After calling this the Table objects status attribute will be set to 'DELETING'. :type table: :class:`boto.dynamodb.table.Table` :param table: The Table object that is being deleted.
[ "Delete", "this", "table", "and", "all", "items", "in", "it", ".", "After", "calling", "this", "the", "Table", "objects", "status", "attribute", "will", "be", "set", "to", "DELETING", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L385-L394
51,172
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.create_schema
def create_schema(self, hash_key_name, hash_key_proto_value, range_key_name=None, range_key_proto_value=None): """ Create a Schema object used when creating a Table. :type hash_key_name: str :param hash_key_name: The name of the HashKey for the schema. :ty...
python
def create_schema(self, hash_key_name, hash_key_proto_value, range_key_name=None, range_key_proto_value=None): """ Create a Schema object used when creating a Table. :type hash_key_name: str :param hash_key_name: The name of the HashKey for the schema. :ty...
[ "def", "create_schema", "(", "self", ",", "hash_key_name", ",", "hash_key_proto_value", ",", "range_key_name", "=", "None", ",", "range_key_proto_value", "=", "None", ")", ":", "schema", "=", "{", "}", "hash_key", "=", "{", "}", "hash_key", "[", "'AttributeNam...
Create a Schema object used when creating a Table. :type hash_key_name: str :param hash_key_name: The name of the HashKey for the schema. :type hash_key_proto_value: int|long|float|str|unicode :param hash_key_proto_value: A sample or prototype of the type of value you want ...
[ "Create", "a", "Schema", "object", "used", "when", "creating", "a", "Table", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L396-L429
51,173
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.update_item
def update_item(self, item, expected_value=None, return_values=None): """ Commit pending item updates to Amazon DynamoDB. :type item: :class:`boto.dynamodb.item.Item` :param item: The Item to update in Amazon DynamoDB. It is expected that you would have called the add_attri...
python
def update_item(self, item, expected_value=None, return_values=None): """ Commit pending item updates to Amazon DynamoDB. :type item: :class:`boto.dynamodb.item.Item` :param item: The Item to update in Amazon DynamoDB. It is expected that you would have called the add_attri...
[ "def", "update_item", "(", "self", ",", "item", ",", "expected_value", "=", "None", ",", "return_values", "=", "None", ")", ":", "expected_value", "=", "self", ".", "dynamize_expected_value", "(", "expected_value", ")", "key", "=", "self", ".", "build_key_from...
Commit pending item updates to Amazon DynamoDB. :type item: :class:`boto.dynamodb.item.Item` :param item: The Item to update in Amazon DynamoDB. It is expected that you would have called the add_attribute, put_attribute and/or delete_attribute methods on this Item prior to call...
[ "Commit", "pending", "item", "updates", "to", "Amazon", "DynamoDB", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L522-L562
51,174
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.delete_item
def delete_item(self, item, expected_value=None, return_values=None): """ Delete the item from Amazon DynamoDB. :type item: :class:`boto.dynamodb.item.Item` :param item: The Item to delete from Amazon DynamoDB. :type expected_value: dict :param expected_value: A...
python
def delete_item(self, item, expected_value=None, return_values=None): """ Delete the item from Amazon DynamoDB. :type item: :class:`boto.dynamodb.item.Item` :param item: The Item to delete from Amazon DynamoDB. :type expected_value: dict :param expected_value: A...
[ "def", "delete_item", "(", "self", ",", "item", ",", "expected_value", "=", "None", ",", "return_values", "=", "None", ")", ":", "expected_value", "=", "self", ".", "dynamize_expected_value", "(", "expected_value", ")", "key", "=", "self", ".", "build_key_from...
Delete the item from Amazon DynamoDB. :type item: :class:`boto.dynamodb.item.Item` :param item: The Item to delete from Amazon DynamoDB. :type expected_value: dict :param expected_value: A dictionary of name/value pairs that you expect. This dictionary should have n...
[ "Delete", "the", "item", "from", "Amazon", "DynamoDB", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L564-L591
51,175
yyuu/botornado
boto/dynamodb/layer2.py
Layer2.scan
def scan(self, table, scan_filter=None, attributes_to_get=None, request_limit=None, max_results=None, count=False, exclusive_start_key=None, item_class=Item): """ Perform a scan of DynamoDB. :type table: :class:`boto.dynamodb.table.Table` :param table: The Tabl...
python
def scan(self, table, scan_filter=None, attributes_to_get=None, request_limit=None, max_results=None, count=False, exclusive_start_key=None, item_class=Item): """ Perform a scan of DynamoDB. :type table: :class:`boto.dynamodb.table.Table` :param table: The Tabl...
[ "def", "scan", "(", "self", ",", "table", ",", "scan_filter", "=", "None", ",", "attributes_to_get", "=", "None", ",", "request_limit", "=", "None", ",", "max_results", "=", "None", ",", "count", "=", "False", ",", "exclusive_start_key", "=", "None", ",", ...
Perform a scan of DynamoDB. :type table: :class:`boto.dynamodb.table.Table` :param table: The Table object that is being scanned. :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, ...
[ "Perform", "a", "scan", "of", "DynamoDB", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/dynamodb/layer2.py#L686-L773
51,176
carljm/django-adminfiles
adminfiles/flickr.py
photos_search
def photos_search(user_id='', auth=False, tags='', tag_mode='', text='',\ min_upload_date='', max_upload_date='',\ min_taken_date='', max_taken_date='', \ license='', per_page='', page='', sort=''): """Returns a list of Photo objects. If auth=True then wil...
python
def photos_search(user_id='', auth=False, tags='', tag_mode='', text='',\ min_upload_date='', max_upload_date='',\ min_taken_date='', max_taken_date='', \ license='', per_page='', page='', sort=''): """Returns a list of Photo objects. If auth=True then wil...
[ "def", "photos_search", "(", "user_id", "=", "''", ",", "auth", "=", "False", ",", "tags", "=", "''", ",", "tag_mode", "=", "''", ",", "text", "=", "''", ",", "min_upload_date", "=", "''", ",", "max_upload_date", "=", "''", ",", "min_taken_date", "=", ...
Returns a list of Photo objects. If auth=True then will auth the user. Can see private etc
[ "Returns", "a", "list", "of", "Photo", "objects", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L588-L611
51,177
carljm/django-adminfiles
adminfiles/flickr.py
favorites_add
def favorites_add(photo_id): """Add a photo to the user's favorites.""" method = 'flickr.favorites.add' _dopost(method, auth=True, photo_id=photo_id) return True
python
def favorites_add(photo_id): """Add a photo to the user's favorites.""" method = 'flickr.favorites.add' _dopost(method, auth=True, photo_id=photo_id) return True
[ "def", "favorites_add", "(", "photo_id", ")", ":", "method", "=", "'flickr.favorites.add'", "_dopost", "(", "method", ",", "auth", "=", "True", ",", "photo_id", "=", "photo_id", ")", "return", "True" ]
Add a photo to the user's favorites.
[ "Add", "a", "photo", "to", "the", "user", "s", "favorites", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L669-L673
51,178
carljm/django-adminfiles
adminfiles/flickr.py
favorites_remove
def favorites_remove(photo_id): """Remove a photo from the user's favorites.""" method = 'flickr.favorites.remove' _dopost(method, auth=True, photo_id=photo_id) return True
python
def favorites_remove(photo_id): """Remove a photo from the user's favorites.""" method = 'flickr.favorites.remove' _dopost(method, auth=True, photo_id=photo_id) return True
[ "def", "favorites_remove", "(", "photo_id", ")", ":", "method", "=", "'flickr.favorites.remove'", "_dopost", "(", "method", ",", "auth", "=", "True", ",", "photo_id", "=", "photo_id", ")", "return", "True" ]
Remove a photo from the user's favorites.
[ "Remove", "a", "photo", "from", "the", "user", "s", "favorites", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L675-L679
51,179
carljm/django-adminfiles
adminfiles/flickr.py
groups_pools_getGroups
def groups_pools_getGroups(): """Get a list of groups the auth'd user can post photos to.""" method = 'flickr.groups.pools.getGroups' data = _doget(method, auth=True) groups = [] if isinstance(data.rsp.groups.group, list): for group in data.rsp.groups.group: groups.append(Group(g...
python
def groups_pools_getGroups(): """Get a list of groups the auth'd user can post photos to.""" method = 'flickr.groups.pools.getGroups' data = _doget(method, auth=True) groups = [] if isinstance(data.rsp.groups.group, list): for group in data.rsp.groups.group: groups.append(Group(g...
[ "def", "groups_pools_getGroups", "(", ")", ":", "method", "=", "'flickr.groups.pools.getGroups'", "data", "=", "_doget", "(", "method", ",", "auth", "=", "True", ")", "groups", "=", "[", "]", "if", "isinstance", "(", "data", ".", "rsp", ".", "groups", ".",...
Get a list of groups the auth'd user can post photos to.
[ "Get", "a", "list", "of", "groups", "the", "auth", "d", "user", "can", "post", "photos", "to", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L694-L706
51,180
carljm/django-adminfiles
adminfiles/flickr.py
tags_getListUserPopular
def tags_getListUserPopular(user_id='', count=''): """Gets the popular tags for a user in dictionary form tag=>count""" method = 'flickr.tags.getListUserPopular' auth = user_id == '' data = _doget(method, auth=auth, user_id=user_id) result = {} if isinstance(data.rsp.tags.tag, list): for...
python
def tags_getListUserPopular(user_id='', count=''): """Gets the popular tags for a user in dictionary form tag=>count""" method = 'flickr.tags.getListUserPopular' auth = user_id == '' data = _doget(method, auth=auth, user_id=user_id) result = {} if isinstance(data.rsp.tags.tag, list): for...
[ "def", "tags_getListUserPopular", "(", "user_id", "=", "''", ",", "count", "=", "''", ")", ":", "method", "=", "'flickr.tags.getListUserPopular'", "auth", "=", "user_id", "==", "''", "data", "=", "_doget", "(", "method", ",", "auth", "=", "auth", ",", "use...
Gets the popular tags for a user in dictionary form tag=>count
[ "Gets", "the", "popular", "tags", "for", "a", "user", "in", "dictionary", "form", "tag", "=", ">", "count" ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L719-L730
51,181
carljm/django-adminfiles
adminfiles/flickr.py
tags_getrelated
def tags_getrelated(tag): """Gets the related tags for given tag.""" method = 'flickr.tags.getRelated' data = _doget(method, auth=False, tag=tag) if isinstance(data.rsp.tags.tag, list): return [tag.text for tag in data.rsp.tags.tag] else: return [data.rsp.tags.tag.text]
python
def tags_getrelated(tag): """Gets the related tags for given tag.""" method = 'flickr.tags.getRelated' data = _doget(method, auth=False, tag=tag) if isinstance(data.rsp.tags.tag, list): return [tag.text for tag in data.rsp.tags.tag] else: return [data.rsp.tags.tag.text]
[ "def", "tags_getrelated", "(", "tag", ")", ":", "method", "=", "'flickr.tags.getRelated'", "data", "=", "_doget", "(", "method", ",", "auth", "=", "False", ",", "tag", "=", "tag", ")", "if", "isinstance", "(", "data", ".", "rsp", ".", "tags", ".", "tag...
Gets the related tags for given tag.
[ "Gets", "the", "related", "tags", "for", "given", "tag", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L732-L739
51,182
carljm/django-adminfiles
adminfiles/flickr.py
_parse_photo
def _parse_photo(photo): """Create a Photo object from photo data.""" owner = User(photo.owner) title = photo.title ispublic = photo.ispublic isfriend = photo.isfriend isfamily = photo.isfamily secret = photo.secret server = photo.server p = Photo(photo.id, owner=owner, title=title, ...
python
def _parse_photo(photo): """Create a Photo object from photo data.""" owner = User(photo.owner) title = photo.title ispublic = photo.ispublic isfriend = photo.isfriend isfamily = photo.isfamily secret = photo.secret server = photo.server p = Photo(photo.id, owner=owner, title=title, ...
[ "def", "_parse_photo", "(", "photo", ")", ":", "owner", "=", "User", "(", "photo", ".", "owner", ")", "title", "=", "photo", ".", "title", "ispublic", "=", "photo", ".", "ispublic", "isfriend", "=", "photo", ".", "isfriend", "isfamily", "=", "photo", "...
Create a Photo object from photo data.
[ "Create", "a", "Photo", "object", "from", "photo", "data", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L828-L840
51,183
carljm/django-adminfiles
adminfiles/flickr.py
Photo.getLocation
def getLocation(self): """ Return the latitude+longitutde of the picture. Returns None if no location given for this pic. """ method = 'flickr.photos.geo.getLocation' try: data = _doget(method, photo_id=self.id) except FlickrError: # Some other error m...
python
def getLocation(self): """ Return the latitude+longitutde of the picture. Returns None if no location given for this pic. """ method = 'flickr.photos.geo.getLocation' try: data = _doget(method, photo_id=self.id) except FlickrError: # Some other error m...
[ "def", "getLocation", "(", "self", ")", ":", "method", "=", "'flickr.photos.geo.getLocation'", "try", ":", "data", "=", "_doget", "(", "method", ",", "photo_id", "=", "self", ".", "id", ")", "except", "FlickrError", ":", "# Some other error might have occured too!...
Return the latitude+longitutde of the picture. Returns None if no location given for this pic.
[ "Return", "the", "latitude", "+", "longitutde", "of", "the", "picture", ".", "Returns", "None", "if", "no", "location", "given", "for", "this", "pic", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L266-L277
51,184
carljm/django-adminfiles
adminfiles/flickr.py
Photoset.getPhotos
def getPhotos(self): """Returns list of Photos.""" method = 'flickr.photosets.getPhotos' data = _doget(method, photoset_id=self.id) photos = data.rsp.photoset.photo p = [] for photo in photos: p.append(Photo(photo.id, title=photo.title, secret=photo.secret, \ ...
python
def getPhotos(self): """Returns list of Photos.""" method = 'flickr.photosets.getPhotos' data = _doget(method, photoset_id=self.id) photos = data.rsp.photoset.photo p = [] for photo in photos: p.append(Photo(photo.id, title=photo.title, secret=photo.secret, \ ...
[ "def", "getPhotos", "(", "self", ")", ":", "method", "=", "'flickr.photosets.getPhotos'", "data", "=", "_doget", "(", "method", ",", "photoset_id", "=", "self", ".", "id", ")", "photos", "=", "data", ".", "rsp", ".", "photoset", ".", "photo", "p", "=", ...
Returns list of Photos.
[ "Returns", "list", "of", "Photos", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L304-L313
51,185
carljm/django-adminfiles
adminfiles/flickr.py
Photoset.editPhotos
def editPhotos(self, photos, primary=None): """Edit the photos in this set. photos - photos for set primary - primary photo (if None will used current) """ method = 'flickr.photosets.editPhotos' if primary is None: primary = self.primary ...
python
def editPhotos(self, photos, primary=None): """Edit the photos in this set. photos - photos for set primary - primary photo (if None will used current) """ method = 'flickr.photosets.editPhotos' if primary is None: primary = self.primary ...
[ "def", "editPhotos", "(", "self", ",", "photos", ",", "primary", "=", "None", ")", ":", "method", "=", "'flickr.photosets.editPhotos'", "if", "primary", "is", "None", ":", "primary", "=", "self", ".", "primary", "ids", "=", "[", "photo", ".", "id", "for"...
Edit the photos in this set. photos - photos for set primary - primary photo (if None will used current)
[ "Edit", "the", "photos", "in", "this", "set", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L315-L334
51,186
carljm/django-adminfiles
adminfiles/flickr.py
Photoset.addPhoto
def addPhoto(self, photo): """Add a photo to this set. photo - the photo """ method = 'flickr.photosets.addPhoto' _dopost(method, auth=True, photoset_id=self.id, photo_id=photo.id) self.__count += 1 return True
python
def addPhoto(self, photo): """Add a photo to this set. photo - the photo """ method = 'flickr.photosets.addPhoto' _dopost(method, auth=True, photoset_id=self.id, photo_id=photo.id) self.__count += 1 return True
[ "def", "addPhoto", "(", "self", ",", "photo", ")", ":", "method", "=", "'flickr.photosets.addPhoto'", "_dopost", "(", "method", ",", "auth", "=", "True", ",", "photoset_id", "=", "self", ".", "id", ",", "photo_id", "=", "photo", ".", "id", ")", "self", ...
Add a photo to this set. photo - the photo
[ "Add", "a", "photo", "to", "this", "set", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L336-L346
51,187
carljm/django-adminfiles
adminfiles/flickr.py
Photoset.delete
def delete(self): """Deletes the photoset. """ method = 'flickr.photosets.delete' _dopost(method, auth=True, photoset_id=self.id) return True
python
def delete(self): """Deletes the photoset. """ method = 'flickr.photosets.delete' _dopost(method, auth=True, photoset_id=self.id) return True
[ "def", "delete", "(", "self", ")", ":", "method", "=", "'flickr.photosets.delete'", "_dopost", "(", "method", ",", "auth", "=", "True", ",", "photoset_id", "=", "self", ".", "id", ")", "return", "True" ]
Deletes the photoset.
[ "Deletes", "the", "photoset", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L376-L382
51,188
carljm/django-adminfiles
adminfiles/flickr.py
Photoset.create
def create(cls, photo, title, description=''): """Create a new photoset. photo - primary photo """ if not isinstance(photo, Photo): raise TypeError, "Photo expected" method = 'flickr.photosets.create' data = _dopost(method, auth=True, title=title,\ ...
python
def create(cls, photo, title, description=''): """Create a new photoset. photo - primary photo """ if not isinstance(photo, Photo): raise TypeError, "Photo expected" method = 'flickr.photosets.create' data = _dopost(method, auth=True, title=title,\ ...
[ "def", "create", "(", "cls", ",", "photo", ",", "title", ",", "description", "=", "''", ")", ":", "if", "not", "isinstance", "(", "photo", ",", "Photo", ")", ":", "raise", "TypeError", ",", "\"Photo expected\"", "method", "=", "'flickr.photosets.create'", ...
Create a new photoset. photo - primary photo
[ "Create", "a", "new", "photoset", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L384-L399
51,189
carljm/django-adminfiles
adminfiles/flickr.py
User._general_getattr
def _general_getattr(self, var): """Generic get attribute function.""" if getattr(self, "_%s__%s" % (self.__class__.__name__, var)) is None \ and not self.__loaded: self._load_properties() return getattr(self, "_%s__%s" % (self.__class__.__name__, var))
python
def _general_getattr(self, var): """Generic get attribute function.""" if getattr(self, "_%s__%s" % (self.__class__.__name__, var)) is None \ and not self.__loaded: self._load_properties() return getattr(self, "_%s__%s" % (self.__class__.__name__, var))
[ "def", "_general_getattr", "(", "self", ",", "var", ")", ":", "if", "getattr", "(", "self", ",", "\"_%s__%s\"", "%", "(", "self", ".", "__class__", ".", "__name__", ",", "var", ")", ")", "is", "None", "and", "not", "self", ".", "__loaded", ":", "self...
Generic get attribute function.
[ "Generic", "get", "attribute", "function", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L436-L441
51,190
carljm/django-adminfiles
adminfiles/flickr.py
User._load_properties
def _load_properties(self): """Load User properties from Flickr.""" method = 'flickr.people.getInfo' data = _doget(method, user_id=self.__id) self.__loaded = True person = data.rsp.person self.__isadmin = person.isadmin self.__ispro = person.ispro ...
python
def _load_properties(self): """Load User properties from Flickr.""" method = 'flickr.people.getInfo' data = _doget(method, user_id=self.__id) self.__loaded = True person = data.rsp.person self.__isadmin = person.isadmin self.__ispro = person.ispro ...
[ "def", "_load_properties", "(", "self", ")", ":", "method", "=", "'flickr.people.getInfo'", "data", "=", "_doget", "(", "method", ",", "user_id", "=", "self", ".", "__id", ")", "self", ".", "__loaded", "=", "True", "person", "=", "data", ".", "rsp", ".",...
Load User properties from Flickr.
[ "Load", "User", "properties", "from", "Flickr", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L443-L466
51,191
carljm/django-adminfiles
adminfiles/flickr.py
User.getPhotosets
def getPhotosets(self): """Returns a list of Photosets.""" method = 'flickr.photosets.getList' data = _doget(method, user_id=self.id) sets = [] if isinstance(data.rsp.photosets.photoset, list): for photoset in data.rsp.photosets.photoset: sets.append(P...
python
def getPhotosets(self): """Returns a list of Photosets.""" method = 'flickr.photosets.getList' data = _doget(method, user_id=self.id) sets = [] if isinstance(data.rsp.photosets.photoset, list): for photoset in data.rsp.photosets.photoset: sets.append(P...
[ "def", "getPhotosets", "(", "self", ")", ":", "method", "=", "'flickr.photosets.getList'", "data", "=", "_doget", "(", "method", ",", "user_id", "=", "self", ".", "id", ")", "sets", "=", "[", "]", "if", "isinstance", "(", "data", ".", "rsp", ".", "phot...
Returns a list of Photosets.
[ "Returns", "a", "list", "of", "Photosets", "." ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L471-L492
51,192
carljm/django-adminfiles
adminfiles/flickr.py
Group.getPhotos
def getPhotos(self, tags='', per_page='', page=''): """Get a list of photo objects for this group""" method = 'flickr.groups.pools.getPhotos' data = _doget(method, group_id=self.id, tags=tags,\ per_page=per_page, page=page) photos = [] for photo in data.rsp....
python
def getPhotos(self, tags='', per_page='', page=''): """Get a list of photo objects for this group""" method = 'flickr.groups.pools.getPhotos' data = _doget(method, group_id=self.id, tags=tags,\ per_page=per_page, page=page) photos = [] for photo in data.rsp....
[ "def", "getPhotos", "(", "self", ",", "tags", "=", "''", ",", "per_page", "=", "''", ",", "page", "=", "''", ")", ":", "method", "=", "'flickr.groups.pools.getPhotos'", "data", "=", "_doget", "(", "method", ",", "group_id", "=", "self", ".", "id", ",",...
Get a list of photo objects for this group
[ "Get", "a", "list", "of", "photo", "objects", "for", "this", "group" ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L550-L558
51,193
carljm/django-adminfiles
adminfiles/flickr.py
Group.add
def add(self, photo): """Adds a Photo to the group""" method = 'flickr.groups.pools.add' _dopost(method, auth=True, photo_id=photo.id, group_id=self.id) return True
python
def add(self, photo): """Adds a Photo to the group""" method = 'flickr.groups.pools.add' _dopost(method, auth=True, photo_id=photo.id, group_id=self.id) return True
[ "def", "add", "(", "self", ",", "photo", ")", ":", "method", "=", "'flickr.groups.pools.add'", "_dopost", "(", "method", ",", "auth", "=", "True", ",", "photo_id", "=", "photo", ".", "id", ",", "group_id", "=", "self", ".", "id", ")", "return", "True" ...
Adds a Photo to the group
[ "Adds", "a", "Photo", "to", "the", "group" ]
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/flickr.py#L560-L564
51,194
yyuu/botornado
boto/file/bucket.py
Bucket.get_all_keys
def get_all_keys(self, headers=None, **params): """ This method returns the single key around which this anonymous Bucket was instantiated. :rtype: SimpleResultSet :return: The result from file system listing the keys requested """ key = Key(self.name, self.cont...
python
def get_all_keys(self, headers=None, **params): """ This method returns the single key around which this anonymous Bucket was instantiated. :rtype: SimpleResultSet :return: The result from file system listing the keys requested """ key = Key(self.name, self.cont...
[ "def", "get_all_keys", "(", "self", ",", "headers", "=", "None", ",", "*", "*", "params", ")", ":", "key", "=", "Key", "(", "self", ".", "name", ",", "self", ".", "contained_key", ")", "return", "SimpleResultSet", "(", "[", "key", "]", ")" ]
This method returns the single key around which this anonymous Bucket was instantiated. :rtype: SimpleResultSet :return: The result from file system listing the keys requested
[ "This", "method", "returns", "the", "single", "key", "around", "which", "this", "anonymous", "Bucket", "was", "instantiated", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/file/bucket.py#L59-L69
51,195
yyuu/botornado
boto/file/bucket.py
Bucket.new_key
def new_key(self, key_name=None, key_type=Key.KEY_REGULAR_FILE): """ Creates a new key :type key_name: string :param key_name: The name of the key to create :rtype: :class:`boto.file.key.Key` :returns: An instance of the newly created key object """ if k...
python
def new_key(self, key_name=None, key_type=Key.KEY_REGULAR_FILE): """ Creates a new key :type key_name: string :param key_name: The name of the key to create :rtype: :class:`boto.file.key.Key` :returns: An instance of the newly created key object """ if k...
[ "def", "new_key", "(", "self", ",", "key_name", "=", "None", ",", "key_type", "=", "Key", ".", "KEY_REGULAR_FILE", ")", ":", "if", "key_name", "==", "'-'", ":", "return", "Key", "(", "self", ".", "name", ",", "'-'", ",", "key_type", "=", "Key", ".", ...
Creates a new key :type key_name: string :param key_name: The name of the key to create :rtype: :class:`boto.file.key.Key` :returns: An instance of the newly created key object
[ "Creates", "a", "new", "key" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/file/bucket.py#L95-L112
51,196
yyuu/botornado
botornado/sqs/connection.py
AsyncSQSConnection.delete_queue
def delete_queue(self, queue, force_deletion=False, callback=None): """ Delete an SQS Queue. :type queue: A Queue object :param queue: The SQS queue to be deleted :type force_deletion: Boolean :param force_deletion: Normally, SQS will not delete a queue that ...
python
def delete_queue(self, queue, force_deletion=False, callback=None): """ Delete an SQS Queue. :type queue: A Queue object :param queue: The SQS queue to be deleted :type force_deletion: Boolean :param force_deletion: Normally, SQS will not delete a queue that ...
[ "def", "delete_queue", "(", "self", ",", "queue", ",", "force_deletion", "=", "False", ",", "callback", "=", "None", ")", ":", "return", "self", ".", "get_status", "(", "'DeleteQueue'", ",", "None", ",", "queue", ".", "id", ",", "callback", "=", "callbac...
Delete an SQS Queue. :type queue: A Queue object :param queue: The SQS queue to be deleted :type force_deletion: Boolean :param force_deletion: Normally, SQS will not delete a queue that contains messages. However, if the ...
[ "Delete", "an", "SQS", "Queue", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/botornado/sqs/connection.py#L77-L96
51,197
yyuu/botornado
botornado/sqs/connection.py
AsyncSQSConnection.receive_message
def receive_message(self, queue, number_messages=1, visibility_timeout=None, attributes=None, callback=None): """ Read messages from an SQS Queue. :type queue: A Queue object :param queue: The Queue from which messages are read. :type number_mess...
python
def receive_message(self, queue, number_messages=1, visibility_timeout=None, attributes=None, callback=None): """ Read messages from an SQS Queue. :type queue: A Queue object :param queue: The Queue from which messages are read. :type number_mess...
[ "def", "receive_message", "(", "self", ",", "queue", ",", "number_messages", "=", "1", ",", "visibility_timeout", "=", "None", ",", "attributes", "=", "None", ",", "callback", "=", "None", ")", ":", "params", "=", "{", "'MaxNumberOfMessages'", ":", "number_m...
Read messages from an SQS Queue. :type queue: A Queue object :param queue: The Queue from which messages are read. :type number_messages: int :param number_messages: The maximum number of messages to read (default=1) :type visibi...
[ "Read", "messages", "from", "an", "SQS", "Queue", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/botornado/sqs/connection.py#L128-L165
51,198
yyuu/botornado
botornado/sqs/connection.py
AsyncSQSConnection.change_message_visibility
def change_message_visibility(self, queue, receipt_handle, visibility_timeout, callback=None): """ Extends the read lock timeout for the specified message from the specified queue to the specified value. :type queue: A :class:`boto.sqs.queue.Queue` obje...
python
def change_message_visibility(self, queue, receipt_handle, visibility_timeout, callback=None): """ Extends the read lock timeout for the specified message from the specified queue to the specified value. :type queue: A :class:`boto.sqs.queue.Queue` obje...
[ "def", "change_message_visibility", "(", "self", ",", "queue", ",", "receipt_handle", ",", "visibility_timeout", ",", "callback", "=", "None", ")", ":", "params", "=", "{", "'ReceiptHandle'", ":", "receipt_handle", ",", "'VisibilityTimeout'", ":", "visibility_timeou...
Extends the read lock timeout for the specified message from the specified queue to the specified value. :type queue: A :class:`boto.sqs.queue.Queue` object :param queue: The Queue from which messages are read. :type receipt_handle: str :param queue: The receipt handle ...
[ "Extends", "the", "read", "lock", "timeout", "for", "the", "specified", "message", "from", "the", "specified", "queue", "to", "the", "specified", "value", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/botornado/sqs/connection.py#L204-L223
51,199
yyuu/botornado
boto/rds/__init__.py
regions
def regions(): """ Get all available regions for the RDS service. :rtype: list :return: A list of :class:`boto.rds.regioninfo.RDSRegionInfo` """ return [RDSRegionInfo(name='us-east-1', endpoint='rds.us-east-1.amazonaws.com'), RDSRegionInfo(name='eu-west-1',...
python
def regions(): """ Get all available regions for the RDS service. :rtype: list :return: A list of :class:`boto.rds.regioninfo.RDSRegionInfo` """ return [RDSRegionInfo(name='us-east-1', endpoint='rds.us-east-1.amazonaws.com'), RDSRegionInfo(name='eu-west-1',...
[ "def", "regions", "(", ")", ":", "return", "[", "RDSRegionInfo", "(", "name", "=", "'us-east-1'", ",", "endpoint", "=", "'rds.us-east-1.amazonaws.com'", ")", ",", "RDSRegionInfo", "(", "name", "=", "'eu-west-1'", ",", "endpoint", "=", "'rds.eu-west-1.amazonaws.com...
Get all available regions for the RDS service. :rtype: list :return: A list of :class:`boto.rds.regioninfo.RDSRegionInfo`
[ "Get", "all", "available", "regions", "for", "the", "RDS", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/__init__.py#L33-L54