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
50,800
Trebek/pydealer
pydealer/stack.py
Stack.shuffle
def shuffle(self, times=1): """ Shuffles the Stack. .. note:: Shuffling large numbers of cards (100,000+) may take a while. :arg int times: The number of times to shuffle. """ for _ in xrange(times): random.shuffle(self.cards)
python
def shuffle(self, times=1): """ Shuffles the Stack. .. note:: Shuffling large numbers of cards (100,000+) may take a while. :arg int times: The number of times to shuffle. """ for _ in xrange(times): random.shuffle(self.cards)
[ "def", "shuffle", "(", "self", ",", "times", "=", "1", ")", ":", "for", "_", "in", "xrange", "(", "times", ")", ":", "random", ".", "shuffle", "(", "self", ".", "cards", ")" ]
Shuffles the Stack. .. note:: Shuffling large numbers of cards (100,000+) may take a while. :arg int times: The number of times to shuffle.
[ "Shuffles", "the", "Stack", "." ]
2ac583dd8c55715658c740b614387775f4dda333
https://github.com/Trebek/pydealer/blob/2ac583dd8c55715658c740b614387775f4dda333/pydealer/stack.py#L631-L643
50,801
Trebek/pydealer
pydealer/stack.py
Stack.sort
def sort(self, ranks=None): """ Sorts the stack, either by poker ranks, or big two ranks. :arg dict ranks: The rank dict to reference for sorting. If ``None``, it will default to ``DEFAULT_RANKS``. :returns: The sorted cards. """ ran...
python
def sort(self, ranks=None): """ Sorts the stack, either by poker ranks, or big two ranks. :arg dict ranks: The rank dict to reference for sorting. If ``None``, it will default to ``DEFAULT_RANKS``. :returns: The sorted cards. """ ran...
[ "def", "sort", "(", "self", ",", "ranks", "=", "None", ")", ":", "ranks", "=", "ranks", "or", "self", ".", "ranks", "self", ".", "cards", "=", "sort_cards", "(", "self", ".", "cards", ",", "ranks", ")" ]
Sorts the stack, either by poker ranks, or big two ranks. :arg dict ranks: The rank dict to reference for sorting. If ``None``, it will default to ``DEFAULT_RANKS``. :returns: The sorted cards.
[ "Sorts", "the", "stack", "either", "by", "poker", "ranks", "or", "big", "two", "ranks", "." ]
2ac583dd8c55715658c740b614387775f4dda333
https://github.com/Trebek/pydealer/blob/2ac583dd8c55715658c740b614387775f4dda333/pydealer/stack.py#L656-L669
50,802
Trebek/pydealer
pydealer/stack.py
Stack.split
def split(self, indice=None): """ Splits the Stack, either in half, or at the given indice, into two separate Stacks. :arg int indice: Optional. The indice to split the Stack at. Defaults to the middle of the ``Stack``. :returns: The two part...
python
def split(self, indice=None): """ Splits the Stack, either in half, or at the given indice, into two separate Stacks. :arg int indice: Optional. The indice to split the Stack at. Defaults to the middle of the ``Stack``. :returns: The two part...
[ "def", "split", "(", "self", ",", "indice", "=", "None", ")", ":", "self_size", "=", "self", ".", "size", "if", "self_size", ">", "1", ":", "if", "not", "indice", ":", "mid", "=", "self_size", "//", "2", "return", "Stack", "(", "cards", "=", "self"...
Splits the Stack, either in half, or at the given indice, into two separate Stacks. :arg int indice: Optional. The indice to split the Stack at. Defaults to the middle of the ``Stack``. :returns: The two parts of the Stack, as separate Stack instances.
[ "Splits", "the", "Stack", "either", "in", "half", "or", "at", "the", "given", "indice", "into", "two", "separate", "Stacks", "." ]
2ac583dd8c55715658c740b614387775f4dda333
https://github.com/Trebek/pydealer/blob/2ac583dd8c55715658c740b614387775f4dda333/pydealer/stack.py#L671-L692
50,803
guyskk/flask-restaction
flask_restaction/api.py
abort
def abort(code, error=None, message=None): """ Abort with suitable error response Args: code (int): status code error (str): error symbol or flask.Response message (str): error message """ if error is None: flask_abort(code) elif isinstance(error, Response): ...
python
def abort(code, error=None, message=None): """ Abort with suitable error response Args: code (int): status code error (str): error symbol or flask.Response message (str): error message """ if error is None: flask_abort(code) elif isinstance(error, Response): ...
[ "def", "abort", "(", "code", ",", "error", "=", "None", ",", "message", "=", "None", ")", ":", "if", "error", "is", "None", ":", "flask_abort", "(", "code", ")", "elif", "isinstance", "(", "error", ",", "Response", ")", ":", "error", ".", "status_cod...
Abort with suitable error response Args: code (int): status code error (str): error symbol or flask.Response message (str): error message
[ "Abort", "with", "suitable", "error", "response" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L42-L62
50,804
guyskk/flask-restaction
flask_restaction/api.py
export
def export(rv, code=None, headers=None): """ Create a suitable response Args: rv: return value of action code: status code headers: response headers Returns: flask.Response """ if isinstance(rv, ResponseBase): return make_response(rv, code, headers) e...
python
def export(rv, code=None, headers=None): """ Create a suitable response Args: rv: return value of action code: status code headers: response headers Returns: flask.Response """ if isinstance(rv, ResponseBase): return make_response(rv, code, headers) e...
[ "def", "export", "(", "rv", ",", "code", "=", "None", ",", "headers", "=", "None", ")", ":", "if", "isinstance", "(", "rv", ",", "ResponseBase", ")", ":", "return", "make_response", "(", "rv", ",", "code", ",", "headers", ")", "else", ":", "if", "c...
Create a suitable response Args: rv: return value of action code: status code headers: response headers Returns: flask.Response
[ "Create", "a", "suitable", "response" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L82-L100
50,805
guyskk/flask-restaction
flask_restaction/api.py
parse_docs
def parse_docs(docs, marks): """ Parse YAML syntax content from docs If docs is None, return {} If docs has no YAML content, return {"$desc": docs} Else, parse YAML content, return {"$desc": docs, YAML} Args: docs (str): docs to be parsed marks (list): list of which indicate YA...
python
def parse_docs(docs, marks): """ Parse YAML syntax content from docs If docs is None, return {} If docs has no YAML content, return {"$desc": docs} Else, parse YAML content, return {"$desc": docs, YAML} Args: docs (str): docs to be parsed marks (list): list of which indicate YA...
[ "def", "parse_docs", "(", "docs", ",", "marks", ")", ":", "if", "docs", "is", "None", ":", "return", "{", "}", "indexs", "=", "[", "]", "for", "mark", "in", "marks", ":", "i", "=", "docs", ".", "find", "(", "mark", ")", "if", "i", ">=", "0", ...
Parse YAML syntax content from docs If docs is None, return {} If docs has no YAML content, return {"$desc": docs} Else, parse YAML content, return {"$desc": docs, YAML} Args: docs (str): docs to be parsed marks (list): list of which indicate YAML content starts Returns: A ...
[ "Parse", "YAML", "syntax", "content", "from", "docs" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L103-L131
50,806
guyskk/flask-restaction
flask_restaction/api.py
get_request_data
def get_request_data(): """ Get request data based on request.method If method is GET or DELETE, get data from request.args If method is POST, PATCH or PUT, get data from request.form or request.json """ method = request.method.lower() if method in ["get", "delete"]: return request....
python
def get_request_data(): """ Get request data based on request.method If method is GET or DELETE, get data from request.args If method is POST, PATCH or PUT, get data from request.form or request.json """ method = request.method.lower() if method in ["get", "delete"]: return request....
[ "def", "get_request_data", "(", ")", ":", "method", "=", "request", ".", "method", ".", "lower", "(", ")", "if", "method", "in", "[", "\"get\"", ",", "\"delete\"", "]", ":", "return", "request", ".", "args", "elif", "method", "in", "[", "\"post\"", ","...
Get request data based on request.method If method is GET or DELETE, get data from request.args If method is POST, PATCH or PUT, get data from request.form or request.json
[ "Get", "request", "data", "based", "on", "request", ".", "method" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L134-L153
50,807
guyskk/flask-restaction
flask_restaction/api.py
get_title
def get_title(desc, default=None): """Get title of desc""" if not desc: return default lines = desc.strip('\n').split('\n') if not lines: return default return lines[0].lstrip('# ').rstrip(' ')
python
def get_title(desc, default=None): """Get title of desc""" if not desc: return default lines = desc.strip('\n').split('\n') if not lines: return default return lines[0].lstrip('# ').rstrip(' ')
[ "def", "get_title", "(", "desc", ",", "default", "=", "None", ")", ":", "if", "not", "desc", ":", "return", "default", "lines", "=", "desc", ".", "strip", "(", "'\\n'", ")", ".", "split", "(", "'\\n'", ")", "if", "not", "lines", ":", "return", "def...
Get title of desc
[ "Get", "title", "of", "desc" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L171-L178
50,808
guyskk/flask-restaction
flask_restaction/api.py
Api.make_action
def make_action(self, fn, schema_parser, meta): """ Make resource's method an action Validate input, output by schema in meta. If no input schema, call fn without params. If no output schema, will not validate return value. Args: fn: resource's method ...
python
def make_action(self, fn, schema_parser, meta): """ Make resource's method an action Validate input, output by schema in meta. If no input schema, call fn without params. If no output schema, will not validate return value. Args: fn: resource's method ...
[ "def", "make_action", "(", "self", ",", "fn", ",", "schema_parser", ",", "meta", ")", ":", "validate_input", "=", "validate_output", "=", "None", "if", "\"$input\"", "in", "meta", ":", "with", "MarkKey", "(", "\"$input\"", ")", ":", "validate_input", "=", ...
Make resource's method an action Validate input, output by schema in meta. If no input schema, call fn without params. If no output schema, will not validate return value. Args: fn: resource's method schema_parser: for parsing schema in meta meta: me...
[ "Make", "resource", "s", "method", "an", "action" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L320-L360
50,809
guyskk/flask-restaction
flask_restaction/api.py
Api.make_view
def make_view(self, action_group): """ Create a view function Check permission and Dispatch request to action by request.method """ def view(*args, **kwargs): try: httpmathod = request.method.lower() if httpmathod not in action_group: ...
python
def make_view(self, action_group): """ Create a view function Check permission and Dispatch request to action by request.method """ def view(*args, **kwargs): try: httpmathod = request.method.lower() if httpmathod not in action_group: ...
[ "def", "make_view", "(", "self", ",", "action_group", ")", ":", "def", "view", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "httpmathod", "=", "request", ".", "method", ".", "lower", "(", ")", "if", "httpmathod", "not", "in", "a...
Create a view function Check permission and Dispatch request to action by request.method
[ "Create", "a", "view", "function" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/api.py#L362-L383
50,810
yyuu/botornado
boto/sns/__init__.py
regions
def regions(): """ Get all available regions for the SNS service. :rtype: list :return: A list of :class:`boto.regioninfo.RegionInfo` instances """ return [RegionInfo(name='us-east-1', endpoint='sns.us-east-1.amazonaws.com', connection_cls=SNSConnec...
python
def regions(): """ Get all available regions for the SNS service. :rtype: list :return: A list of :class:`boto.regioninfo.RegionInfo` instances """ return [RegionInfo(name='us-east-1', endpoint='sns.us-east-1.amazonaws.com', connection_cls=SNSConnec...
[ "def", "regions", "(", ")", ":", "return", "[", "RegionInfo", "(", "name", "=", "'us-east-1'", ",", "endpoint", "=", "'sns.us-east-1.amazonaws.com'", ",", "connection_cls", "=", "SNSConnection", ")", ",", "RegionInfo", "(", "name", "=", "'eu-west-1'", ",", "en...
Get all available regions for the SNS service. :rtype: list :return: A list of :class:`boto.regioninfo.RegionInfo` instances
[ "Get", "all", "available", "regions", "for", "the", "SNS", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sns/__init__.py#L28-L56
50,811
yyuu/botornado
boto/ec2/ec2object.py
TaggedEC2Object.add_tag
def add_tag(self, key, value=''): """ Add a tag to this object. Tag's are stored by AWS and can be used to organize and filter resources. Adding a tag involves a round-trip to the EC2 service. :type key: str :param key: The key or name of the tag being stored. ...
python
def add_tag(self, key, value=''): """ Add a tag to this object. Tag's are stored by AWS and can be used to organize and filter resources. Adding a tag involves a round-trip to the EC2 service. :type key: str :param key: The key or name of the tag being stored. ...
[ "def", "add_tag", "(", "self", ",", "key", ",", "value", "=", "''", ")", ":", "status", "=", "self", ".", "connection", ".", "create_tags", "(", "[", "self", ".", "id", "]", ",", "{", "key", ":", "value", "}", ")", "if", "self", ".", "tags", "i...
Add a tag to this object. Tag's are stored by AWS and can be used to organize and filter resources. Adding a tag involves a round-trip to the EC2 service. :type key: str :param key: The key or name of the tag being stored. :type value: str :param value: An optional va...
[ "Add", "a", "tag", "to", "this", "object", ".", "Tag", "s", "are", "stored", "by", "AWS", "and", "can", "be", "used", "to", "organize", "and", "filter", "resources", ".", "Adding", "a", "tag", "involves", "a", "round", "-", "trip", "to", "the", "EC2"...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/ec2object.py#L65-L82
50,812
yyuu/botornado
boto/ec2/ec2object.py
TaggedEC2Object.remove_tag
def remove_tag(self, key, value=None): """ Remove a tag from this object. Removing a tag involves a round-trip to the EC2 service. :type key: str :param key: The key or name of the tag being stored. :type value: str :param value: An optional value that can be s...
python
def remove_tag(self, key, value=None): """ Remove a tag from this object. Removing a tag involves a round-trip to the EC2 service. :type key: str :param key: The key or name of the tag being stored. :type value: str :param value: An optional value that can be s...
[ "def", "remove_tag", "(", "self", ",", "key", ",", "value", "=", "None", ")", ":", "if", "value", ":", "tags", "=", "{", "key", ":", "value", "}", "else", ":", "tags", "=", "[", "key", "]", "status", "=", "self", ".", "connection", ".", "delete_t...
Remove a tag from this object. Removing a tag involves a round-trip to the EC2 service. :type key: str :param key: The key or name of the tag being stored. :type value: str :param value: An optional value that can be stored with the tag. If a value is pro...
[ "Remove", "a", "tag", "from", "this", "object", ".", "Removing", "a", "tag", "involves", "a", "round", "-", "trip", "to", "the", "EC2", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/ec2object.py#L84-L107
50,813
staggerpkg/stagger
stagger/specs.py
SequenceSpec.read
def read(self, frame, data): "Returns a list of values, eats all of data." seq = [] while data: elem, data = self.spec.read(frame, data) seq.append(elem) return seq, data
python
def read(self, frame, data): "Returns a list of values, eats all of data." seq = [] while data: elem, data = self.spec.read(frame, data) seq.append(elem) return seq, data
[ "def", "read", "(", "self", ",", "frame", ",", "data", ")", ":", "seq", "=", "[", "]", "while", "data", ":", "elem", ",", "data", "=", "self", ".", "spec", ".", "read", "(", "frame", ",", "data", ")", "seq", ".", "append", "(", "elem", ")", "...
Returns a list of values, eats all of data.
[ "Returns", "a", "list", "of", "values", "eats", "all", "of", "data", "." ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/specs.py#L367-L373
50,814
yyuu/botornado
boto/cloudfront/invalidation.py
InvalidationBatch.to_xml
def to_xml(self): """Get this batch as XML""" assert self.connection != None s = '<?xml version="1.0" encoding="UTF-8"?>\n' s += '<InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/%s/">\n' % self.connection.Version for p in self.paths: s += ' <Path>%s</...
python
def to_xml(self): """Get this batch as XML""" assert self.connection != None s = '<?xml version="1.0" encoding="UTF-8"?>\n' s += '<InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/%s/">\n' % self.connection.Version for p in self.paths: s += ' <Path>%s</...
[ "def", "to_xml", "(", "self", ")", ":", "assert", "self", ".", "connection", "!=", "None", "s", "=", "'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n'", "s", "+=", "'<InvalidationBatch xmlns=\"http://cloudfront.amazonaws.com/doc/%s/\">\\n'", "%", "self", ".", "connection", ...
Get this batch as XML
[ "Get", "this", "batch", "as", "XML" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/cloudfront/invalidation.py#L70-L79
50,815
yyuu/botornado
botornado/sqs/queue.py
AsyncQueue.get_messages
def get_messages(self, num_messages=1, visibility_timeout=None, attributes=None, callback=None): """ Get a variable number of messages. :type num_messages: int :param num_messages: The maximum number of messages to read from the queue. :type visibil...
python
def get_messages(self, num_messages=1, visibility_timeout=None, attributes=None, callback=None): """ Get a variable number of messages. :type num_messages: int :param num_messages: The maximum number of messages to read from the queue. :type visibil...
[ "def", "get_messages", "(", "self", ",", "num_messages", "=", "1", ",", "visibility_timeout", "=", "None", ",", "attributes", "=", "None", ",", "callback", "=", "None", ")", ":", "return", "self", ".", "connection", ".", "receive_message", "(", "self", ","...
Get a variable number of messages. :type num_messages: int :param num_messages: The maximum number of messages to read from the queue. :type visibility_timeout: int :param visibility_timeout: The VisibilityTimeout for the messages read. :type attributes: str :p...
[ "Get", "a", "variable", "number", "of", "messages", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/botornado/sqs/queue.py#L172-L198
50,816
yyuu/botornado
botornado/sqs/queue.py
AsyncQueue.delete_message
def delete_message(self, message, callback=None): """ Delete a message from the queue. :type message: :class:`boto.sqs.message.Message` :param message: The :class:`boto.sqs.message.Message` object to delete. :rtype: bool :return: True if successful, False otherwise ...
python
def delete_message(self, message, callback=None): """ Delete a message from the queue. :type message: :class:`boto.sqs.message.Message` :param message: The :class:`boto.sqs.message.Message` object to delete. :rtype: bool :return: True if successful, False otherwise ...
[ "def", "delete_message", "(", "self", ",", "message", ",", "callback", "=", "None", ")", ":", "return", "self", ".", "connection", ".", "delete_message", "(", "self", ",", "message", ",", "callback", "=", "callback", ")" ]
Delete a message from the queue. :type message: :class:`boto.sqs.message.Message` :param message: The :class:`boto.sqs.message.Message` object to delete. :rtype: bool :return: True if successful, False otherwise
[ "Delete", "a", "message", "from", "the", "queue", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/botornado/sqs/queue.py#L200-L210
50,817
slawek87/yql-finance
yql/request.py
Request.prepare_query
def prepare_query(self, symbol, start_date, end_date): """Method returns prepared request query for Yahoo YQL API.""" query = \ 'select * from yahoo.finance.historicaldata where symbol = "%s" and startDate = "%s" and endDate = "%s"' \ % (symbol, start_date, end_date) re...
python
def prepare_query(self, symbol, start_date, end_date): """Method returns prepared request query for Yahoo YQL API.""" query = \ 'select * from yahoo.finance.historicaldata where symbol = "%s" and startDate = "%s" and endDate = "%s"' \ % (symbol, start_date, end_date) re...
[ "def", "prepare_query", "(", "self", ",", "symbol", ",", "start_date", ",", "end_date", ")", ":", "query", "=", "'select * from yahoo.finance.historicaldata where symbol = \"%s\" and startDate = \"%s\" and endDate = \"%s\"'", "%", "(", "symbol", ",", "start_date", ",", "end...
Method returns prepared request query for Yahoo YQL API.
[ "Method", "returns", "prepared", "request", "query", "for", "Yahoo", "YQL", "API", "." ]
52b1ac6720db09c4d8a9864b171506e90a8d3964
https://github.com/slawek87/yql-finance/blob/52b1ac6720db09c4d8a9864b171506e90a8d3964/yql/request.py#L15-L21
50,818
slawek87/yql-finance
yql/request.py
Request.send
def send(self, symbol, start_date, end_date): """Method sends request to Yahoo YQL API.""" query = self.prepare_query(symbol, start_date, end_date) self.parameters['q'] = query response = requests.get(self.api, params=self.parameters).json() results = response['query']['results...
python
def send(self, symbol, start_date, end_date): """Method sends request to Yahoo YQL API.""" query = self.prepare_query(symbol, start_date, end_date) self.parameters['q'] = query response = requests.get(self.api, params=self.parameters).json() results = response['query']['results...
[ "def", "send", "(", "self", ",", "symbol", ",", "start_date", ",", "end_date", ")", ":", "query", "=", "self", ".", "prepare_query", "(", "symbol", ",", "start_date", ",", "end_date", ")", "self", ".", "parameters", "[", "'q'", "]", "=", "query", "resp...
Method sends request to Yahoo YQL API.
[ "Method", "sends", "request", "to", "Yahoo", "YQL", "API", "." ]
52b1ac6720db09c4d8a9864b171506e90a8d3964
https://github.com/slawek87/yql-finance/blob/52b1ac6720db09c4d8a9864b171506e90a8d3964/yql/request.py#L23-L32
50,819
yyuu/botornado
boto/sdb/db/manager/xmlmanager.py
XMLManager._make_request
def _make_request(self, method, url, post_data=None, body=None): """ Make a request on this connection """ if not self.connection: self._connect() try: self.connection.close() except: pass self.connection.connect() heade...
python
def _make_request(self, method, url, post_data=None, body=None): """ Make a request on this connection """ if not self.connection: self._connect() try: self.connection.close() except: pass self.connection.connect() heade...
[ "def", "_make_request", "(", "self", ",", "method", ",", "url", ",", "post_data", "=", "None", ",", "body", "=", "None", ")", ":", "if", "not", "self", ".", "connection", ":", "self", ".", "_connect", "(", ")", "try", ":", "self", ".", "connection", ...
Make a request on this connection
[ "Make", "a", "request", "on", "this", "connection" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/manager/xmlmanager.py#L218-L234
50,820
yyuu/botornado
boto/sdb/db/manager/xmlmanager.py
XMLManager.save_object
def save_object(self, obj, expected_value=None): """ Marshal the object and do a PUT """ doc = self.marshal_object(obj) if obj.id: url = "/%s/%s" % (self.db_name, obj.id) else: url = "/%s" % (self.db_name) resp = self._make_request("PUT", u...
python
def save_object(self, obj, expected_value=None): """ Marshal the object and do a PUT """ doc = self.marshal_object(obj) if obj.id: url = "/%s/%s" % (self.db_name, obj.id) else: url = "/%s" % (self.db_name) resp = self._make_request("PUT", u...
[ "def", "save_object", "(", "self", ",", "obj", ",", "expected_value", "=", "None", ")", ":", "doc", "=", "self", ".", "marshal_object", "(", "obj", ")", "if", "obj", ".", "id", ":", "url", "=", "\"/%s/%s\"", "%", "(", "self", ".", "db_name", ",", "...
Marshal the object and do a PUT
[ "Marshal", "the", "object", "and", "do", "a", "PUT" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/manager/xmlmanager.py#L412-L433
50,821
yyuu/botornado
boto/sdb/db/manager/xmlmanager.py
XMLManager.unmarshal_props
def unmarshal_props(self, fp, cls=None, id=None): """ Same as unmarshalling an object, except it returns from "get_props_from_doc" """ if isinstance(fp, str) or isinstance(fp, unicode): doc = parseString(fp) else: doc = parse(fp) return sel...
python
def unmarshal_props(self, fp, cls=None, id=None): """ Same as unmarshalling an object, except it returns from "get_props_from_doc" """ if isinstance(fp, str) or isinstance(fp, unicode): doc = parseString(fp) else: doc = parse(fp) return sel...
[ "def", "unmarshal_props", "(", "self", ",", "fp", ",", "cls", "=", "None", ",", "id", "=", "None", ")", ":", "if", "isinstance", "(", "fp", ",", "str", ")", "or", "isinstance", "(", "fp", ",", "unicode", ")", ":", "doc", "=", "parseString", "(", ...
Same as unmarshalling an object, except it returns from "get_props_from_doc"
[ "Same", "as", "unmarshalling", "an", "object", "except", "it", "returns", "from", "get_props_from_doc" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/manager/xmlmanager.py#L475-L484
50,822
yyuu/botornado
boto/rds/dbinstance.py
DBInstance.update
def update(self, validate=False): """ Update the DB instance's status information by making a call to fetch the current instance attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the instance the ...
python
def update(self, validate=False): """ Update the DB instance's status information by making a call to fetch the current instance attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the instance the ...
[ "def", "update", "(", "self", ",", "validate", "=", "False", ")", ":", "rs", "=", "self", ".", "connection", ".", "get_all_dbinstances", "(", "self", ".", "id", ")", "if", "len", "(", "rs", ")", ">", "0", ":", "for", "i", "in", "rs", ":", "if", ...
Update the DB instance's status information by making a call to fetch the current instance attributes from the service. :type validate: bool :param validate: By default, if EC2 returns no data about the instance the update method returns quietly. If ...
[ "Update", "the", "DB", "instance", "s", "status", "information", "by", "making", "a", "call", "to", "fetch", "the", "current", "instance", "attributes", "from", "the", "service", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/dbinstance.py#L133-L152
50,823
yyuu/botornado
boto/rds/dbinstance.py
DBInstance.stop
def stop(self, skip_final_snapshot=False, final_snapshot_id=''): """ Delete this DBInstance. :type skip_final_snapshot: bool :param skip_final_snapshot: This parameter determines whether a final db snapshot is created before the instance ...
python
def stop(self, skip_final_snapshot=False, final_snapshot_id=''): """ Delete this DBInstance. :type skip_final_snapshot: bool :param skip_final_snapshot: This parameter determines whether a final db snapshot is created before the instance ...
[ "def", "stop", "(", "self", ",", "skip_final_snapshot", "=", "False", ",", "final_snapshot_id", "=", "''", ")", ":", "return", "self", ".", "connection", ".", "delete_dbinstance", "(", "self", ".", "id", ",", "skip_final_snapshot", ",", "final_snapshot_id", ")...
Delete this DBInstance. :type skip_final_snapshot: bool :param skip_final_snapshot: This parameter determines whether a final db snapshot is created before the instance is deleted. If True, no snapshot is created. ...
[ "Delete", "this", "DBInstance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/dbinstance.py#L155-L175
50,824
yyuu/botornado
boto/rds/dbinstance.py
DBInstance.modify
def modify(self, param_group=None, security_groups=None, preferred_maintenance_window=None, master_password=None, allocated_storage=None, instance_class=None, backup_retention_period=None, preferred_backup_window=None, multi_az=Fa...
python
def modify(self, param_group=None, security_groups=None, preferred_maintenance_window=None, master_password=None, allocated_storage=None, instance_class=None, backup_retention_period=None, preferred_backup_window=None, multi_az=Fa...
[ "def", "modify", "(", "self", ",", "param_group", "=", "None", ",", "security_groups", "=", "None", ",", "preferred_maintenance_window", "=", "None", ",", "master_password", "=", "None", ",", "allocated_storage", "=", "None", ",", "instance_class", "=", "None", ...
Modify this DBInstance. :type security_groups: list of str or list of DBSecurityGroup objects :param security_groups: List of names of DBSecurityGroup to authorize on this DBInstance. :type preferred_maintenance_window: str :param preferred_maintenance_w...
[ "Modify", "this", "DBInstance", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/rds/dbinstance.py#L177-L254
50,825
yyuu/botornado
boto/sdb/db/query.py
Query.fetch
def fetch(self, limit, offset=0): """Not currently fully supported, but we can use this to allow them to set a limit in a chainable method""" self.limit = limit self.offset = offset return self
python
def fetch(self, limit, offset=0): """Not currently fully supported, but we can use this to allow them to set a limit in a chainable method""" self.limit = limit self.offset = offset return self
[ "def", "fetch", "(", "self", ",", "limit", ",", "offset", "=", "0", ")", ":", "self", ".", "limit", "=", "limit", "self", ".", "offset", "=", "offset", "return", "self" ]
Not currently fully supported, but we can use this to allow them to set a limit in a chainable method
[ "Not", "currently", "fully", "supported", "but", "we", "can", "use", "this", "to", "allow", "them", "to", "set", "a", "limit", "in", "a", "chainable", "method" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/query.py#L50-L55
50,826
yyuu/botornado
boto/sts/credentials.py
Credentials.from_json
def from_json(cls, json_doc): """ Create and return a new Session Token based on the contents of a JSON document. :type json_doc: str :param json_doc: A string containing a JSON document with a previously saved Credentials object. """ d = json.loads(j...
python
def from_json(cls, json_doc): """ Create and return a new Session Token based on the contents of a JSON document. :type json_doc: str :param json_doc: A string containing a JSON document with a previously saved Credentials object. """ d = json.loads(j...
[ "def", "from_json", "(", "cls", ",", "json_doc", ")", ":", "d", "=", "json", ".", "loads", "(", "json_doc", ")", "token", "=", "cls", "(", ")", "token", ".", "__dict__", ".", "update", "(", "d", ")", "return", "token" ]
Create and return a new Session Token based on the contents of a JSON document. :type json_doc: str :param json_doc: A string containing a JSON document with a previously saved Credentials object.
[ "Create", "and", "return", "a", "new", "Session", "Token", "based", "on", "the", "contents", "of", "a", "JSON", "document", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sts/credentials.py#L48-L60
50,827
yyuu/botornado
boto/sts/credentials.py
Credentials.load
def load(cls, file_path): """ Create and return a new Session Token based on the contents of a previously saved JSON-format file. :type file_path: str :param file_path: The fully qualified path to the JSON-format file containing the previously saved Session Token inf...
python
def load(cls, file_path): """ Create and return a new Session Token based on the contents of a previously saved JSON-format file. :type file_path: str :param file_path: The fully qualified path to the JSON-format file containing the previously saved Session Token inf...
[ "def", "load", "(", "cls", ",", "file_path", ")", ":", "fp", "=", "open", "(", "file_path", ")", "json_doc", "=", "fp", ".", "read", "(", ")", "fp", ".", "close", "(", ")", "return", "cls", ".", "from_json", "(", "json_doc", ")" ]
Create and return a new Session Token based on the contents of a previously saved JSON-format file. :type file_path: str :param file_path: The fully qualified path to the JSON-format file containing the previously saved Session Token information.
[ "Create", "and", "return", "a", "new", "Session", "Token", "based", "on", "the", "contents", "of", "a", "previously", "saved", "JSON", "-", "format", "file", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sts/credentials.py#L63-L75
50,828
yyuu/botornado
boto/sts/credentials.py
Credentials.to_dict
def to_dict(self): """ Return a Python dict containing the important information about this Session Token. """ return {'access_key': self.access_key, 'secret_key': self.secret_key, 'session_token': self.session_token, 'expiration': ...
python
def to_dict(self): """ Return a Python dict containing the important information about this Session Token. """ return {'access_key': self.access_key, 'secret_key': self.secret_key, 'session_token': self.session_token, 'expiration': ...
[ "def", "to_dict", "(", "self", ")", ":", "return", "{", "'access_key'", ":", "self", ".", "access_key", ",", "'secret_key'", ":", "self", ".", "secret_key", ",", "'session_token'", ":", "self", ".", "session_token", ",", "'expiration'", ":", "self", ".", "...
Return a Python dict containing the important information about this Session Token.
[ "Return", "a", "Python", "dict", "containing", "the", "important", "information", "about", "this", "Session", "Token", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sts/credentials.py#L94-L103
50,829
yyuu/botornado
boto/sts/credentials.py
Credentials.save
def save(self, file_path): """ Persist a Session Token to a file in JSON format. :type path: str :param path: The fully qualified path to the file where the the Session Token data should be written. Any previous data in the file will be overwritten. To help pro...
python
def save(self, file_path): """ Persist a Session Token to a file in JSON format. :type path: str :param path: The fully qualified path to the file where the the Session Token data should be written. Any previous data in the file will be overwritten. To help pro...
[ "def", "save", "(", "self", ",", "file_path", ")", ":", "fp", "=", "open", "(", "file_path", ",", "'wb'", ")", "json", ".", "dump", "(", "self", ".", "to_dict", "(", ")", ",", "fp", ")", "fp", ".", "close", "(", ")", "os", ".", "chmod", "(", ...
Persist a Session Token to a file in JSON format. :type path: str :param path: The fully qualified path to the file where the the Session Token data should be written. Any previous data in the file will be overwritten. To help protect the credentials contained in t...
[ "Persist", "a", "Session", "Token", "to", "a", "file", "in", "JSON", "format", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sts/credentials.py#L105-L119
50,830
yyuu/botornado
boto/sts/credentials.py
Credentials.is_expired
def is_expired(self, time_offset_seconds=0): """ Checks to see if the Session Token is expired or not. By default it will check to see if the Session Token is expired as of the moment the method is called. However, you can supply an optional parameter which is the number of sec...
python
def is_expired(self, time_offset_seconds=0): """ Checks to see if the Session Token is expired or not. By default it will check to see if the Session Token is expired as of the moment the method is called. However, you can supply an optional parameter which is the number of sec...
[ "def", "is_expired", "(", "self", ",", "time_offset_seconds", "=", "0", ")", ":", "now", "=", "datetime", ".", "datetime", ".", "utcnow", "(", ")", "if", "time_offset_seconds", ":", "now", "=", "now", "+", "datetime", ".", "timedelta", "(", "seconds", "=...
Checks to see if the Session Token is expired or not. By default it will check to see if the Session Token is expired as of the moment the method is called. However, you can supply an optional parameter which is the number of seconds of offset into the future for the check. For exampl...
[ "Checks", "to", "see", "if", "the", "Session", "Token", "is", "expired", "or", "not", ".", "By", "default", "it", "will", "check", "to", "see", "if", "the", "Session", "Token", "is", "expired", "as", "of", "the", "moment", "the", "method", "is", "calle...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sts/credentials.py#L121-L140
50,831
yyuu/botornado
boto/pyami/installers/__init__.py
Installer.add_cron
def add_cron(self, name, minute, hour, mday, month, wday, who, command, env=None): """ Add an entry to the system crontab. """ raise NotImplementedError
python
def add_cron(self, name, minute, hour, mday, month, wday, who, command, env=None): """ Add an entry to the system crontab. """ raise NotImplementedError
[ "def", "add_cron", "(", "self", ",", "name", ",", "minute", ",", "hour", ",", "mday", ",", "month", ",", "wday", ",", "who", ",", "command", ",", "env", "=", "None", ")", ":", "raise", "NotImplementedError" ]
Add an entry to the system crontab.
[ "Add", "an", "entry", "to", "the", "system", "crontab", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/pyami/installers/__init__.py#L30-L34
50,832
idlesign/pysyge
pysyge/pysyge.py
GeoLocator.get_location
def get_location(self, ip, detailed=False): """Returns a dictionary with location data or False on failure. Amount of information about IP contained in the dictionary depends upon `detailed` flag state. """ seek = self._get_pos(ip) if seek > 0: return self....
python
def get_location(self, ip, detailed=False): """Returns a dictionary with location data or False on failure. Amount of information about IP contained in the dictionary depends upon `detailed` flag state. """ seek = self._get_pos(ip) if seek > 0: return self....
[ "def", "get_location", "(", "self", ",", "ip", ",", "detailed", "=", "False", ")", ":", "seek", "=", "self", ".", "_get_pos", "(", "ip", ")", "if", "seek", ">", "0", ":", "return", "self", ".", "_parse_location", "(", "seek", ",", "detailed", "=", ...
Returns a dictionary with location data or False on failure. Amount of information about IP contained in the dictionary depends upon `detailed` flag state.
[ "Returns", "a", "dictionary", "with", "location", "data", "or", "False", "on", "failure", "." ]
24a3d9c9a82438f3327a3dc801984b50fd1f0fee
https://github.com/idlesign/pysyge/blob/24a3d9c9a82438f3327a3dc801984b50fd1f0fee/pysyge/pysyge.py#L408-L420
50,833
idlesign/pysyge
pysyge/pysyge.py
GeoLocator.get_locations
def get_locations(self, ip, detailed=False): """Returns a list of dictionaries with location data or False on failure. Argument `ip` must be an iterable object. Amount of information about IP contained in the dictionary depends upon `detailed` flag state. """ if...
python
def get_locations(self, ip, detailed=False): """Returns a list of dictionaries with location data or False on failure. Argument `ip` must be an iterable object. Amount of information about IP contained in the dictionary depends upon `detailed` flag state. """ if...
[ "def", "get_locations", "(", "self", ",", "ip", ",", "detailed", "=", "False", ")", ":", "if", "isinstance", "(", "ip", ",", "str", ")", ":", "ip", "=", "[", "ip", "]", "seek", "=", "map", "(", "self", ".", "_get_pos", ",", "ip", ")", "return", ...
Returns a list of dictionaries with location data or False on failure. Argument `ip` must be an iterable object. Amount of information about IP contained in the dictionary depends upon `detailed` flag state.
[ "Returns", "a", "list", "of", "dictionaries", "with", "location", "data", "or", "False", "on", "failure", ".", "Argument", "ip", "must", "be", "an", "iterable", "object", ".", "Amount", "of", "information", "about", "IP", "contained", "in", "the", "dictionar...
24a3d9c9a82438f3327a3dc801984b50fd1f0fee
https://github.com/idlesign/pysyge/blob/24a3d9c9a82438f3327a3dc801984b50fd1f0fee/pysyge/pysyge.py#L422-L434
50,834
yyuu/botornado
boto/auth.py
get_auth_handler
def get_auth_handler(host, config, provider, requested_capability=None): """Finds an AuthHandler that is ready to authenticate. Lists through all the registered AuthHandlers to find one that is willing to handle for the requested capabilities, config and provider. :type host: string :param host: T...
python
def get_auth_handler(host, config, provider, requested_capability=None): """Finds an AuthHandler that is ready to authenticate. Lists through all the registered AuthHandlers to find one that is willing to handle for the requested capabilities, config and provider. :type host: string :param host: T...
[ "def", "get_auth_handler", "(", "host", ",", "config", ",", "provider", ",", "requested_capability", "=", "None", ")", ":", "ready_handlers", "=", "[", "]", "auth_handlers", "=", "boto", ".", "plugin", ".", "get_plugin", "(", "AuthHandler", ",", "requested_cap...
Finds an AuthHandler that is ready to authenticate. Lists through all the registered AuthHandlers to find one that is willing to handle for the requested capabilities, config and provider. :type host: string :param host: The name of the host :type config: :param config: :type provider: ...
[ "Finds", "an", "AuthHandler", "that", "is", "ready", "to", "authenticate", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/auth.py#L369-L422
50,835
yyuu/botornado
boto/auth.py
HmacAuthV3HTTPHandler.headers_to_sign
def headers_to_sign(self, http_request): """ Select the headers from the request that need to be included in the StringToSign. """ headers_to_sign = {} headers_to_sign = {'Host' : self.host} for name, value in http_request.headers.items(): lname = name...
python
def headers_to_sign(self, http_request): """ Select the headers from the request that need to be included in the StringToSign. """ headers_to_sign = {} headers_to_sign = {'Host' : self.host} for name, value in http_request.headers.items(): lname = name...
[ "def", "headers_to_sign", "(", "self", ",", "http_request", ")", ":", "headers_to_sign", "=", "{", "}", "headers_to_sign", "=", "{", "'Host'", ":", "self", ".", "host", "}", "for", "name", ",", "value", "in", "http_request", ".", "headers", ".", "items", ...
Select the headers from the request that need to be included in the StringToSign.
[ "Select", "the", "headers", "from", "the", "request", "that", "need", "to", "be", "included", "in", "the", "StringToSign", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/auth.py#L198-L209
50,836
yyuu/botornado
boto/auth.py
HmacAuthV3HTTPHandler.canonical_headers
def canonical_headers(self, headers_to_sign): """ Return the headers that need to be included in the StringToSign in their canonical form by converting all header keys to lower case, sorting them in alphabetical order and then joining them into a string, separated by newlines. ...
python
def canonical_headers(self, headers_to_sign): """ Return the headers that need to be included in the StringToSign in their canonical form by converting all header keys to lower case, sorting them in alphabetical order and then joining them into a string, separated by newlines. ...
[ "def", "canonical_headers", "(", "self", ",", "headers_to_sign", ")", ":", "l", "=", "[", "'%s:%s'", "%", "(", "n", ".", "lower", "(", ")", ".", "strip", "(", ")", ",", "headers_to_sign", "[", "n", "]", ".", "strip", "(", ")", ")", "for", "n", "i...
Return the headers that need to be included in the StringToSign in their canonical form by converting all header keys to lower case, sorting them in alphabetical order and then joining them into a string, separated by newlines.
[ "Return", "the", "headers", "that", "need", "to", "be", "included", "in", "the", "StringToSign", "in", "their", "canonical", "form", "by", "converting", "all", "header", "keys", "to", "lower", "case", "sorting", "them", "in", "alphabetical", "order", "and", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/auth.py#L211-L221
50,837
yyuu/botornado
boto/auth.py
HmacAuthV3HTTPHandler.string_to_sign
def string_to_sign(self, http_request): """ Return the canonical StringToSign as well as a dict containing the original version of all headers that were included in the StringToSign. """ headers_to_sign = self.headers_to_sign(http_request) canonical_headers = self...
python
def string_to_sign(self, http_request): """ Return the canonical StringToSign as well as a dict containing the original version of all headers that were included in the StringToSign. """ headers_to_sign = self.headers_to_sign(http_request) canonical_headers = self...
[ "def", "string_to_sign", "(", "self", ",", "http_request", ")", ":", "headers_to_sign", "=", "self", ".", "headers_to_sign", "(", "http_request", ")", "canonical_headers", "=", "self", ".", "canonical_headers", "(", "headers_to_sign", ")", "string_to_sign", "=", "...
Return the canonical StringToSign as well as a dict containing the original version of all headers that were included in the StringToSign.
[ "Return", "the", "canonical", "StringToSign", "as", "well", "as", "a", "dict", "containing", "the", "original", "version", "of", "all", "headers", "that", "were", "included", "in", "the", "StringToSign", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/auth.py#L223-L237
50,838
yyuu/botornado
boto/auth.py
HmacAuthV3HTTPHandler.add_auth
def add_auth(self, req, **kwargs): """ Add AWS3 authentication to a request. :type req: :class`boto.connection.HTTPRequest` :param req: The HTTPRequest object. """ # This could be a retry. Make sure the previous # authorization header is removed first. i...
python
def add_auth(self, req, **kwargs): """ Add AWS3 authentication to a request. :type req: :class`boto.connection.HTTPRequest` :param req: The HTTPRequest object. """ # This could be a retry. Make sure the previous # authorization header is removed first. i...
[ "def", "add_auth", "(", "self", ",", "req", ",", "*", "*", "kwargs", ")", ":", "# This could be a retry. Make sure the previous", "# authorization header is removed first.", "if", "'X-Amzn-Authorization'", "in", "req", ".", "headers", ":", "del", "req", ".", "headers...
Add AWS3 authentication to a request. :type req: :class`boto.connection.HTTPRequest` :param req: The HTTPRequest object.
[ "Add", "AWS3", "authentication", "to", "a", "request", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/auth.py#L239-L260
50,839
yyuu/botornado
boto/plugin.py
Plugin.is_capable
def is_capable(cls, requested_capability): """Returns true if the requested capability is supported by this plugin """ for c in requested_capability: if not c in cls.capability: return False return True
python
def is_capable(cls, requested_capability): """Returns true if the requested capability is supported by this plugin """ for c in requested_capability: if not c in cls.capability: return False return True
[ "def", "is_capable", "(", "cls", ",", "requested_capability", ")", ":", "for", "c", "in", "requested_capability", ":", "if", "not", "c", "in", "cls", ".", "capability", ":", "return", "False", "return", "True" ]
Returns true if the requested capability is supported by this plugin
[ "Returns", "true", "if", "the", "requested", "capability", "is", "supported", "by", "this", "plugin" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/plugin.py#L49-L55
50,840
yyuu/botornado
boto/connection.py
HostConnectionPool.get
def get(self): """ Returns the next connection in this pool that is ready to be reused. Returns None of there aren't any. """ # Discard ready connections that are too old. self.clean() # Return the first connection that is ready, and remove it # from the...
python
def get(self): """ Returns the next connection in this pool that is ready to be reused. Returns None of there aren't any. """ # Discard ready connections that are too old. self.clean() # Return the first connection that is ready, and remove it # from the...
[ "def", "get", "(", "self", ")", ":", "# Discard ready connections that are too old.", "self", ".", "clean", "(", ")", "# Return the first connection that is ready, and remove it", "# from the queue. Connections that aren't ready are returned", "# to the end of the queue with an updated ...
Returns the next connection in this pool that is ready to be reused. Returns None of there aren't any.
[ "Returns", "the", "next", "connection", "in", "this", "pool", "that", "is", "ready", "to", "be", "reused", ".", "Returns", "None", "of", "there", "aren", "t", "any", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/connection.py#L138-L156
50,841
yyuu/botornado
boto/connection.py
HostConnectionPool.clean
def clean(self): """ Get rid of stale connections. """ # Note that we do not close the connection here -- somebody # may still be reading from it. while len(self.queue) > 0 and self._pair_stale(self.queue[0]): self.queue.pop(0)
python
def clean(self): """ Get rid of stale connections. """ # Note that we do not close the connection here -- somebody # may still be reading from it. while len(self.queue) > 0 and self._pair_stale(self.queue[0]): self.queue.pop(0)
[ "def", "clean", "(", "self", ")", ":", "# Note that we do not close the connection here -- somebody", "# may still be reading from it.", "while", "len", "(", "self", ".", "queue", ")", ">", "0", "and", "self", ".", "_pair_stale", "(", "self", ".", "queue", "[", "0...
Get rid of stale connections.
[ "Get", "rid", "of", "stale", "connections", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/connection.py#L181-L188
50,842
yyuu/botornado
boto/connection.py
ConnectionPool.put_http_connection
def put_http_connection(self, host, is_secure, conn): """ Adds a connection to the pool of connections that can be reused for the named host. """ with self.mutex: key = (host, is_secure) if key not in self.host_to_pool: self.host_to_pool[ke...
python
def put_http_connection(self, host, is_secure, conn): """ Adds a connection to the pool of connections that can be reused for the named host. """ with self.mutex: key = (host, is_secure) if key not in self.host_to_pool: self.host_to_pool[ke...
[ "def", "put_http_connection", "(", "self", ",", "host", ",", "is_secure", ",", "conn", ")", ":", "with", "self", ".", "mutex", ":", "key", "=", "(", "host", ",", "is_secure", ")", "if", "key", "not", "in", "self", ".", "host_to_pool", ":", "self", "....
Adds a connection to the pool of connections that can be reused for the named host.
[ "Adds", "a", "connection", "to", "the", "pool", "of", "connections", "that", "can", "be", "reused", "for", "the", "named", "host", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/connection.py#L256-L265
50,843
yyuu/botornado
boto/connection.py
ConnectionPool.clean
def clean(self): """ Clean up the stale connections in all of the pools, and then get rid of empty pools. Pools clean themselves every time a connection is fetched; this cleaning takes care of pools that aren't being used any more, so nothing is being gotten from them. ...
python
def clean(self): """ Clean up the stale connections in all of the pools, and then get rid of empty pools. Pools clean themselves every time a connection is fetched; this cleaning takes care of pools that aren't being used any more, so nothing is being gotten from them. ...
[ "def", "clean", "(", "self", ")", ":", "with", "self", ".", "mutex", ":", "now", "=", "time", ".", "time", "(", ")", "if", "self", ".", "last_clean_time", "+", "self", ".", "CLEAN_INTERVAL", "<", "now", ":", "to_remove", "=", "[", "]", "for", "(", ...
Clean up the stale connections in all of the pools, and then get rid of empty pools. Pools clean themselves every time a connection is fetched; this cleaning takes care of pools that aren't being used any more, so nothing is being gotten from them.
[ "Clean", "up", "the", "stale", "connections", "in", "all", "of", "the", "pools", "and", "then", "get", "rid", "of", "empty", "pools", ".", "Pools", "clean", "themselves", "every", "time", "a", "connection", "is", "fetched", ";", "this", "cleaning", "takes"...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/connection.py#L267-L285
50,844
yyuu/botornado
boto/connection.py
AWSAuthConnection.make_request
def make_request(self, method, path, headers=None, data='', host=None, auth_path=None, sender=None, override_num_retries=None): """Makes a request to the server, with stock multiple-retry logic.""" http_request = self.build_base_http_request(method, path, auth_path, ...
python
def make_request(self, method, path, headers=None, data='', host=None, auth_path=None, sender=None, override_num_retries=None): """Makes a request to the server, with stock multiple-retry logic.""" http_request = self.build_base_http_request(method, path, auth_path, ...
[ "def", "make_request", "(", "self", ",", "method", ",", "path", ",", "headers", "=", "None", ",", "data", "=", "''", ",", "host", "=", "None", ",", "auth_path", "=", "None", ",", "sender", "=", "None", ",", "override_num_retries", "=", "None", ")", "...
Makes a request to the server, with stock multiple-retry logic.
[ "Makes", "a", "request", "to", "the", "server", "with", "stock", "multiple", "-", "retry", "logic", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/connection.py#L824-L829
50,845
AtsushiSakai/SimpleTkGUIKit
SimpleTkGUIKit/SimpleTkGUIKit.py
GetFilePathsWithDialog
def GetFilePathsWithDialog(fileTypes=[]): """ Multipul File Select with dialog fileTypes: you can choise file extension ex) fileTypes=[('Excel Files', '.xlsx')] """ root = tkinter.Tk() root.withdraw() filepath = filedialog.askopenfilenames( filetypes=fileTypes, p...
python
def GetFilePathsWithDialog(fileTypes=[]): """ Multipul File Select with dialog fileTypes: you can choise file extension ex) fileTypes=[('Excel Files', '.xlsx')] """ root = tkinter.Tk() root.withdraw() filepath = filedialog.askopenfilenames( filetypes=fileTypes, p...
[ "def", "GetFilePathsWithDialog", "(", "fileTypes", "=", "[", "]", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "withdraw", "(", ")", "filepath", "=", "filedialog", ".", "askopenfilenames", "(", "filetypes", "=", "fileTypes", ",", "...
Multipul File Select with dialog fileTypes: you can choise file extension ex) fileTypes=[('Excel Files', '.xlsx')]
[ "Multipul", "File", "Select", "with", "dialog" ]
e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0
https://github.com/AtsushiSakai/SimpleTkGUIKit/blob/e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0/SimpleTkGUIKit/SimpleTkGUIKit.py#L12-L34
50,846
AtsushiSakai/SimpleTkGUIKit
SimpleTkGUIKit/SimpleTkGUIKit.py
GetRadioButtonSelect
def GetRadioButtonSelect(selectList, title="Select", msg=""): """ Create radio button window for option selection title: Window name mag: Label of the radio button return (seldctedItem, selectedindex) """ root = tkinter.Tk() root.title(title) val = tkinter.IntVar() val.set(0) ...
python
def GetRadioButtonSelect(selectList, title="Select", msg=""): """ Create radio button window for option selection title: Window name mag: Label of the radio button return (seldctedItem, selectedindex) """ root = tkinter.Tk() root.title(title) val = tkinter.IntVar() val.set(0) ...
[ "def", "GetRadioButtonSelect", "(", "selectList", ",", "title", "=", "\"Select\"", ",", "msg", "=", "\"\"", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "title", "(", "title", ")", "val", "=", "tkinter", ".", "IntVar", "(", ")"...
Create radio button window for option selection title: Window name mag: Label of the radio button return (seldctedItem, selectedindex)
[ "Create", "radio", "button", "window", "for", "option", "selection" ]
e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0
https://github.com/AtsushiSakai/SimpleTkGUIKit/blob/e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0/SimpleTkGUIKit/SimpleTkGUIKit.py#L37-L65
50,847
AtsushiSakai/SimpleTkGUIKit
SimpleTkGUIKit/SimpleTkGUIKit.py
GetListSelect
def GetListSelect(selectList, title="Select", msg=""): """ Create list with selectList, and then return seleced string and index title: Window name mag: Label of the list return (seldctedItem, selectedindex) """ root = tkinter.Tk() root.title(title) label = tkinter.Label(root...
python
def GetListSelect(selectList, title="Select", msg=""): """ Create list with selectList, and then return seleced string and index title: Window name mag: Label of the list return (seldctedItem, selectedindex) """ root = tkinter.Tk() root.title(title) label = tkinter.Label(root...
[ "def", "GetListSelect", "(", "selectList", ",", "title", "=", "\"Select\"", ",", "msg", "=", "\"\"", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "title", "(", "title", ")", "label", "=", "tkinter", ".", "Label", "(", "root", ...
Create list with selectList, and then return seleced string and index title: Window name mag: Label of the list return (seldctedItem, selectedindex)
[ "Create", "list", "with", "selectList", "and", "then", "return", "seleced", "string", "and", "index" ]
e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0
https://github.com/AtsushiSakai/SimpleTkGUIKit/blob/e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0/SimpleTkGUIKit/SimpleTkGUIKit.py#L68-L96
50,848
AtsushiSakai/SimpleTkGUIKit
SimpleTkGUIKit/SimpleTkGUIKit.py
GetCheckButtonSelect
def GetCheckButtonSelect(selectList, title="Select", msg=""): """ Get selected check button options title: Window name mag: Label of the check button return selected dictionary {'sample b': False, 'sample c': False, 'sample a': False} """ root = tkinter.Tk() root.title(title) ...
python
def GetCheckButtonSelect(selectList, title="Select", msg=""): """ Get selected check button options title: Window name mag: Label of the check button return selected dictionary {'sample b': False, 'sample c': False, 'sample a': False} """ root = tkinter.Tk() root.title(title) ...
[ "def", "GetCheckButtonSelect", "(", "selectList", ",", "title", "=", "\"Select\"", ",", "msg", "=", "\"\"", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "title", "(", "title", ")", "label", "=", "tkinter", ".", "Label", "(", "r...
Get selected check button options title: Window name mag: Label of the check button return selected dictionary {'sample b': False, 'sample c': False, 'sample a': False}
[ "Get", "selected", "check", "button", "options" ]
e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0
https://github.com/AtsushiSakai/SimpleTkGUIKit/blob/e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0/SimpleTkGUIKit/SimpleTkGUIKit.py#L99-L131
50,849
AtsushiSakai/SimpleTkGUIKit
SimpleTkGUIKit/SimpleTkGUIKit.py
GetEntries
def GetEntries(dataList, title="Select", msg=""): """ Get entries of the list title: Window name mag: Label of the check button return data dictionary like: {'y': '5.0', 'x': '100', 'z': 'save'} """ root = tkinter.Tk() root.title(title) label = tkinter.Label(root, text=msg) ...
python
def GetEntries(dataList, title="Select", msg=""): """ Get entries of the list title: Window name mag: Label of the check button return data dictionary like: {'y': '5.0', 'x': '100', 'z': 'save'} """ root = tkinter.Tk() root.title(title) label = tkinter.Label(root, text=msg) ...
[ "def", "GetEntries", "(", "dataList", ",", "title", "=", "\"Select\"", ",", "msg", "=", "\"\"", ")", ":", "root", "=", "tkinter", ".", "Tk", "(", ")", "root", ".", "title", "(", "title", ")", "label", "=", "tkinter", ".", "Label", "(", "root", ",",...
Get entries of the list title: Window name mag: Label of the check button return data dictionary like: {'y': '5.0', 'x': '100', 'z': 'save'}
[ "Get", "entries", "of", "the", "list" ]
e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0
https://github.com/AtsushiSakai/SimpleTkGUIKit/blob/e7cbb06ff32afb165cdaa4fe396ca2f172c66ff0/SimpleTkGUIKit/SimpleTkGUIKit.py#L134-L167
50,850
yyuu/botornado
boto/ec2/securitygroup.py
SecurityGroup.add_rule
def add_rule(self, ip_protocol, from_port, to_port, src_group_name, src_group_owner_id, cidr_ip): """ Add a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2. """ rule = I...
python
def add_rule(self, ip_protocol, from_port, to_port, src_group_name, src_group_owner_id, cidr_ip): """ Add a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2. """ rule = I...
[ "def", "add_rule", "(", "self", ",", "ip_protocol", ",", "from_port", ",", "to_port", ",", "src_group_name", ",", "src_group_owner_id", ",", "cidr_ip", ")", ":", "rule", "=", "IPPermissions", "(", "self", ")", "rule", ".", "ip_protocol", "=", "ip_protocol", ...
Add a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2.
[ "Add", "a", "rule", "to", "the", "SecurityGroup", "object", ".", "Note", "that", "this", "method", "only", "changes", "the", "local", "version", "of", "the", "object", ".", "No", "information", "is", "sent", "to", "EC2", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/securitygroup.py#L87-L99
50,851
yyuu/botornado
boto/ec2/securitygroup.py
SecurityGroup.remove_rule
def remove_rule(self, ip_protocol, from_port, to_port, src_group_name, src_group_owner_id, cidr_ip): """ Remove a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2. """ ...
python
def remove_rule(self, ip_protocol, from_port, to_port, src_group_name, src_group_owner_id, cidr_ip): """ Remove a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2. """ ...
[ "def", "remove_rule", "(", "self", ",", "ip_protocol", ",", "from_port", ",", "to_port", ",", "src_group_name", ",", "src_group_owner_id", ",", "cidr_ip", ")", ":", "target_rule", "=", "None", "for", "rule", "in", "self", ".", "rules", ":", "if", "rule", "...
Remove a rule to the SecurityGroup object. Note that this method only changes the local version of the object. No information is sent to EC2.
[ "Remove", "a", "rule", "to", "the", "SecurityGroup", "object", ".", "Note", "that", "this", "method", "only", "changes", "the", "local", "version", "of", "the", "object", ".", "No", "information", "is", "sent", "to", "EC2", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/securitygroup.py#L101-L123
50,852
yyuu/botornado
boto/ec2/securitygroup.py
SecurityGroup.copy_to_region
def copy_to_region(self, region, name=None): """ Create a copy of this security group in another region. Note that the new security group will be a separate entity and will not stay in sync automatically after the copy operation. :type region: :class:`boto.ec2.regioninfo...
python
def copy_to_region(self, region, name=None): """ Create a copy of this security group in another region. Note that the new security group will be a separate entity and will not stay in sync automatically after the copy operation. :type region: :class:`boto.ec2.regioninfo...
[ "def", "copy_to_region", "(", "self", ",", "region", ",", "name", "=", "None", ")", ":", "if", "region", ".", "name", "==", "self", ".", "region", ":", "raise", "BotoClientError", "(", "'Unable to copy to the same Region'", ")", "conn_params", "=", "self", "...
Create a copy of this security group in another region. Note that the new security group will be a separate entity and will not stay in sync automatically after the copy operation. :type region: :class:`boto.ec2.regioninfo.RegionInfo` :param region: The region to which this secu...
[ "Create", "a", "copy", "of", "this", "security", "group", "in", "another", "region", ".", "Note", "that", "the", "new", "security", "group", "will", "be", "a", "separate", "entity", "and", "will", "not", "stay", "in", "sync", "automatically", "after", "the...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/securitygroup.py#L194-L226
50,853
yyuu/botornado
boto/ec2/securitygroup.py
SecurityGroup.instances
def instances(self): """ Find all of the current instances that are running within this security group. :rtype: list of :class:`boto.ec2.instance.Instance` :return: A list of Instance objects """ # It would be more efficient to do this with filters now # ...
python
def instances(self): """ Find all of the current instances that are running within this security group. :rtype: list of :class:`boto.ec2.instance.Instance` :return: A list of Instance objects """ # It would be more efficient to do this with filters now # ...
[ "def", "instances", "(", "self", ")", ":", "# It would be more efficient to do this with filters now", "# but not all services that implement EC2 API support filters.", "instances", "=", "[", "]", "rs", "=", "self", ".", "connection", ".", "get_all_instances", "(", ")", "fo...
Find all of the current instances that are running within this security group. :rtype: list of :class:`boto.ec2.instance.Instance` :return: A list of Instance objects
[ "Find", "all", "of", "the", "current", "instances", "that", "are", "running", "within", "this", "security", "group", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/securitygroup.py#L228-L244
50,854
yyuu/botornado
boto/s3/connection.py
S3Connection.build_post_policy
def build_post_policy(self, expiration_time, conditions): """ Taken from the AWS book Python examples and modified for use with boto """ assert type(expiration_time) == time.struct_time, \ 'Policy document must include a valid expiration Time object' # Convert condit...
python
def build_post_policy(self, expiration_time, conditions): """ Taken from the AWS book Python examples and modified for use with boto """ assert type(expiration_time) == time.struct_time, \ 'Policy document must include a valid expiration Time object' # Convert condit...
[ "def", "build_post_policy", "(", "self", ",", "expiration_time", ",", "conditions", ")", ":", "assert", "type", "(", "expiration_time", ")", "==", "time", ".", "struct_time", ",", "'Policy document must include a valid expiration Time object'", "# Convert conditions object ...
Taken from the AWS book Python examples and modified for use with boto
[ "Taken", "from", "the", "AWS", "book", "Python", "examples", "and", "modified", "for", "use", "with", "boto" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/connection.py#L180-L190
50,855
yyuu/botornado
boto/s3/connection.py
S3Connection.create_bucket
def create_bucket(self, bucket_name, headers=None, location=Location.DEFAULT, policy=None): """ Creates a new located bucket. By default it's in the USA. You can pass Location.EU to create an European bucket. :type bucket_name: string :param bucket_name: Th...
python
def create_bucket(self, bucket_name, headers=None, location=Location.DEFAULT, policy=None): """ Creates a new located bucket. By default it's in the USA. You can pass Location.EU to create an European bucket. :type bucket_name: string :param bucket_name: Th...
[ "def", "create_bucket", "(", "self", ",", "bucket_name", ",", "headers", "=", "None", ",", "location", "=", "Location", ".", "DEFAULT", ",", "policy", "=", "None", ")", ":", "check_lowercase_bucketname", "(", "bucket_name", ")", "if", "policy", ":", "if", ...
Creates a new located bucket. By default it's in the USA. You can pass Location.EU to create an European bucket. :type bucket_name: string :param bucket_name: The name of the new bucket :type headers: dict :param headers: Additional headers to pass along with the reques...
[ "Creates", "a", "new", "located", "bucket", ".", "By", "default", "it", "s", "in", "the", "USA", ".", "You", "can", "pass", "Location", ".", "EU", "to", "create", "an", "European", "bucket", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/s3/connection.py#L380-L422
50,856
staggerpkg/stagger
stagger/conversion.py
Unsync.gen_decode
def gen_decode(iterable): "A generator for de-unsynchronizing a byte iterable." sync = False for b in iterable: if sync and b & 0xE0: warn("Invalid unsynched data", Warning) if not (sync and b == 0x00): yield b sync = (b == 0xFF...
python
def gen_decode(iterable): "A generator for de-unsynchronizing a byte iterable." sync = False for b in iterable: if sync and b & 0xE0: warn("Invalid unsynched data", Warning) if not (sync and b == 0x00): yield b sync = (b == 0xFF...
[ "def", "gen_decode", "(", "iterable", ")", ":", "sync", "=", "False", "for", "b", "in", "iterable", ":", "if", "sync", "and", "b", "&", "0xE0", ":", "warn", "(", "\"Invalid unsynched data\"", ",", "Warning", ")", "if", "not", "(", "sync", "and", "b", ...
A generator for de-unsynchronizing a byte iterable.
[ "A", "generator", "for", "de", "-", "unsynchronizing", "a", "byte", "iterable", "." ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/conversion.py#L39-L47
50,857
staggerpkg/stagger
stagger/conversion.py
Unsync.gen_encode
def gen_encode(data): "A generator for unsynchronizing a byte iterable." sync = False for b in data: if sync and (b == 0x00 or b & 0xE0): yield 0x00 # Insert sync char yield b sync = (b == 0xFF) if sync: yield 0x00
python
def gen_encode(data): "A generator for unsynchronizing a byte iterable." sync = False for b in data: if sync and (b == 0x00 or b & 0xE0): yield 0x00 # Insert sync char yield b sync = (b == 0xFF) if sync: yield 0x00
[ "def", "gen_encode", "(", "data", ")", ":", "sync", "=", "False", "for", "b", "in", "data", ":", "if", "sync", "and", "(", "b", "==", "0x00", "or", "b", "&", "0xE0", ")", ":", "yield", "0x00", "# Insert sync char", "yield", "b", "sync", "=", "(", ...
A generator for unsynchronizing a byte iterable.
[ "A", "generator", "for", "unsynchronizing", "a", "byte", "iterable", "." ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/conversion.py#L50-L59
50,858
staggerpkg/stagger
stagger/conversion.py
Syncsafe.decode
def decode(data): "Decodes a syncsafe integer" value = 0 for b in data: if b > 127: # iTunes bug raise ValueError("Invalid syncsafe integer") value <<= 7 value += b return value
python
def decode(data): "Decodes a syncsafe integer" value = 0 for b in data: if b > 127: # iTunes bug raise ValueError("Invalid syncsafe integer") value <<= 7 value += b return value
[ "def", "decode", "(", "data", ")", ":", "value", "=", "0", "for", "b", "in", "data", ":", "if", "b", ">", "127", ":", "# iTunes bug", "raise", "ValueError", "(", "\"Invalid syncsafe integer\"", ")", "value", "<<=", "7", "value", "+=", "b", "return", "v...
Decodes a syncsafe integer
[ "Decodes", "a", "syncsafe", "integer" ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/conversion.py#L95-L103
50,859
staggerpkg/stagger
stagger/conversion.py
Syncsafe.encode
def encode(i, *, width=-1): """Encodes a nonnegative integer into syncsafe format When width > 0, then len(result) == width When width < 0, then len(result) >= abs(width) """ if i < 0: raise ValueError("value is negative") assert width != 0 data = byt...
python
def encode(i, *, width=-1): """Encodes a nonnegative integer into syncsafe format When width > 0, then len(result) == width When width < 0, then len(result) >= abs(width) """ if i < 0: raise ValueError("value is negative") assert width != 0 data = byt...
[ "def", "encode", "(", "i", ",", "*", ",", "width", "=", "-", "1", ")", ":", "if", "i", "<", "0", ":", "raise", "ValueError", "(", "\"value is negative\"", ")", "assert", "width", "!=", "0", "data", "=", "bytearray", "(", ")", "while", "i", ":", "...
Encodes a nonnegative integer into syncsafe format When width > 0, then len(result) == width When width < 0, then len(result) >= abs(width)
[ "Encodes", "a", "nonnegative", "integer", "into", "syncsafe", "format" ]
6530db14afc5d7d8a4599b7f3b26158fb367d786
https://github.com/staggerpkg/stagger/blob/6530db14afc5d7d8a4599b7f3b26158fb367d786/stagger/conversion.py#L106-L124
50,860
yyuu/botornado
boto/sqs/queue.py
Queue.new_message
def new_message(self, body=''): """ Create new message of appropriate class. :type body: message body :param body: The body of the newly created message (optional). :rtype: :class:`boto.sqs.message.Message` :return: A new Message object """ m = self.mess...
python
def new_message(self, body=''): """ Create new message of appropriate class. :type body: message body :param body: The body of the newly created message (optional). :rtype: :class:`boto.sqs.message.Message` :return: A new Message object """ m = self.mess...
[ "def", "new_message", "(", "self", ",", "body", "=", "''", ")", ":", "m", "=", "self", ".", "message_class", "(", "self", ",", "body", ")", "m", ".", "queue", "=", "self", "return", "m" ]
Create new message of appropriate class. :type body: message body :param body: The body of the newly created message (optional). :rtype: :class:`boto.sqs.message.Message` :return: A new Message object
[ "Create", "new", "message", "of", "appropriate", "class", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sqs/queue.py#L206-L218
50,861
yyuu/botornado
boto/sqs/queue.py
Queue.clear
def clear(self, page_size=10, vtimeout=10): """Utility function to remove all messages from a queue""" n = 0 l = self.get_messages(page_size, vtimeout) while l: for m in l: self.delete_message(m) n += 1 l = self.get_messages(page_si...
python
def clear(self, page_size=10, vtimeout=10): """Utility function to remove all messages from a queue""" n = 0 l = self.get_messages(page_size, vtimeout) while l: for m in l: self.delete_message(m) n += 1 l = self.get_messages(page_si...
[ "def", "clear", "(", "self", ",", "page_size", "=", "10", ",", "vtimeout", "=", "10", ")", ":", "n", "=", "0", "l", "=", "self", ".", "get_messages", "(", "page_size", ",", "vtimeout", ")", "while", "l", ":", "for", "m", "in", "l", ":", "self", ...
Utility function to remove all messages from a queue
[ "Utility", "function", "to", "remove", "all", "messages", "from", "a", "queue" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sqs/queue.py#L267-L276
50,862
yyuu/botornado
boto/sqs/queue.py
Queue.save_to_file
def save_to_file(self, fp, sep='\n'): """ Read all messages from the queue and persist them to file-like object. Messages are written to the file and the 'sep' string is written in between messages. Messages are deleted from the queue after being written to the file. Ret...
python
def save_to_file(self, fp, sep='\n'): """ Read all messages from the queue and persist them to file-like object. Messages are written to the file and the 'sep' string is written in between messages. Messages are deleted from the queue after being written to the file. Ret...
[ "def", "save_to_file", "(", "self", ",", "fp", ",", "sep", "=", "'\\n'", ")", ":", "n", "=", "0", "m", "=", "self", ".", "read", "(", ")", "while", "m", ":", "n", "+=", "1", "fp", ".", "write", "(", "m", ".", "get_body", "(", ")", ")", "if"...
Read all messages from the queue and persist them to file-like object. Messages are written to the file and the 'sep' string is written in between messages. Messages are deleted from the queue after being written to the file. Returns the number of messages saved.
[ "Read", "all", "messages", "from", "the", "queue", "and", "persist", "them", "to", "file", "-", "like", "object", ".", "Messages", "are", "written", "to", "the", "file", "and", "the", "sep", "string", "is", "written", "in", "between", "messages", ".", "M...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sqs/queue.py#L320-L337
50,863
yyuu/botornado
boto/sqs/queue.py
Queue.save_to_filename
def save_to_filename(self, file_name, sep='\n'): """ Read all messages from the queue and persist them to local file. Messages are written to the file and the 'sep' string is written in between messages. Messages are deleted from the queue after being written to the file. ...
python
def save_to_filename(self, file_name, sep='\n'): """ Read all messages from the queue and persist them to local file. Messages are written to the file and the 'sep' string is written in between messages. Messages are deleted from the queue after being written to the file. ...
[ "def", "save_to_filename", "(", "self", ",", "file_name", ",", "sep", "=", "'\\n'", ")", ":", "fp", "=", "open", "(", "file_name", ",", "'wb'", ")", "n", "=", "self", ".", "save_to_file", "(", "fp", ",", "sep", ")", "fp", ".", "close", "(", ")", ...
Read all messages from the queue and persist them to local file. Messages are written to the file and the 'sep' string is written in between messages. Messages are deleted from the queue after being written to the file. Returns the number of messages saved.
[ "Read", "all", "messages", "from", "the", "queue", "and", "persist", "them", "to", "local", "file", ".", "Messages", "are", "written", "to", "the", "file", "and", "the", "sep", "string", "is", "written", "in", "between", "messages", ".", "Messages", "are",...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sqs/queue.py#L339-L350
50,864
yyuu/botornado
boto/sqs/queue.py
Queue.load_from_s3
def load_from_s3(self, bucket, prefix=None): """ Load messages previously saved to S3. """ n = 0 if prefix: prefix = '%s/' % prefix else: prefix = '%s/' % self.id[1:] rs = bucket.list(prefix=prefix) for key in rs: n += 1...
python
def load_from_s3(self, bucket, prefix=None): """ Load messages previously saved to S3. """ n = 0 if prefix: prefix = '%s/' % prefix else: prefix = '%s/' % self.id[1:] rs = bucket.list(prefix=prefix) for key in rs: n += 1...
[ "def", "load_from_s3", "(", "self", ",", "bucket", ",", "prefix", "=", "None", ")", ":", "n", "=", "0", "if", "prefix", ":", "prefix", "=", "'%s/'", "%", "prefix", "else", ":", "prefix", "=", "'%s/'", "%", "self", ".", "id", "[", "1", ":", "]", ...
Load messages previously saved to S3.
[ "Load", "messages", "previously", "saved", "to", "S3", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sqs/queue.py#L375-L389
50,865
yyuu/botornado
boto/sqs/queue.py
Queue.load_from_file
def load_from_file(self, fp, sep='\n'): """Utility function to load messages from a file-like object to a queue""" n = 0 body = '' l = fp.readline() while l: if l == sep: m = Message(self, body) self.write(m) n += 1 ...
python
def load_from_file(self, fp, sep='\n'): """Utility function to load messages from a file-like object to a queue""" n = 0 body = '' l = fp.readline() while l: if l == sep: m = Message(self, body) self.write(m) n += 1 ...
[ "def", "load_from_file", "(", "self", ",", "fp", ",", "sep", "=", "'\\n'", ")", ":", "n", "=", "0", "body", "=", "''", "l", "=", "fp", ".", "readline", "(", ")", "while", "l", ":", "if", "l", "==", "sep", ":", "m", "=", "Message", "(", "self"...
Utility function to load messages from a file-like object to a queue
[ "Utility", "function", "to", "load", "messages", "from", "a", "file", "-", "like", "object", "to", "a", "queue" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sqs/queue.py#L391-L406
50,866
yyuu/botornado
boto/sqs/queue.py
Queue.load_from_filename
def load_from_filename(self, file_name, sep='\n'): """Utility function to load messages from a local filename to a queue""" fp = open(file_name, 'rb') n = self.load_from_file(fp, sep) fp.close() return n
python
def load_from_filename(self, file_name, sep='\n'): """Utility function to load messages from a local filename to a queue""" fp = open(file_name, 'rb') n = self.load_from_file(fp, sep) fp.close() return n
[ "def", "load_from_filename", "(", "self", ",", "file_name", ",", "sep", "=", "'\\n'", ")", ":", "fp", "=", "open", "(", "file_name", ",", "'rb'", ")", "n", "=", "self", ".", "load_from_file", "(", "fp", ",", "sep", ")", "fp", ".", "close", "(", ")"...
Utility function to load messages from a local filename to a queue
[ "Utility", "function", "to", "load", "messages", "from", "a", "local", "filename", "to", "a", "queue" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sqs/queue.py#L408-L413
50,867
borntyping/python-riemann-client
riemann_client/command.py
echo_event
def echo_event(data): """Echo a json dump of an object using click""" return click.echo(json.dumps(data, sort_keys=True, indent=2))
python
def echo_event(data): """Echo a json dump of an object using click""" return click.echo(json.dumps(data, sort_keys=True, indent=2))
[ "def", "echo_event", "(", "data", ")", ":", "return", "click", ".", "echo", "(", "json", ".", "dumps", "(", "data", ",", "sort_keys", "=", "True", ",", "indent", "=", "2", ")", ")" ]
Echo a json dump of an object using click
[ "Echo", "a", "json", "dump", "of", "an", "object", "using", "click" ]
3e181d90bdf685afd21c1ec5ee20e6840b011ea5
https://github.com/borntyping/python-riemann-client/blob/3e181d90bdf685afd21c1ec5ee20e6840b011ea5/riemann_client/command.py#L38-L40
50,868
borntyping/python-riemann-client
riemann_client/command.py
main
def main(ctx, host, port, transport_type, timeout, ca_certs): """Connects to a Riemann server to send events or query the index By default, will attempt to contact Riemann on localhost:5555 over TCP. The RIEMANN_HOST and RIEMANN_PORT environment variables can be used to configure the host and port used...
python
def main(ctx, host, port, transport_type, timeout, ca_certs): """Connects to a Riemann server to send events or query the index By default, will attempt to contact Riemann on localhost:5555 over TCP. The RIEMANN_HOST and RIEMANN_PORT environment variables can be used to configure the host and port used...
[ "def", "main", "(", "ctx", ",", "host", ",", "port", ",", "transport_type", ",", "timeout", ",", "ca_certs", ")", ":", "if", "transport_type", "==", "'udp'", ":", "if", "timeout", "is", "not", "None", ":", "ctx", ".", "fail", "(", "'--timeout cannot be u...
Connects to a Riemann server to send events or query the index By default, will attempt to contact Riemann on localhost:5555 over TCP. The RIEMANN_HOST and RIEMANN_PORT environment variables can be used to configure the host and port used. Command line parameters will override the environment variables...
[ "Connects", "to", "a", "Riemann", "server", "to", "send", "events", "or", "query", "the", "index" ]
3e181d90bdf685afd21c1ec5ee20e6840b011ea5
https://github.com/borntyping/python-riemann-client/blob/3e181d90bdf685afd21c1ec5ee20e6840b011ea5/riemann_client/command.py#L57-L81
50,869
borntyping/python-riemann-client
riemann_client/command.py
send
def send(transport, time, state, host, description, service, tag, attribute, ttl, metric_f, echo): """Send a single event to Riemann""" client = CommandLineClient(transport) event = client.create_event({ 'time': time, 'state': state, 'host': host, 'description': desc...
python
def send(transport, time, state, host, description, service, tag, attribute, ttl, metric_f, echo): """Send a single event to Riemann""" client = CommandLineClient(transport) event = client.create_event({ 'time': time, 'state': state, 'host': host, 'description': desc...
[ "def", "send", "(", "transport", ",", "time", ",", "state", ",", "host", ",", "description", ",", "service", ",", "tag", ",", "attribute", ",", "ttl", ",", "metric_f", ",", "echo", ")", ":", "client", "=", "CommandLineClient", "(", "transport", ")", "e...
Send a single event to Riemann
[ "Send", "a", "single", "event", "to", "Riemann" ]
3e181d90bdf685afd21c1ec5ee20e6840b011ea5
https://github.com/borntyping/python-riemann-client/blob/3e181d90bdf685afd21c1ec5ee20e6840b011ea5/riemann_client/command.py#L106-L125
50,870
borntyping/python-riemann-client
riemann_client/command.py
query
def query(transport, query): """Query the Riemann server""" with CommandLineClient(transport) as client: echo_event(client.query(query))
python
def query(transport, query): """Query the Riemann server""" with CommandLineClient(transport) as client: echo_event(client.query(query))
[ "def", "query", "(", "transport", ",", "query", ")", ":", "with", "CommandLineClient", "(", "transport", ")", "as", "client", ":", "echo_event", "(", "client", ".", "query", "(", "query", ")", ")" ]
Query the Riemann server
[ "Query", "the", "Riemann", "server" ]
3e181d90bdf685afd21c1ec5ee20e6840b011ea5
https://github.com/borntyping/python-riemann-client/blob/3e181d90bdf685afd21c1ec5ee20e6840b011ea5/riemann_client/command.py#L131-L134
50,871
yyuu/botornado
boto/sdb/db/model.py
Model.put_attributes
def put_attributes(self, attrs): """ Save just these few attributes, not the whole object :param attrs: Attributes to save, key->value dict :type attrs: dict :return: self :rtype: :class:`boto.sdb.db.model.Model` """ assert(isinstance(attrs, dict)), "Argu...
python
def put_attributes(self, attrs): """ Save just these few attributes, not the whole object :param attrs: Attributes to save, key->value dict :type attrs: dict :return: self :rtype: :class:`boto.sdb.db.model.Model` """ assert(isinstance(attrs, dict)), "Argu...
[ "def", "put_attributes", "(", "self", ",", "attrs", ")", ":", "assert", "(", "isinstance", "(", "attrs", ",", "dict", ")", ")", ",", "\"Argument must be a dict of key->values to save\"", "for", "prop_name", "in", "attrs", ":", "value", "=", "attrs", "[", "prop...
Save just these few attributes, not the whole object :param attrs: Attributes to save, key->value dict :type attrs: dict :return: self :rtype: :class:`boto.sdb.db.model.Model`
[ "Save", "just", "these", "few", "attributes", "not", "the", "whole", "object" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/model.py#L207-L223
50,872
yyuu/botornado
boto/sdb/db/model.py
Model.delete_attributes
def delete_attributes(self, attrs): """ Delete just these attributes, not the whole object. :param attrs: Attributes to save, as a list of string names :type attrs: list :return: self :rtype: :class:`boto.sdb.db.model.Model` """ assert(isinstance(attrs, l...
python
def delete_attributes(self, attrs): """ Delete just these attributes, not the whole object. :param attrs: Attributes to save, as a list of string names :type attrs: list :return: self :rtype: :class:`boto.sdb.db.model.Model` """ assert(isinstance(attrs, l...
[ "def", "delete_attributes", "(", "self", ",", "attrs", ")", ":", "assert", "(", "isinstance", "(", "attrs", ",", "list", ")", ")", ",", "\"Argument must be a list of names of keys to delete.\"", "self", ".", "_manager", ".", "domain", ".", "delete_attributes", "("...
Delete just these attributes, not the whole object. :param attrs: Attributes to save, as a list of string names :type attrs: list :return: self :rtype: :class:`boto.sdb.db.model.Model`
[ "Delete", "just", "these", "attributes", "not", "the", "whole", "object", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/model.py#L225-L237
50,873
yyuu/botornado
boto/sdb/db/model.py
Model.find_subclass
def find_subclass(cls, name): """Find a subclass with a given name""" if name == cls.__name__: return cls for sc in cls.__sub_classes__: r = sc.find_subclass(name) if r != None: return r
python
def find_subclass(cls, name): """Find a subclass with a given name""" if name == cls.__name__: return cls for sc in cls.__sub_classes__: r = sc.find_subclass(name) if r != None: return r
[ "def", "find_subclass", "(", "cls", ",", "name", ")", ":", "if", "name", "==", "cls", ".", "__name__", ":", "return", "cls", "for", "sc", "in", "cls", ".", "__sub_classes__", ":", "r", "=", "sc", ".", "find_subclass", "(", "name", ")", "if", "r", "...
Find a subclass with a given name
[ "Find", "a", "subclass", "with", "a", "given", "name" ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/db/model.py#L264-L271
50,874
yyuu/botornado
boto/ec2/elb/healthcheck.py
HealthCheck.update
def update(self): """ In the case where you have accessed an existing health check on a load balancer, this method applies this instance's health check values to the load balancer it is attached to. .. note:: This method will not do anything if the :py:attr:`access_point` ...
python
def update(self): """ In the case where you have accessed an existing health check on a load balancer, this method applies this instance's health check values to the load balancer it is attached to. .. note:: This method will not do anything if the :py:attr:`access_point` ...
[ "def", "update", "(", "self", ")", ":", "if", "not", "self", ".", "access_point", ":", "return", "new_hc", "=", "self", ".", "connection", ".", "configure_health_check", "(", "self", ".", "access_point", ",", "self", ")", "self", ".", "interval", "=", "n...
In the case where you have accessed an existing health check on a load balancer, this method applies this instance's health check values to the load balancer it is attached to. .. note:: This method will not do anything if the :py:attr:`access_point` attribute isn't set, as is the c...
[ "In", "the", "case", "where", "you", "have", "accessed", "an", "existing", "health", "check", "on", "a", "load", "balancer", "this", "method", "applies", "this", "instance", "s", "health", "check", "values", "to", "the", "load", "balancer", "it", "is", "at...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ec2/elb/healthcheck.py#L67-L85
50,875
yyuu/botornado
boto/ecs/__init__.py
ECSConnection.get_response
def get_response(self, action, params, page=0, itemSet=None): """ Utility method to handle calls to ECS and parsing of responses. """ params['Service'] = "AWSECommerceService" params['Operation'] = action if page: params['ItemPage'] = page response = s...
python
def get_response(self, action, params, page=0, itemSet=None): """ Utility method to handle calls to ECS and parsing of responses. """ params['Service'] = "AWSECommerceService" params['Operation'] = action if page: params['ItemPage'] = page response = s...
[ "def", "get_response", "(", "self", ",", "action", ",", "params", ",", "page", "=", "0", ",", "itemSet", "=", "None", ")", ":", "params", "[", "'Service'", "]", "=", "\"AWSECommerceService\"", "params", "[", "'Operation'", "]", "=", "action", "if", "page...
Utility method to handle calls to ECS and parsing of responses.
[ "Utility", "method", "to", "handle", "calls", "to", "ECS", "and", "parsing", "of", "responses", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ecs/__init__.py#L52-L75
50,876
carljm/django-adminfiles
adminfiles/utils.py
render_uploads
def render_uploads(content, template_path="adminfiles/render/"): """ Replace all uploaded file references in a content string with the results of rendering a template found under ``template_path`` with the ``FileUpload`` instance and the key=value options found in the file reference. So if "<<<...
python
def render_uploads(content, template_path="adminfiles/render/"): """ Replace all uploaded file references in a content string with the results of rendering a template found under ``template_path`` with the ``FileUpload`` instance and the key=value options found in the file reference. So if "<<<...
[ "def", "render_uploads", "(", "content", ",", "template_path", "=", "\"adminfiles/render/\"", ")", ":", "def", "_replace", "(", "match", ")", ":", "upload", ",", "options", "=", "parse_match", "(", "match", ")", "return", "render_upload", "(", "upload", ",", ...
Replace all uploaded file references in a content string with the results of rendering a template found under ``template_path`` with the ``FileUpload`` instance and the key=value options found in the file reference. So if "<<<my-uploaded-file:key=val:key2=val2>>>" is found in the content string, it...
[ "Replace", "all", "uploaded", "file", "references", "in", "a", "content", "string", "with", "the", "results", "of", "rendering", "a", "template", "found", "under", "template_path", "with", "the", "FileUpload", "instance", "and", "the", "key", "=", "value", "op...
b01dc7be266305d575c11d5ff9a37ccac04a78c2
https://github.com/carljm/django-adminfiles/blob/b01dc7be266305d575c11d5ff9a37ccac04a78c2/adminfiles/utils.py#L22-L45
50,877
guyskk/flask-restaction
flask_restaction/cli.py
parse_meta
def parse_meta(meta): """ Parse metadata of API Args: meta: metadata of API Returns: tuple(url_prefix, auth_header, resources) """ resources = {} for name in meta: if name.startswith("$"): continue resources[name] = resource = {} for actio...
python
def parse_meta(meta): """ Parse metadata of API Args: meta: metadata of API Returns: tuple(url_prefix, auth_header, resources) """ resources = {} for name in meta: if name.startswith("$"): continue resources[name] = resource = {} for actio...
[ "def", "parse_meta", "(", "meta", ")", ":", "resources", "=", "{", "}", "for", "name", "in", "meta", ":", "if", "name", ".", "startswith", "(", "\"$\"", ")", ":", "continue", "resources", "[", "name", "]", "=", "resource", "=", "{", "}", "for", "ac...
Parse metadata of API Args: meta: metadata of API Returns: tuple(url_prefix, auth_header, resources)
[ "Parse", "metadata", "of", "API" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/cli.py#L11-L34
50,878
guyskk/flask-restaction
flask_restaction/cli.py
render_core
def render_core(url_prefix, auth_header, resources): """Generate res.core.js""" code = '' code += "function(root, init) {\n" code += " var q = init('%(auth_header)s', '%(url_prefix)s');\n" %\ {'url_prefix': url_prefix, 'auth_header': auth_header} code += " var r = null;\n" for key in r...
python
def render_core(url_prefix, auth_header, resources): """Generate res.core.js""" code = '' code += "function(root, init) {\n" code += " var q = init('%(auth_header)s', '%(url_prefix)s');\n" %\ {'url_prefix': url_prefix, 'auth_header': auth_header} code += " var r = null;\n" for key in r...
[ "def", "render_core", "(", "url_prefix", ",", "auth_header", ",", "resources", ")", ":", "code", "=", "''", "code", "+=", "\"function(root, init) {\\n\"", "code", "+=", "\" var q = init('%(auth_header)s', '%(url_prefix)s');\\n\"", "%", "{", "'url_prefix'", ":", "url_pr...
Generate res.core.js
[ "Generate", "res", ".", "core", ".", "js" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/cli.py#L48-L63
50,879
guyskk/flask-restaction
flask_restaction/cli.py
generate_code
def generate_code(meta, prefix=None, node=False, min=False): """ Generate res.js Args: meta: tuple(url_prefix, auth_header, resources) or metadata of API Returns: res.js source code """ if isinstance(meta, dict): url_prefix, auth_header, resources = parse_meta(meta) ...
python
def generate_code(meta, prefix=None, node=False, min=False): """ Generate res.js Args: meta: tuple(url_prefix, auth_header, resources) or metadata of API Returns: res.js source code """ if isinstance(meta, dict): url_prefix, auth_header, resources = parse_meta(meta) ...
[ "def", "generate_code", "(", "meta", ",", "prefix", "=", "None", ",", "node", "=", "False", ",", "min", "=", "False", ")", ":", "if", "isinstance", "(", "meta", ",", "dict", ")", ":", "url_prefix", ",", "auth_header", ",", "resources", "=", "parse_meta...
Generate res.js Args: meta: tuple(url_prefix, auth_header, resources) or metadata of API Returns: res.js source code
[ "Generate", "res", ".", "js" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/cli.py#L66-L89
50,880
guyskk/flask-restaction
flask_restaction/cli.py
resjs
def resjs(url, dest='./res.js', prefix=None, node=False, min=False): """Generate res.js and save it""" meta = requests.get(url, headers={'Accept': 'application/json'}).json() code = generate_code(meta, prefix, node, min) save_file(dest, code)
python
def resjs(url, dest='./res.js', prefix=None, node=False, min=False): """Generate res.js and save it""" meta = requests.get(url, headers={'Accept': 'application/json'}).json() code = generate_code(meta, prefix, node, min) save_file(dest, code)
[ "def", "resjs", "(", "url", ",", "dest", "=", "'./res.js'", ",", "prefix", "=", "None", ",", "node", "=", "False", ",", "min", "=", "False", ")", ":", "meta", "=", "requests", ".", "get", "(", "url", ",", "headers", "=", "{", "'Accept'", ":", "'a...
Generate res.js and save it
[ "Generate", "res", ".", "js", "and", "save", "it" ]
17db010b0cbba16bbc2408081975955b03553eb7
https://github.com/guyskk/flask-restaction/blob/17db010b0cbba16bbc2408081975955b03553eb7/flask_restaction/cli.py#L92-L96
50,881
getsentry/symsynd
symsynd/images.py
find_debug_images
def find_debug_images(dsym_paths, binary_images): """Given a list of paths and a list of binary images this returns a dictionary of image addresses to the locations on the file system for all found images. """ images_to_load = set() with timedsection('iterimages0'): for image in binary_...
python
def find_debug_images(dsym_paths, binary_images): """Given a list of paths and a list of binary images this returns a dictionary of image addresses to the locations on the file system for all found images. """ images_to_load = set() with timedsection('iterimages0'): for image in binary_...
[ "def", "find_debug_images", "(", "dsym_paths", ",", "binary_images", ")", ":", "images_to_load", "=", "set", "(", ")", "with", "timedsection", "(", "'iterimages0'", ")", ":", "for", "image", "in", "binary_images", ":", "if", "get_image_cpu_name", "(", "image", ...
Given a list of paths and a list of binary images this returns a dictionary of image addresses to the locations on the file system for all found images.
[ "Given", "a", "list", "of", "paths", "and", "a", "list", "of", "binary", "images", "this", "returns", "a", "dictionary", "of", "image", "addresses", "to", "the", "locations", "on", "the", "file", "system", "for", "all", "found", "images", "." ]
13825f10bfb9291fe7bcd13937ddf398e7104234
https://github.com/getsentry/symsynd/blob/13825f10bfb9291fe7bcd13937ddf398e7104234/symsynd/images.py#L17-L84
50,882
getsentry/symsynd
symsynd/images.py
ImageLookup.find_image
def find_image(self, addr): """Given an instruction address this locates the image this address is contained in. """ idx = bisect.bisect_left(self._image_addresses, parse_addr(addr)) if idx > 0: return self.images[self._image_addresses[idx - 1]]
python
def find_image(self, addr): """Given an instruction address this locates the image this address is contained in. """ idx = bisect.bisect_left(self._image_addresses, parse_addr(addr)) if idx > 0: return self.images[self._image_addresses[idx - 1]]
[ "def", "find_image", "(", "self", ",", "addr", ")", ":", "idx", "=", "bisect", ".", "bisect_left", "(", "self", ".", "_image_addresses", ",", "parse_addr", "(", "addr", ")", ")", "if", "idx", ">", "0", ":", "return", "self", ".", "images", "[", "self...
Given an instruction address this locates the image this address is contained in.
[ "Given", "an", "instruction", "address", "this", "locates", "the", "image", "this", "address", "is", "contained", "in", "." ]
13825f10bfb9291fe7bcd13937ddf398e7104234
https://github.com/getsentry/symsynd/blob/13825f10bfb9291fe7bcd13937ddf398e7104234/symsynd/images.py#L109-L115
50,883
emory-libraries/eulfedora
eulfedora/util.py
md5sum
def md5sum(content): '''Calculate and returns an MD5 checksum for the specified content. :param content: text content :returns: hex-digest formatted MD5 checksum as a string ''' md5 = hashlib.md5() md5.update(force_bytes(content)) return md5.hexdigest()
python
def md5sum(content): '''Calculate and returns an MD5 checksum for the specified content. :param content: text content :returns: hex-digest formatted MD5 checksum as a string ''' md5 = hashlib.md5() md5.update(force_bytes(content)) return md5.hexdigest()
[ "def", "md5sum", "(", "content", ")", ":", "md5", "=", "hashlib", ".", "md5", "(", ")", "md5", ".", "update", "(", "force_bytes", "(", "content", ")", ")", "return", "md5", ".", "hexdigest", "(", ")" ]
Calculate and returns an MD5 checksum for the specified content. :param content: text content :returns: hex-digest formatted MD5 checksum as a string
[ "Calculate", "and", "returns", "an", "MD5", "checksum", "for", "the", "specified", "content", "." ]
161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4
https://github.com/emory-libraries/eulfedora/blob/161826f3fdcdab4007f6fa7dfd9f1ecabc4bcbe4/eulfedora/util.py#L172-L180
50,884
yyuu/botornado
boto/ses/connection.py
SESConnection._build_list_params
def _build_list_params(self, params, items, label): """Add an AWS API-compatible parameter list to a dictionary. :type params: dict :param params: The parameter dictionary :type items: list :param items: Items to be included in the list :type label: string :par...
python
def _build_list_params(self, params, items, label): """Add an AWS API-compatible parameter list to a dictionary. :type params: dict :param params: The parameter dictionary :type items: list :param items: Items to be included in the list :type label: string :par...
[ "def", "_build_list_params", "(", "self", ",", "params", ",", "items", ",", "label", ")", ":", "if", "isinstance", "(", "items", ",", "basestring", ")", ":", "items", "=", "[", "items", "]", "for", "i", "in", "range", "(", "1", ",", "len", "(", "it...
Add an AWS API-compatible parameter list to a dictionary. :type params: dict :param params: The parameter dictionary :type items: list :param items: Items to be included in the list :type label: string :param label: The parameter list's name
[ "Add", "an", "AWS", "API", "-", "compatible", "parameter", "list", "to", "a", "dictionary", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ses/connection.py#L58-L73
50,885
yyuu/botornado
boto/ses/connection.py
SESConnection._make_request
def _make_request(self, action, params=None): """Make a call to the SES API. :type action: string :param action: The API method to use (e.g. SendRawEmail) :type params: dict :param params: Parameters that will be sent as POST data with the API call. """ ...
python
def _make_request(self, action, params=None): """Make a call to the SES API. :type action: string :param action: The API method to use (e.g. SendRawEmail) :type params: dict :param params: Parameters that will be sent as POST data with the API call. """ ...
[ "def", "_make_request", "(", "self", ",", "action", ",", "params", "=", "None", ")", ":", "ct", "=", "'application/x-www-form-urlencoded; charset=UTF-8'", "headers", "=", "{", "'Content-Type'", ":", "ct", "}", "params", "=", "params", "or", "{", "}", "params",...
Make a call to the SES API. :type action: string :param action: The API method to use (e.g. SendRawEmail) :type params: dict :param params: Parameters that will be sent as POST data with the API call.
[ "Make", "a", "call", "to", "the", "SES", "API", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ses/connection.py#L75-L110
50,886
yyuu/botornado
boto/ses/connection.py
SESConnection._handle_error
def _handle_error(self, response, body): """ Handle raising the correct exception, depending on the error. Many errors share the same HTTP response code, meaning we have to get really kludgey and do string searches to figure out what went wrong. """ boto.log.error('%s %s'...
python
def _handle_error(self, response, body): """ Handle raising the correct exception, depending on the error. Many errors share the same HTTP response code, meaning we have to get really kludgey and do string searches to figure out what went wrong. """ boto.log.error('%s %s'...
[ "def", "_handle_error", "(", "self", ",", "response", ",", "body", ")", ":", "boto", ".", "log", ".", "error", "(", "'%s %s'", "%", "(", "response", ".", "status", ",", "response", ".", "reason", ")", ")", "boto", ".", "log", ".", "error", "(", "'%...
Handle raising the correct exception, depending on the error. Many errors share the same HTTP response code, meaning we have to get really kludgey and do string searches to figure out what went wrong.
[ "Handle", "raising", "the", "correct", "exception", "depending", "on", "the", "error", ".", "Many", "errors", "share", "the", "same", "HTTP", "response", "code", "meaning", "we", "have", "to", "get", "really", "kludgey", "and", "do", "string", "searches", "t...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ses/connection.py#L112-L152
50,887
yyuu/botornado
boto/ses/connection.py
SESConnection.send_email
def send_email(self, source, subject, body, to_addresses, cc_addresses=None, bcc_addresses=None, format='text', reply_addresses=None, return_path=None, text_body=None, html_body=None): """Composes an email message based on input data, and then immediately queues the...
python
def send_email(self, source, subject, body, to_addresses, cc_addresses=None, bcc_addresses=None, format='text', reply_addresses=None, return_path=None, text_body=None, html_body=None): """Composes an email message based on input data, and then immediately queues the...
[ "def", "send_email", "(", "self", ",", "source", ",", "subject", ",", "body", ",", "to_addresses", ",", "cc_addresses", "=", "None", ",", "bcc_addresses", "=", "None", ",", "format", "=", "'text'", ",", "reply_addresses", "=", "None", ",", "return_path", "...
Composes an email message based on input data, and then immediately queues the message for sending. :type source: string :param source: The sender's email address. :type subject: string :param subject: The subject of the message: A short summary of the c...
[ "Composes", "an", "email", "message", "based", "on", "input", "data", "and", "then", "immediately", "queues", "the", "message", "for", "sending", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ses/connection.py#L154-L248
50,888
yyuu/botornado
boto/ses/connection.py
SESConnection.send_raw_email
def send_raw_email(self, raw_message, source=None, destinations=None): """Sends an email message, with header and content specified by the client. The SendRawEmail action is useful for sending multipart MIME emails, with attachments or inline content. The raw text of the message must com...
python
def send_raw_email(self, raw_message, source=None, destinations=None): """Sends an email message, with header and content specified by the client. The SendRawEmail action is useful for sending multipart MIME emails, with attachments or inline content. The raw text of the message must com...
[ "def", "send_raw_email", "(", "self", ",", "raw_message", ",", "source", "=", "None", ",", "destinations", "=", "None", ")", ":", "params", "=", "{", "'RawMessage.Data'", ":", "base64", ".", "b64encode", "(", "raw_message", ")", ",", "}", "if", "source", ...
Sends an email message, with header and content specified by the client. The SendRawEmail action is useful for sending multipart MIME emails, with attachments or inline content. The raw text of the message must comply with Internet email standards; otherwise, the message cannot be sent. ...
[ "Sends", "an", "email", "message", "with", "header", "and", "content", "specified", "by", "the", "client", ".", "The", "SendRawEmail", "action", "is", "useful", "for", "sending", "multipart", "MIME", "emails", "with", "attachments", "or", "inline", "content", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/ses/connection.py#L250-L291
50,889
yyuu/botornado
boto/sdb/connection.py
SDBConnection.create_domain
def create_domain(self, domain_name): """ Create a SimpleDB domain. :type domain_name: string :param domain_name: The name of the new domain :rtype: :class:`boto.sdb.domain.Domain` object :return: The newly created domain """ params = {'DomainName':domai...
python
def create_domain(self, domain_name): """ Create a SimpleDB domain. :type domain_name: string :param domain_name: The name of the new domain :rtype: :class:`boto.sdb.domain.Domain` object :return: The newly created domain """ params = {'DomainName':domai...
[ "def", "create_domain", "(", "self", ",", "domain_name", ")", ":", "params", "=", "{", "'DomainName'", ":", "domain_name", "}", "d", "=", "self", ".", "get_object", "(", "'CreateDomain'", ",", "params", ",", "Domain", ")", "d", ".", "name", "=", "domain_...
Create a SimpleDB domain. :type domain_name: string :param domain_name: The name of the new domain :rtype: :class:`boto.sdb.domain.Domain` object :return: The newly created domain
[ "Create", "a", "SimpleDB", "domain", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/connection.py#L309-L322
50,890
yyuu/botornado
boto/sdb/connection.py
SDBConnection.delete_domain
def delete_domain(self, domain_or_name): """ Delete a SimpleDB domain. .. caution:: This will delete the domain and all items within the domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domai...
python
def delete_domain(self, domain_or_name): """ Delete a SimpleDB domain. .. caution:: This will delete the domain and all items within the domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domai...
[ "def", "delete_domain", "(", "self", ",", "domain_or_name", ")", ":", "domain", ",", "domain_name", "=", "self", ".", "get_domain_and_name", "(", "domain_or_name", ")", "params", "=", "{", "'DomainName'", ":", "domain_name", "}", "return", "self", ".", "get_st...
Delete a SimpleDB domain. .. caution:: This will delete the domain and all items within the domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domain object :rtype: bool :return: True if succe...
[ "Delete", "a", "SimpleDB", "domain", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/connection.py#L348-L363
50,891
yyuu/botornado
boto/sdb/connection.py
SDBConnection.domain_metadata
def domain_metadata(self, domain_or_name): """ Get the Metadata for a SimpleDB domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domain object :rtype: :class:`boto.sdb.domain.DomainMetaData` o...
python
def domain_metadata(self, domain_or_name): """ Get the Metadata for a SimpleDB domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domain object :rtype: :class:`boto.sdb.domain.DomainMetaData` o...
[ "def", "domain_metadata", "(", "self", ",", "domain_or_name", ")", ":", "domain", ",", "domain_name", "=", "self", ".", "get_domain_and_name", "(", "domain_or_name", ")", "params", "=", "{", "'DomainName'", ":", "domain_name", "}", "d", "=", "self", ".", "ge...
Get the Metadata for a SimpleDB domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domain object :rtype: :class:`boto.sdb.domain.DomainMetaData` object :return: The newly created domain metadata object
[ "Get", "the", "Metadata", "for", "a", "SimpleDB", "domain", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/connection.py#L365-L379
50,892
yyuu/botornado
boto/sdb/connection.py
SDBConnection.get_attributes
def get_attributes(self, domain_or_name, item_name, attribute_names=None, consistent_read=False, item=None): """ Retrieve attributes for a given item in a domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either...
python
def get_attributes(self, domain_or_name, item_name, attribute_names=None, consistent_read=False, item=None): """ Retrieve attributes for a given item in a domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either...
[ "def", "get_attributes", "(", "self", ",", "domain_or_name", ",", "item_name", ",", "attribute_names", "=", "None", ",", "consistent_read", "=", "False", ",", "item", "=", "None", ")", ":", "domain", ",", "domain_name", "=", "self", ".", "get_domain_and_name",...
Retrieve attributes for a given item in a domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domain object :type item_name: string :param item_name: The name of the item whose attributes are ...
[ "Retrieve", "attributes", "for", "a", "given", "item", "in", "a", "domain", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/connection.py#L456-L502
50,893
yyuu/botornado
boto/sdb/connection.py
SDBConnection.delete_attributes
def delete_attributes(self, domain_or_name, item_name, attr_names=None, expected_value=None): """ Delete attributes from a given item in a domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of ...
python
def delete_attributes(self, domain_or_name, item_name, attr_names=None, expected_value=None): """ Delete attributes from a given item in a domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of ...
[ "def", "delete_attributes", "(", "self", ",", "domain_or_name", ",", "item_name", ",", "attr_names", "=", "None", ",", "expected_value", "=", "None", ")", ":", "domain", ",", "domain_name", "=", "self", ".", "get_domain_and_name", "(", "domain_or_name", ")", "...
Delete attributes from a given item in a domain. :type domain_or_name: string or :class:`boto.sdb.domain.Domain` object. :param domain_or_name: Either the name of a domain or a Domain object :type item_name: string :param item_name: The name of the item whose attributes are being ...
[ "Delete", "attributes", "from", "a", "given", "item", "in", "a", "domain", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/sdb/connection.py#L504-L555
50,894
yyuu/botornado
boto/vpc/__init__.py
VPCConnection.get_all_vpcs
def get_all_vpcs(self, vpc_ids=None, filters=None): """ Retrieve information about your VPCs. You can filter results to return information only about those VPCs that match your search parameters. Otherwise, all VPCs associated with your account are returned. :type vpc_...
python
def get_all_vpcs(self, vpc_ids=None, filters=None): """ Retrieve information about your VPCs. You can filter results to return information only about those VPCs that match your search parameters. Otherwise, all VPCs associated with your account are returned. :type vpc_...
[ "def", "get_all_vpcs", "(", "self", ",", "vpc_ids", "=", "None", ",", "filters", "=", "None", ")", ":", "params", "=", "{", "}", "if", "vpc_ids", ":", "self", ".", "build_list_params", "(", "params", ",", "vpc_ids", ",", "'VpcId'", ")", "if", "filters"...
Retrieve information about your VPCs. You can filter results to return information only about those VPCs that match your search parameters. Otherwise, all VPCs associated with your account are returned. :type vpc_ids: list :param vpc_ids: A list of strings with the desired VPC...
[ "Retrieve", "information", "about", "your", "VPCs", ".", "You", "can", "filter", "results", "to", "return", "information", "only", "about", "those", "VPCs", "that", "match", "your", "search", "parameters", ".", "Otherwise", "all", "VPCs", "associated", "with", ...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/vpc/__init__.py#L41-L72
50,895
yyuu/botornado
boto/vpc/__init__.py
VPCConnection.get_all_route_tables
def get_all_route_tables(self, route_table_ids=None, filters=None): """ Retrieve information about your routing tables. You can filter results to return information only about those route tables that match your search parameters. Otherwise, all route tables associated with your a...
python
def get_all_route_tables(self, route_table_ids=None, filters=None): """ Retrieve information about your routing tables. You can filter results to return information only about those route tables that match your search parameters. Otherwise, all route tables associated with your a...
[ "def", "get_all_route_tables", "(", "self", ",", "route_table_ids", "=", "None", ",", "filters", "=", "None", ")", ":", "params", "=", "{", "}", "if", "route_table_ids", ":", "self", ".", "build_list_params", "(", "params", ",", "route_table_ids", ",", "\"Ro...
Retrieve information about your routing tables. You can filter results to return information only about those route tables that match your search parameters. Otherwise, all route tables associated with your account are returned. :type route_table_ids: list :param route_table_ids...
[ "Retrieve", "information", "about", "your", "routing", "tables", ".", "You", "can", "filter", "results", "to", "return", "information", "only", "about", "those", "route", "tables", "that", "match", "your", "search", "parameters", ".", "Otherwise", "all", "route"...
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/vpc/__init__.py#L102-L125
50,896
yyuu/botornado
boto/vpc/__init__.py
VPCConnection.associate_route_table
def associate_route_table(self, route_table_id, subnet_id): """ Associates a route table with a specific subnet. :type route_table_id: str :param route_table_id: The ID of the route table to associate. :type subnet_id: str :param subnet_id: The ID of the subnet to assoc...
python
def associate_route_table(self, route_table_id, subnet_id): """ Associates a route table with a specific subnet. :type route_table_id: str :param route_table_id: The ID of the route table to associate. :type subnet_id: str :param subnet_id: The ID of the subnet to assoc...
[ "def", "associate_route_table", "(", "self", ",", "route_table_id", ",", "subnet_id", ")", ":", "params", "=", "{", "'RouteTableId'", ":", "route_table_id", ",", "'SubnetId'", ":", "subnet_id", "}", "result", "=", "self", ".", "get_object", "(", "'AssociateRoute...
Associates a route table with a specific subnet. :type route_table_id: str :param route_table_id: The ID of the route table to associate. :type subnet_id: str :param subnet_id: The ID of the subnet to associate with. :rtype: str :return: The ID of the association creat...
[ "Associates", "a", "route", "table", "with", "a", "specific", "subnet", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/vpc/__init__.py#L127-L146
50,897
yyuu/botornado
boto/vpc/__init__.py
VPCConnection.create_route
def create_route(self, route_table_id, destination_cidr_block, gateway_id=None, instance_id=None): """ Creates a new route in the route table within a VPC. The route's target can be either a gateway attached to the VPC or a NAT instance in the VPC. :type route_table_id: str ...
python
def create_route(self, route_table_id, destination_cidr_block, gateway_id=None, instance_id=None): """ Creates a new route in the route table within a VPC. The route's target can be either a gateway attached to the VPC or a NAT instance in the VPC. :type route_table_id: str ...
[ "def", "create_route", "(", "self", ",", "route_table_id", ",", "destination_cidr_block", ",", "gateway_id", "=", "None", ",", "instance_id", "=", "None", ")", ":", "params", "=", "{", "'RouteTableId'", ":", "route_table_id", ",", "'DestinationCidrBlock'", ":", ...
Creates a new route in the route table within a VPC. The route's target can be either a gateway attached to the VPC or a NAT instance in the VPC. :type route_table_id: str :param route_table_id: The ID of the route table for the route. :type destination_cidr_block: str ...
[ "Creates", "a", "new", "route", "in", "the", "route", "table", "within", "a", "VPC", ".", "The", "route", "s", "target", "can", "be", "either", "a", "gateway", "attached", "to", "the", "VPC", "or", "a", "NAT", "instance", "in", "the", "VPC", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/vpc/__init__.py#L189-L221
50,898
yyuu/botornado
boto/vpc/__init__.py
VPCConnection.delete_route
def delete_route(self, route_table_id, destination_cidr_block): """ Deletes a route from a route table within a VPC. :type route_table_id: str :param route_table_id: The ID of the route table with the route. :type destination_cidr_block: str :param destination_cidr_bloc...
python
def delete_route(self, route_table_id, destination_cidr_block): """ Deletes a route from a route table within a VPC. :type route_table_id: str :param route_table_id: The ID of the route table with the route. :type destination_cidr_block: str :param destination_cidr_bloc...
[ "def", "delete_route", "(", "self", ",", "route_table_id", ",", "destination_cidr_block", ")", ":", "params", "=", "{", "'RouteTableId'", ":", "route_table_id", ",", "'DestinationCidrBlock'", ":", "destination_cidr_block", "}", "return", "self", ".", "get_status", "...
Deletes a route from a route table within a VPC. :type route_table_id: str :param route_table_id: The ID of the route table with the route. :type destination_cidr_block: str :param destination_cidr_block: The CIDR address block used for destinatio...
[ "Deletes", "a", "route", "from", "a", "route", "table", "within", "a", "VPC", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/vpc/__init__.py#L223-L242
50,899
yyuu/botornado
boto/vpc/__init__.py
VPCConnection.get_all_internet_gateways
def get_all_internet_gateways(self, internet_gateway_ids=None, filters=None): """ Get a list of internet gateways. You can filter results to return information about only those gateways that you're interested in. :type internet_gateway_ids: list :param internet_gateway_ids: A li...
python
def get_all_internet_gateways(self, internet_gateway_ids=None, filters=None): """ Get a list of internet gateways. You can filter results to return information about only those gateways that you're interested in. :type internet_gateway_ids: list :param internet_gateway_ids: A li...
[ "def", "get_all_internet_gateways", "(", "self", ",", "internet_gateway_ids", "=", "None", ",", "filters", "=", "None", ")", ":", "params", "=", "{", "}", "if", "internet_gateway_ids", ":", "self", ".", "build_list_params", "(", "params", ",", "internet_gateway_...
Get a list of internet gateways. You can filter results to return information about only those gateways that you're interested in. :type internet_gateway_ids: list :param internet_gateway_ids: A list of strings with the desired gateway IDs. :type filters: list of tuples :param ...
[ "Get", "a", "list", "of", "internet", "gateways", ".", "You", "can", "filter", "results", "to", "return", "information", "about", "only", "those", "gateways", "that", "you", "re", "interested", "in", "." ]
fffb056f5ff2324d1d5c1304014cfb1d899f602e
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/vpc/__init__.py#L246-L265