partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
MetaModel.select_many
Query the metamodel for a set of instances of some *kind*. Query operators such as where_eq(), order_by() or filter functions may be passed as optional arguments. Usage example: >>> m = xtuml.load_metamodel('db.sql') >>> inst_set = m.select_many('My_Class', lamb...
xtuml/meta.py
def select_many(self, kind, *args): ''' Query the metamodel for a set of instances of some *kind*. Query operators such as where_eq(), order_by() or filter functions may be passed as optional arguments. Usage example: >>> m = xtuml.load_metamodel('db.sql...
def select_many(self, kind, *args): ''' Query the metamodel for a set of instances of some *kind*. Query operators such as where_eq(), order_by() or filter functions may be passed as optional arguments. Usage example: >>> m = xtuml.load_metamodel('db.sql...
[ "Query", "the", "metamodel", "for", "a", "set", "of", "instances", "of", "some", "*", "kind", "*", ".", "Query", "operators", "such", "as", "where_eq", "()", "order_by", "()", "or", "filter", "functions", "may", "be", "passed", "as", "optional", "arguments...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/meta.py#L1260-L1272
[ "def", "select_many", "(", "self", ",", "kind", ",", "*", "args", ")", ":", "metaclass", "=", "self", ".", "find_metaclass", "(", "kind", ")", "return", "metaclass", ".", "select_many", "(", "*", "args", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
MetaModel.select_one
Query the metamodel for a single instance of some *kind*. Query operators such as where_eq(), order_by() or filter functions may be passed as optional arguments. Usage example: >>> m = xtuml.load_metamodel('db.sql') >>> inst = m.select_one('My_Class', lambda sel...
xtuml/meta.py
def select_one(self, kind, *args): ''' Query the metamodel for a single instance of some *kind*. Query operators such as where_eq(), order_by() or filter functions may be passed as optional arguments. Usage example: >>> m = xtuml.load_metamodel('db.sql')...
def select_one(self, kind, *args): ''' Query the metamodel for a single instance of some *kind*. Query operators such as where_eq(), order_by() or filter functions may be passed as optional arguments. Usage example: >>> m = xtuml.load_metamodel('db.sql')...
[ "Query", "the", "metamodel", "for", "a", "single", "instance", "of", "some", "*", "kind", "*", ".", "Query", "operators", "such", "as", "where_eq", "()", "order_by", "()", "or", "filter", "functions", "may", "be", "passed", "as", "optional", "arguments", "...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/meta.py#L1274-L1286
[ "def", "select_one", "(", "self", ",", "kind", ",", "*", "args", ")", ":", "metaclass", "=", "self", ".", "find_metaclass", "(", "kind", ")", "return", "metaclass", ".", "select_one", "(", "*", "args", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
api_twitter
Gets the twitter feed from a given handle. :return: The feed in json format.
hyperion/api/social.py
async def api_twitter(request): """ Gets the twitter feed from a given handle. :return: The feed in json format. """ handle = request.match_info.get('handle', None) if handle is None: raise web.HTTPNotFound(body="Not found.") try: posts = await fetch_twitter(handle) exce...
async def api_twitter(request): """ Gets the twitter feed from a given handle. :return: The feed in json format. """ handle = request.match_info.get('handle', None) if handle is None: raise web.HTTPNotFound(body="Not found.") try: posts = await fetch_twitter(handle) exce...
[ "Gets", "the", "twitter", "feed", "from", "a", "given", "handle", ".", ":", "return", ":", "The", "feed", "in", "json", "format", "." ]
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/api/social.py#L8-L21
[ "async", "def", "api_twitter", "(", "request", ")", ":", "handle", "=", "request", ".", "match_info", ".", "get", "(", "'handle'", ",", "None", ")", "if", "handle", "is", "None", ":", "raise", "web", ".", "HTTPNotFound", "(", "body", "=", "\"Not found.\"...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
send
Sends header, payload, and topics through a ZeroMQ socket. :param socket: a zmq socket. :param header: a list of byte strings which represent a message header. :param payload: the serialized byte string of a payload. :param topics: a chain of topics. :param flags: zmq flags to send messages.
zeronimo/messaging.py
def send(socket, header, payload, topics=(), flags=0): """Sends header, payload, and topics through a ZeroMQ socket. :param socket: a zmq socket. :param header: a list of byte strings which represent a message header. :param payload: the serialized byte string of a payload. :param topics: a chain o...
def send(socket, header, payload, topics=(), flags=0): """Sends header, payload, and topics through a ZeroMQ socket. :param socket: a zmq socket. :param header: a list of byte strings which represent a message header. :param payload: the serialized byte string of a payload. :param topics: a chain o...
[ "Sends", "header", "payload", "and", "topics", "through", "a", "ZeroMQ", "socket", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/messaging.py#L72-L87
[ "def", "send", "(", "socket", ",", "header", ",", "payload", ",", "topics", "=", "(", ")", ",", "flags", "=", "0", ")", ":", "msgs", "=", "[", "]", "msgs", ".", "extend", "(", "topics", ")", "msgs", ".", "append", "(", "SEAM", ")", "msgs", ".",...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
recv
Receives header, payload, and topics through a ZeroMQ socket. :param socket: a zmq socket. :param flags: zmq flags to receive messages. :param capture: a function to capture received messages.
zeronimo/messaging.py
def recv(socket, flags=0, capture=(lambda msgs: None)): """Receives header, payload, and topics through a ZeroMQ socket. :param socket: a zmq socket. :param flags: zmq flags to receive messages. :param capture: a function to capture received messages. """ msgs = eintr_retry_zmq(socket.recv_mul...
def recv(socket, flags=0, capture=(lambda msgs: None)): """Receives header, payload, and topics through a ZeroMQ socket. :param socket: a zmq socket. :param flags: zmq flags to receive messages. :param capture: a function to capture received messages. """ msgs = eintr_retry_zmq(socket.recv_mul...
[ "Receives", "header", "payload", "and", "topics", "through", "a", "ZeroMQ", "socket", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/messaging.py#L90-L100
[ "def", "recv", "(", "socket", ",", "flags", "=", "0", ",", "capture", "=", "(", "lambda", "msgs", ":", "None", ")", ")", ":", "msgs", "=", "eintr_retry_zmq", "(", "socket", ".", "recv_multipart", ",", "flags", ")", "capture", "(", "msgs", ")", "retur...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
dead_code
This also finds code you are working on today!
build.py
def dead_code(): """ This also finds code you are working on today! """ with safe_cd(SRC): if IS_TRAVIS: command = "{0} vulture {1}".format(PYTHON, PROJECT_NAME).strip().split() else: command = "{0} vulture {1}".format(PIPENV, PROJECT_NAME).strip().split() ...
def dead_code(): """ This also finds code you are working on today! """ with safe_cd(SRC): if IS_TRAVIS: command = "{0} vulture {1}".format(PYTHON, PROJECT_NAME).strip().split() else: command = "{0} vulture {1}".format(PIPENV, PROJECT_NAME).strip().split() ...
[ "This", "also", "finds", "code", "you", "are", "working", "on", "today!" ]
matthewdeanmartin/find_known_secrets
python
https://github.com/matthewdeanmartin/find_known_secrets/blob/f25735c1ab4512bad85ade33af7021f6fac1d13b/build.py#L332-L351
[ "def", "dead_code", "(", ")", ":", "with", "safe_cd", "(", "SRC", ")", ":", "if", "IS_TRAVIS", ":", "command", "=", "\"{0} vulture {1}\"", ".", "format", "(", "PYTHON", ",", "PROJECT_NAME", ")", ".", "strip", "(", ")", ".", "split", "(", ")", "else", ...
f25735c1ab4512bad85ade33af7021f6fac1d13b
test
parse_emails
Take a string or list of strings and try to extract all the emails
comdev/lib.py
def parse_emails(values): ''' Take a string or list of strings and try to extract all the emails ''' emails = [] if isinstance(values, str): values = [values] # now we know we have a list of strings for value in values: matches = re_emails.findall(value) emails.extend...
def parse_emails(values): ''' Take a string or list of strings and try to extract all the emails ''' emails = [] if isinstance(values, str): values = [values] # now we know we have a list of strings for value in values: matches = re_emails.findall(value) emails.extend...
[ "Take", "a", "string", "or", "list", "of", "strings", "and", "try", "to", "extract", "all", "the", "emails" ]
kejbaly2/comdev
python
https://github.com/kejbaly2/comdev/blob/5a9067d3c1ae46eeccb9d36e8c231ea5224b42b4/comdev/lib.py#L48-L59
[ "def", "parse_emails", "(", "values", ")", ":", "emails", "=", "[", "]", "if", "isinstance", "(", "values", ",", "str", ")", ":", "values", "=", "[", "values", "]", "# now we know we have a list of strings", "for", "value", "in", "values", ":", "matches", ...
5a9067d3c1ae46eeccb9d36e8c231ea5224b42b4
test
rpc
Marks a method as RPC.
zeronimo/application.py
def rpc(f=None, **kwargs): """Marks a method as RPC.""" if f is not None: if isinstance(f, six.string_types): if 'name' in kwargs: raise ValueError('name option duplicated') kwargs['name'] = f else: return rpc(**kwargs)(f) return functools....
def rpc(f=None, **kwargs): """Marks a method as RPC.""" if f is not None: if isinstance(f, six.string_types): if 'name' in kwargs: raise ValueError('name option duplicated') kwargs['name'] = f else: return rpc(**kwargs)(f) return functools....
[ "Marks", "a", "method", "as", "RPC", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/application.py#L58-L67
[ "def", "rpc", "(", "f", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "f", "is", "not", "None", ":", "if", "isinstance", "(", "f", ",", "six", ".", "string_types", ")", ":", "if", "'name'", "in", "kwargs", ":", "raise", "ValueError", "(",...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
rpc_spec_table
Collects methods which are speced as RPC.
zeronimo/application.py
def rpc_spec_table(app): """Collects methods which are speced as RPC.""" table = {} for attr, value in inspect.getmembers(app): rpc_spec = get_rpc_spec(value, default=None) if rpc_spec is None: continue table[rpc_spec.name] = (value, rpc_spec) return table
def rpc_spec_table(app): """Collects methods which are speced as RPC.""" table = {} for attr, value in inspect.getmembers(app): rpc_spec = get_rpc_spec(value, default=None) if rpc_spec is None: continue table[rpc_spec.name] = (value, rpc_spec) return table
[ "Collects", "methods", "which", "are", "speced", "as", "RPC", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/application.py#L70-L78
[ "def", "rpc_spec_table", "(", "app", ")", ":", "table", "=", "{", "}", "for", "attr", ",", "value", "in", "inspect", ".", "getmembers", "(", "app", ")", ":", "rpc_spec", "=", "get_rpc_spec", "(", "value", ",", "default", "=", "None", ")", "if", "rpc_...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
normalize_postcode_middleware
If there is a postcode in the url it validates and normalizes it.
hyperion/api/util.py
async def normalize_postcode_middleware(request, handler): """ If there is a postcode in the url it validates and normalizes it. """ postcode: Optional[str] = request.match_info.get('postcode', None) if postcode is None or postcode == "random": return await handler(request) elif not is_...
async def normalize_postcode_middleware(request, handler): """ If there is a postcode in the url it validates and normalizes it. """ postcode: Optional[str] = request.match_info.get('postcode', None) if postcode is None or postcode == "random": return await handler(request) elif not is_...
[ "If", "there", "is", "a", "postcode", "in", "the", "url", "it", "validates", "and", "normalizes", "it", "." ]
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/api/util.py#L16-L35
[ "async", "def", "normalize_postcode_middleware", "(", "request", ",", "handler", ")", ":", "postcode", ":", "Optional", "[", "str", "]", "=", "request", ".", "match_info", ".", "get", "(", "'postcode'", ",", "None", ")", "if", "postcode", "is", "None", "or...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
make_repr
Generates a string of object initialization code style. It is useful for custom __repr__ methods:: class Example(object): def __init__(self, param, keyword=None): self.param = param self.keyword = keyword def __repr__(self): return make_r...
zeronimo/helpers.py
def make_repr(obj, params=None, keywords=None, data=None, name=None, reprs=None): """Generates a string of object initialization code style. It is useful for custom __repr__ methods:: class Example(object): def __init__(self, param, keyword=None): self.param = p...
def make_repr(obj, params=None, keywords=None, data=None, name=None, reprs=None): """Generates a string of object initialization code style. It is useful for custom __repr__ methods:: class Example(object): def __init__(self, param, keyword=None): self.param = p...
[ "Generates", "a", "string", "of", "object", "initialization", "code", "style", ".", "It", "is", "useful", "for", "custom", "__repr__", "methods", "::" ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/helpers.py#L42-L71
[ "def", "make_repr", "(", "obj", ",", "params", "=", "None", ",", "keywords", "=", "None", ",", "data", "=", "None", ",", "name", "=", "None", ",", "reprs", "=", "None", ")", ":", "opts", "=", "[", "]", "if", "params", "is", "not", "None", ":", ...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
eintr_retry
Calls a function. If an error of the given exception type with interrupted system call (EINTR) occurs calls the function again.
zeronimo/helpers.py
def eintr_retry(exc_type, f, *args, **kwargs): """Calls a function. If an error of the given exception type with interrupted system call (EINTR) occurs calls the function again. """ while True: try: return f(*args, **kwargs) except exc_type as exc: if exc.errno !...
def eintr_retry(exc_type, f, *args, **kwargs): """Calls a function. If an error of the given exception type with interrupted system call (EINTR) occurs calls the function again. """ while True: try: return f(*args, **kwargs) except exc_type as exc: if exc.errno !...
[ "Calls", "a", "function", ".", "If", "an", "error", "of", "the", "given", "exception", "type", "with", "interrupted", "system", "call", "(", "EINTR", ")", "occurs", "calls", "the", "function", "again", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/helpers.py#L97-L108
[ "def", "eintr_retry", "(", "exc_type", ",", "f", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "while", "True", ":", "try", ":", "return", "f", "(", "*", "args", ",", "*", "*", "kwargs", ")", "except", "exc_type", "as", "exc", ":", "if", ...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
eintr_retry_zmq
The specialization of :func:`eintr_retry` by :exc:`zmq.ZMQError`.
zeronimo/helpers.py
def eintr_retry_zmq(f, *args, **kwargs): """The specialization of :func:`eintr_retry` by :exc:`zmq.ZMQError`.""" return eintr_retry(zmq.ZMQError, f, *args, **kwargs)
def eintr_retry_zmq(f, *args, **kwargs): """The specialization of :func:`eintr_retry` by :exc:`zmq.ZMQError`.""" return eintr_retry(zmq.ZMQError, f, *args, **kwargs)
[ "The", "specialization", "of", ":", "func", ":", "eintr_retry", "by", ":", "exc", ":", "zmq", ".", "ZMQError", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/helpers.py#L111-L113
[ "def", "eintr_retry_zmq", "(", "f", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "eintr_retry", "(", "zmq", ".", "ZMQError", ",", "f", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
IdGenerator.next
Progress to the next identifier, and return the current one.
xtuml/tools.py
def next(self): ''' Progress to the next identifier, and return the current one. ''' val = self._current self._current = self.readfunc() return val
def next(self): ''' Progress to the next identifier, and return the current one. ''' val = self._current self._current = self.readfunc() return val
[ "Progress", "to", "the", "next", "identifier", "and", "return", "the", "current", "one", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/tools.py#L41-L47
[ "def", "next", "(", "self", ")", ":", "val", "=", "self", ".", "_current", "self", ".", "_current", "=", "self", ".", "readfunc", "(", ")", "return", "val" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
Visitor.enter
Tries to invoke a method matching the pattern *enter_<type name>*, where <type name> is the name of the type of the *node*.
xtuml/tools.py
def enter(self, node): ''' Tries to invoke a method matching the pattern *enter_<type name>*, where <type name> is the name of the type of the *node*. ''' name = 'enter_' + node.__class__.__name__ fn = getattr(self, name, self.default_enter) fn(node)
def enter(self, node): ''' Tries to invoke a method matching the pattern *enter_<type name>*, where <type name> is the name of the type of the *node*. ''' name = 'enter_' + node.__class__.__name__ fn = getattr(self, name, self.default_enter) fn(node)
[ "Tries", "to", "invoke", "a", "method", "matching", "the", "pattern", "*", "enter_<type", "name", ">", "*", "where", "<type", "name", ">", "is", "the", "name", "of", "the", "type", "of", "the", "*", "node", "*", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/tools.py#L91-L98
[ "def", "enter", "(", "self", ",", "node", ")", ":", "name", "=", "'enter_'", "+", "node", ".", "__class__", ".", "__name__", "fn", "=", "getattr", "(", "self", ",", "name", ",", "self", ".", "default_enter", ")", "fn", "(", "node", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
Visitor.leave
Tries to invoke a method matching the pattern *leave_<type name>*, where <type name> is the name of the type of the *node*.
xtuml/tools.py
def leave(self, node): ''' Tries to invoke a method matching the pattern *leave_<type name>*, where <type name> is the name of the type of the *node*. ''' name = 'leave_' + node.__class__.__name__ fn = getattr(self, name, self.default_leave) fn(node)
def leave(self, node): ''' Tries to invoke a method matching the pattern *leave_<type name>*, where <type name> is the name of the type of the *node*. ''' name = 'leave_' + node.__class__.__name__ fn = getattr(self, name, self.default_leave) fn(node)
[ "Tries", "to", "invoke", "a", "method", "matching", "the", "pattern", "*", "leave_<type", "name", ">", "*", "where", "<type", "name", ">", "is", "the", "name", "of", "the", "type", "of", "the", "*", "node", "*", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/tools.py#L100-L107
[ "def", "leave", "(", "self", ",", "node", ")", ":", "name", "=", "'leave_'", "+", "node", ".", "__class__", ".", "__name__", "fn", "=", "getattr", "(", "self", ",", "name", ",", "self", ".", "default_leave", ")", "fn", "(", "node", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
Walker.accept
Invoke the visitors before and after decending down the tree. The walker will also try to invoke a method matching the pattern *accept_<type name>*, where <type name> is the name of the accepted *node*.
xtuml/tools.py
def accept(self, node, **kwargs): ''' Invoke the visitors before and after decending down the tree. The walker will also try to invoke a method matching the pattern *accept_<type name>*, where <type name> is the name of the accepted *node*. ''' if node is None: ...
def accept(self, node, **kwargs): ''' Invoke the visitors before and after decending down the tree. The walker will also try to invoke a method matching the pattern *accept_<type name>*, where <type name> is the name of the accepted *node*. ''' if node is None: ...
[ "Invoke", "the", "visitors", "before", "and", "after", "decending", "down", "the", "tree", ".", "The", "walker", "will", "also", "try", "to", "invoke", "a", "method", "matching", "the", "pattern", "*", "accept_<type", "name", ">", "*", "where", "<type", "n...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/tools.py#L205-L225
[ "def", "accept", "(", "self", ",", "node", ",", "*", "*", "kwargs", ")", ":", "if", "node", "is", "None", ":", "return", "for", "v", "in", "self", ".", "visitors", ":", "v", ".", "enter", "(", "node", ")", "name", "=", "'accept_'", "+", "node", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
Walker.default_accept
The default accept behaviour is to decend into the iterable member *node.children* (if available).
xtuml/tools.py
def default_accept(self, node, **kwargs): ''' The default accept behaviour is to decend into the iterable member *node.children* (if available). ''' if not hasattr(node, 'children'): return for child in node.children: self.accept(child, **...
def default_accept(self, node, **kwargs): ''' The default accept behaviour is to decend into the iterable member *node.children* (if available). ''' if not hasattr(node, 'children'): return for child in node.children: self.accept(child, **...
[ "The", "default", "accept", "behaviour", "is", "to", "decend", "into", "the", "iterable", "member", "*", "node", ".", "children", "*", "(", "if", "available", ")", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/tools.py#L227-L236
[ "def", "default_accept", "(", "self", ",", "node", ",", "*", "*", "kwargs", ")", ":", "if", "not", "hasattr", "(", "node", ",", "'children'", ")", ":", "return", "for", "child", "in", "node", ".", "children", ":", "self", ".", "accept", "(", "child",...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
NodePrintVisitor.render
Try to invoke a method matching the pattern *render_<type name>*, where <type name> is the name of the rendering *node*.
xtuml/tools.py
def render(self, node): ''' Try to invoke a method matching the pattern *render_<type name>*, where <type name> is the name of the rendering *node*. ''' name = 'render_' + type(node).__name__ fn = getattr(self, name, self.default_render) return fn(node)
def render(self, node): ''' Try to invoke a method matching the pattern *render_<type name>*, where <type name> is the name of the rendering *node*. ''' name = 'render_' + type(node).__name__ fn = getattr(self, name, self.default_render) return fn(node)
[ "Try", "to", "invoke", "a", "method", "matching", "the", "pattern", "*", "render_<type", "name", ">", "*", "where", "<type", "name", ">", "is", "the", "name", "of", "the", "rendering", "*", "node", "*", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/tools.py#L262-L269
[ "def", "render", "(", "self", ",", "node", ")", ":", "name", "=", "'render_'", "+", "type", "(", "node", ")", ".", "__name__", "fn", "=", "getattr", "(", "self", ",", "name", ",", "self", ".", "default_render", ")", "return", "fn", "(", "node", ")"...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
MyWalker.accept_S_SYS
A System Model contains top-level packages
examples/print_packageable_elements.py
def accept_S_SYS(self, inst): ''' A System Model contains top-level packages ''' for child in many(inst).EP_PKG[1401](): self.accept(child)
def accept_S_SYS(self, inst): ''' A System Model contains top-level packages ''' for child in many(inst).EP_PKG[1401](): self.accept(child)
[ "A", "System", "Model", "contains", "top", "-", "level", "packages" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/examples/print_packageable_elements.py#L34-L39
[ "def", "accept_S_SYS", "(", "self", ",", "inst", ")", ":", "for", "child", "in", "many", "(", "inst", ")", ".", "EP_PKG", "[", "1401", "]", "(", ")", ":", "self", ".", "accept", "(", "child", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
MyWalker.accept_C_C
A Component contains packageable elements
examples/print_packageable_elements.py
def accept_C_C(self, inst): ''' A Component contains packageable elements ''' for child in many(inst).PE_PE[8003](): self.accept(child)
def accept_C_C(self, inst): ''' A Component contains packageable elements ''' for child in many(inst).PE_PE[8003](): self.accept(child)
[ "A", "Component", "contains", "packageable", "elements" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/examples/print_packageable_elements.py#L47-L52
[ "def", "accept_C_C", "(", "self", ",", "inst", ")", ":", "for", "child", "in", "many", "(", "inst", ")", ".", "PE_PE", "[", "8003", "]", "(", ")", ":", "self", ".", "accept", "(", "child", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
MyWalker.accept_EP_PKG
A Package contains packageable elements
examples/print_packageable_elements.py
def accept_EP_PKG(self, inst): ''' A Package contains packageable elements ''' for child in many(inst).PE_PE[8000](): self.accept(child)
def accept_EP_PKG(self, inst): ''' A Package contains packageable elements ''' for child in many(inst).PE_PE[8000](): self.accept(child)
[ "A", "Package", "contains", "packageable", "elements" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/examples/print_packageable_elements.py#L54-L59
[ "def", "accept_EP_PKG", "(", "self", ",", "inst", ")", ":", "for", "child", "in", "many", "(", "inst", ")", ".", "PE_PE", "[", "8000", "]", "(", ")", ":", "self", ".", "accept", "(", "child", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
update_bikes
A background task that retrieves bike data. :param delta: The amount of time to wait between checks.
hyperion/models/util.py
async def update_bikes(delta: Optional[timedelta] = None): """ A background task that retrieves bike data. :param delta: The amount of time to wait between checks. """ async def update(delta: timedelta): logger.info("Fetching bike data.") if await should_update_bikes(delta): ...
async def update_bikes(delta: Optional[timedelta] = None): """ A background task that retrieves bike data. :param delta: The amount of time to wait between checks. """ async def update(delta: timedelta): logger.info("Fetching bike data.") if await should_update_bikes(delta): ...
[ "A", "background", "task", "that", "retrieves", "bike", "data", ".", ":", "param", "delta", ":", "The", "amount", "of", "time", "to", "wait", "between", "checks", "." ]
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/models/util.py#L18-L55
[ "async", "def", "update_bikes", "(", "delta", ":", "Optional", "[", "timedelta", "]", "=", "None", ")", ":", "async", "def", "update", "(", "delta", ":", "timedelta", ")", ":", "logger", ".", "info", "(", "\"Fetching bike data.\"", ")", "if", "await", "s...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
should_update_bikes
Checks the most recently cached bike and returns true if it either doesn't exist or :return: Whether the cache should be updated. todo what if there are no bikes added for a week? ... every request will be triggered.
hyperion/models/util.py
async def should_update_bikes(delta: timedelta): """ Checks the most recently cached bike and returns true if it either doesn't exist or :return: Whether the cache should be updated. todo what if there are no bikes added for a week? ... every request will be triggered. """ bike = Bike.get_m...
async def should_update_bikes(delta: timedelta): """ Checks the most recently cached bike and returns true if it either doesn't exist or :return: Whether the cache should be updated. todo what if there are no bikes added for a week? ... every request will be triggered. """ bike = Bike.get_m...
[ "Checks", "the", "most", "recently", "cached", "bike", "and", "returns", "true", "if", "it", "either", "doesn", "t", "exist", "or", ":", "return", ":", "Whether", "the", "cache", "should", "be", "updated", "." ]
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/models/util.py#L58-L70
[ "async", "def", "should_update_bikes", "(", "delta", ":", "timedelta", ")", ":", "bike", "=", "Bike", ".", "get_most_recent_bike", "(", ")", "if", "bike", "is", "not", "None", ":", "return", "bike", ".", "cached_date", "<", "datetime", ".", "now", "(", "...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
get_bikes
Gets stolen bikes from the database within a certain radius (km) of a given postcode. Selects a square from the database and then filters out the corners of the square. :param postcode: The postcode to look up. :param kilometers: The radius (km) of the search. :return: The bikes in that radius o...
hyperion/models/util.py
async def get_bikes(postcode: PostCodeLike, kilometers=1) -> Optional[List[Bike]]: """ Gets stolen bikes from the database within a certain radius (km) of a given postcode. Selects a square from the database and then filters out the corners of the square. :param postcode: The postcode to look up...
async def get_bikes(postcode: PostCodeLike, kilometers=1) -> Optional[List[Bike]]: """ Gets stolen bikes from the database within a certain radius (km) of a given postcode. Selects a square from the database and then filters out the corners of the square. :param postcode: The postcode to look up...
[ "Gets", "stolen", "bikes", "from", "the", "database", "within", "a", "certain", "radius", "(", "km", ")", "of", "a", "given", "postcode", ".", "Selects", "a", "square", "from", "the", "database", "and", "then", "filters", "out", "the", "corners", "of", "...
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/models/util.py#L73-L115
[ "async", "def", "get_bikes", "(", "postcode", ":", "PostCodeLike", ",", "kilometers", "=", "1", ")", "->", "Optional", "[", "List", "[", "Bike", "]", "]", ":", "try", ":", "postcode_opt", "=", "await", "get_postcode", "(", "postcode", ")", "except", "Cac...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
get_postcode_random
Gets a random postcode object.. Acts as a middleware between us and the API, caching results. :return: The PostCode object else None if the postcode does not exist.
hyperion/models/util.py
async def get_postcode_random() -> Postcode: """ Gets a random postcode object.. Acts as a middleware between us and the API, caching results. :return: The PostCode object else None if the postcode does not exist. """ try: postcode = await fetch_postcode_random() except (ApiError, Ci...
async def get_postcode_random() -> Postcode: """ Gets a random postcode object.. Acts as a middleware between us and the API, caching results. :return: The PostCode object else None if the postcode does not exist. """ try: postcode = await fetch_postcode_random() except (ApiError, Ci...
[ "Gets", "a", "random", "postcode", "object", "..", "Acts", "as", "a", "middleware", "between", "us", "and", "the", "API", "caching", "results", ".", ":", "return", ":", "The", "PostCode", "object", "else", "None", "if", "the", "postcode", "does", "not", ...
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/models/util.py#L118-L131
[ "async", "def", "get_postcode_random", "(", ")", "->", "Postcode", ":", "try", ":", "postcode", "=", "await", "fetch_postcode_random", "(", ")", "except", "(", "ApiError", ",", "CircuitBreakerError", ")", ":", "raise", "CachingError", "(", "f\"Requested postcode i...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
get_postcode
Gets the postcode object for a given postcode string. Acts as a middleware between us and the API, caching results. :param postcode_like: The either a string postcode or PostCode object. :return: The PostCode object else None if the postcode does not exist.. :raises CachingError: When the postcode is no...
hyperion/models/util.py
async def get_postcode(postcode_like: PostCodeLike) -> Optional[Postcode]: """ Gets the postcode object for a given postcode string. Acts as a middleware between us and the API, caching results. :param postcode_like: The either a string postcode or PostCode object. :return: The PostCode object else ...
async def get_postcode(postcode_like: PostCodeLike) -> Optional[Postcode]: """ Gets the postcode object for a given postcode string. Acts as a middleware between us and the API, caching results. :param postcode_like: The either a string postcode or PostCode object. :return: The PostCode object else ...
[ "Gets", "the", "postcode", "object", "for", "a", "given", "postcode", "string", ".", "Acts", "as", "a", "middleware", "between", "us", "and", "the", "API", "caching", "results", ".", ":", "param", "postcode_like", ":", "The", "either", "a", "string", "post...
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/models/util.py#L134-L157
[ "async", "def", "get_postcode", "(", "postcode_like", ":", "PostCodeLike", ")", "->", "Optional", "[", "Postcode", "]", ":", "if", "isinstance", "(", "postcode_like", ",", "Postcode", ")", ":", "return", "postcode_like", "postcode_like", "=", "postcode_like", "....
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
get_neighbourhood
Gets a police neighbourhood from the database. Acts as a middleware between us and the API, caching results. :param postcode_like: The UK postcode to look up. :return: The Neighbourhood or None if the postcode does not exist. :raises CachingError: If the needed neighbourhood is not in cache, and the fet...
hyperion/models/util.py
async def get_neighbourhood(postcode_like: PostCodeLike) -> Optional[Neighbourhood]: """ Gets a police neighbourhood from the database. Acts as a middleware between us and the API, caching results. :param postcode_like: The UK postcode to look up. :return: The Neighbourhood or None if the postcode d...
async def get_neighbourhood(postcode_like: PostCodeLike) -> Optional[Neighbourhood]: """ Gets a police neighbourhood from the database. Acts as a middleware between us and the API, caching results. :param postcode_like: The UK postcode to look up. :return: The Neighbourhood or None if the postcode d...
[ "Gets", "a", "police", "neighbourhood", "from", "the", "database", ".", "Acts", "as", "a", "middleware", "between", "us", "and", "the", "API", "caching", "results", ".", ":", "param", "postcode_like", ":", "The", "UK", "postcode", "to", "look", "up", ".", ...
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/models/util.py#L172-L212
[ "async", "def", "get_neighbourhood", "(", "postcode_like", ":", "PostCodeLike", ")", "->", "Optional", "[", "Neighbourhood", "]", ":", "try", ":", "postcode", "=", "await", "get_postcode", "(", "postcode_like", ")", "except", "CachingError", "as", "e", ":", "r...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
FFIExt.get_cdata
all args-->_cffi_backend.buffer Returns-->cdata (if a SINGLE argument was provided) LIST of cdata (if a args was a tuple or list)
cffi_utils/ffi.py
def get_cdata(self, *args): ''' all args-->_cffi_backend.buffer Returns-->cdata (if a SINGLE argument was provided) LIST of cdata (if a args was a tuple or list) ''' res = tuple([ self.from_buffer(x) for x in args ]) if len(res) == 0...
def get_cdata(self, *args): ''' all args-->_cffi_backend.buffer Returns-->cdata (if a SINGLE argument was provided) LIST of cdata (if a args was a tuple or list) ''' res = tuple([ self.from_buffer(x) for x in args ]) if len(res) == 0...
[ "all", "args", "--", ">", "_cffi_backend", ".", "buffer", "Returns", "--", ">", "cdata", "(", "if", "a", "SINGLE", "argument", "was", "provided", ")", "LIST", "of", "cdata", "(", "if", "a", "args", "was", "a", "tuple", "or", "list", ")" ]
sundarnagarajan/cffi_utils
python
https://github.com/sundarnagarajan/cffi_utils/blob/1d5ab2d2fcb962372228033106bc23f1d73d31fa/cffi_utils/ffi.py#L38-L53
[ "def", "get_cdata", "(", "self", ",", "*", "args", ")", ":", "res", "=", "tuple", "(", "[", "self", ".", "from_buffer", "(", "x", ")", "for", "x", "in", "args", "]", ")", "if", "len", "(", "res", ")", "==", "0", ":", "return", "None", "elif", ...
1d5ab2d2fcb962372228033106bc23f1d73d31fa
test
FFIExt.get_buffer
all args-->_cffi_backend.CDataOwn Must be a pointer or an array Returns-->buffer (if a SINGLE argument was provided) LIST of buffer (if a args was a tuple or list)
cffi_utils/ffi.py
def get_buffer(self, *args): ''' all args-->_cffi_backend.CDataOwn Must be a pointer or an array Returns-->buffer (if a SINGLE argument was provided) LIST of buffer (if a args was a tuple or list) ''' res = tuple([ self.buffer(x) for x in arg...
def get_buffer(self, *args): ''' all args-->_cffi_backend.CDataOwn Must be a pointer or an array Returns-->buffer (if a SINGLE argument was provided) LIST of buffer (if a args was a tuple or list) ''' res = tuple([ self.buffer(x) for x in arg...
[ "all", "args", "--", ">", "_cffi_backend", ".", "CDataOwn", "Must", "be", "a", "pointer", "or", "an", "array", "Returns", "--", ">", "buffer", "(", "if", "a", "SINGLE", "argument", "was", "provided", ")", "LIST", "of", "buffer", "(", "if", "a", "args",...
sundarnagarajan/cffi_utils
python
https://github.com/sundarnagarajan/cffi_utils/blob/1d5ab2d2fcb962372228033106bc23f1d73d31fa/cffi_utils/ffi.py#L55-L71
[ "def", "get_buffer", "(", "self", ",", "*", "args", ")", ":", "res", "=", "tuple", "(", "[", "self", ".", "buffer", "(", "x", ")", "for", "x", "in", "args", "]", ")", "if", "len", "(", "res", ")", "==", "0", ":", "return", "None", "elif", "le...
1d5ab2d2fcb962372228033106bc23f1d73d31fa
test
FFIExt.get_bytes
all args-->_cffi_backend.CDataOwn Must be a pointer or an array Returns-->bytes (if a SINGLE argument was provided) LIST of bytes (if a args was a tuple or list)
cffi_utils/ffi.py
def get_bytes(self, *args): ''' all args-->_cffi_backend.CDataOwn Must be a pointer or an array Returns-->bytes (if a SINGLE argument was provided) LIST of bytes (if a args was a tuple or list) ''' res = tuple([ bytes(self.buffer(x)) for x in...
def get_bytes(self, *args): ''' all args-->_cffi_backend.CDataOwn Must be a pointer or an array Returns-->bytes (if a SINGLE argument was provided) LIST of bytes (if a args was a tuple or list) ''' res = tuple([ bytes(self.buffer(x)) for x in...
[ "all", "args", "--", ">", "_cffi_backend", ".", "CDataOwn", "Must", "be", "a", "pointer", "or", "an", "array", "Returns", "--", ">", "bytes", "(", "if", "a", "SINGLE", "argument", "was", "provided", ")", "LIST", "of", "bytes", "(", "if", "a", "args", ...
sundarnagarajan/cffi_utils
python
https://github.com/sundarnagarajan/cffi_utils/blob/1d5ab2d2fcb962372228033106bc23f1d73d31fa/cffi_utils/ffi.py#L73-L89
[ "def", "get_bytes", "(", "self", ",", "*", "args", ")", ":", "res", "=", "tuple", "(", "[", "bytes", "(", "self", ".", "buffer", "(", "x", ")", ")", "for", "x", "in", "args", "]", ")", "if", "len", "(", "res", ")", "==", "0", ":", "return", ...
1d5ab2d2fcb962372228033106bc23f1d73d31fa
test
LightSensor.get_brightness
Return the average brightness of the image.
zorg_network_camera/light_sensor.py
def get_brightness(self): """ Return the average brightness of the image. """ # Only download the image if it has changed if not self.connection.has_changed(): return self.image_brightness image_path = self.connection.download_image() converted_image...
def get_brightness(self): """ Return the average brightness of the image. """ # Only download the image if it has changed if not self.connection.has_changed(): return self.image_brightness image_path = self.connection.download_image() converted_image...
[ "Return", "the", "average", "brightness", "of", "the", "image", "." ]
zorg/zorg-network-camera
python
https://github.com/zorg/zorg-network-camera/blob/e2d15725e50370e2df0c38be6b039215873e4278/zorg_network_camera/light_sensor.py#L21-L35
[ "def", "get_brightness", "(", "self", ")", ":", "# Only download the image if it has changed", "if", "not", "self", ".", "connection", ".", "has_changed", "(", ")", ":", "return", "self", ".", "image_brightness", "image_path", "=", "self", ".", "connection", ".", ...
e2d15725e50370e2df0c38be6b039215873e4278
test
write_file
Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/command/egg_info.py
def write_file (filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ contents = "\n".join(contents) if sys.version_info >= (3,): contents = contents.encode("utf-8") f = open(filename, "wb") #...
def write_file (filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ contents = "\n".join(contents) if sys.version_info >= (3,): contents = contents.encode("utf-8") f = open(filename, "wb") #...
[ "Create", "a", "file", "with", "the", "specified", "name", "and", "write", "contents", "(", "a", "sequence", "of", "strings", "without", "line", "terminators", ")", "to", "it", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/command/egg_info.py#L381-L390
[ "def", "write_file", "(", "filename", ",", "contents", ")", ":", "contents", "=", "\"\\n\"", ".", "join", "(", "contents", ")", "if", "sys", ".", "version_info", ">=", "(", "3", ",", ")", ":", "contents", "=", "contents", ".", "encode", "(", "\"utf-8\"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
egg_info.write_file
Write `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file.
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/command/egg_info.py
def write_file(self, what, filename, data): """Write `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. """ log.info("writing %s to %s", what, filename) if sys.version_info >= (3,): ...
def write_file(self, what, filename, data): """Write `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. """ log.info("writing %s to %s", what, filename) if sys.version_info >= (3,): ...
[ "Write", "data", "to", "filename", "(", "if", "not", "a", "dry", "run", ")", "after", "announcing", "it" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/command/egg_info.py#L144-L156
[ "def", "write_file", "(", "self", ",", "what", ",", "filename", ",", "data", ")", ":", "log", ".", "info", "(", "\"writing %s to %s\"", ",", "what", ",", "filename", ")", "if", "sys", ".", "version_info", ">=", "(", "3", ",", ")", ":", "data", "=", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
manifest_maker.write_manifest
Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'.
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/command/egg_info.py
def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. """ # The manifest must be UTF-8 encodable. See #303. if sys.version_info >= (3,): ...
def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. """ # The manifest must be UTF-8 encodable. See #303. if sys.version_info >= (3,): ...
[ "Write", "the", "file", "list", "in", "self", ".", "filelist", "(", "presumably", "as", "filled", "in", "by", "add_defaults", "()", "and", "read_template", "()", ")", "to", "the", "manifest", "file", "named", "by", "self", ".", "manifest", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/setuptools/command/egg_info.py#L333-L354
[ "def", "write_manifest", "(", "self", ")", ":", "# The manifest must be UTF-8 encodable. See #303.", "if", "sys", ".", "version_info", ">=", "(", "3", ",", ")", ":", "files", "=", "[", "]", "for", "file", "in", "self", ".", "filelist", ".", "files", ":", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
switch.match
Indicate whether or not to enter a case suite. usage: ``` py for case in switch(value): if case('A'): pass elif case(1, 3): pass # for mulit-match. else: pass # for default. ```
jasily/lang/switch.py
def match(self, *args): """ Indicate whether or not to enter a case suite. usage: ``` py for case in switch(value): if case('A'): pass elif case(1, 3): pass # for mulit-match. else: pass # for d...
def match(self, *args): """ Indicate whether or not to enter a case suite. usage: ``` py for case in switch(value): if case('A'): pass elif case(1, 3): pass # for mulit-match. else: pass # for d...
[ "Indicate", "whether", "or", "not", "to", "enter", "a", "case", "suite", "." ]
Jasily/jasily-python
python
https://github.com/Jasily/jasily-python/blob/1c821a120ebbbbc3c5761f5f1e8a73588059242a/jasily/lang/switch.py#L55-L74
[ "def", "match", "(", "self", ",", "*", "args", ")", ":", "if", "not", "args", ":", "raise", "SyntaxError", "(", "'cannot case empty pattern.'", ")", "return", "self", ".", "match_args", "(", "self", ".", "_value", ",", "args", ")" ]
1c821a120ebbbbc3c5761f5f1e8a73588059242a
test
BracketMatcher._find_match
Given a valid position in the text document, try to find the position of the matching bracket. Returns -1 if unsuccessful.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/bracket_matcher.py
def _find_match(self, position): """ Given a valid position in the text document, try to find the position of the matching bracket. Returns -1 if unsuccessful. """ # Decide what character to search for and what direction to search in. document = self._text_edit.document() ...
def _find_match(self, position): """ Given a valid position in the text document, try to find the position of the matching bracket. Returns -1 if unsuccessful. """ # Decide what character to search for and what direction to search in. document = self._text_edit.document() ...
[ "Given", "a", "valid", "position", "in", "the", "text", "document", "try", "to", "find", "the", "position", "of", "the", "matching", "bracket", ".", "Returns", "-", "1", "if", "unsuccessful", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/bracket_matcher.py#L39-L70
[ "def", "_find_match", "(", "self", ",", "position", ")", ":", "# Decide what character to search for and what direction to search in.", "document", "=", "self", ".", "_text_edit", ".", "document", "(", ")", "start_char", "=", "document", ".", "characterAt", "(", "posi...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BracketMatcher._selection_for_character
Convenience method for selecting a character.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/bracket_matcher.py
def _selection_for_character(self, position): """ Convenience method for selecting a character. """ selection = QtGui.QTextEdit.ExtraSelection() cursor = self._text_edit.textCursor() cursor.setPosition(position) cursor.movePosition(QtGui.QTextCursor.NextCharacter, ...
def _selection_for_character(self, position): """ Convenience method for selecting a character. """ selection = QtGui.QTextEdit.ExtraSelection() cursor = self._text_edit.textCursor() cursor.setPosition(position) cursor.movePosition(QtGui.QTextCursor.NextCharacter, ...
[ "Convenience", "method", "for", "selecting", "a", "character", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/bracket_matcher.py#L72-L82
[ "def", "_selection_for_character", "(", "self", ",", "position", ")", ":", "selection", "=", "QtGui", ".", "QTextEdit", ".", "ExtraSelection", "(", ")", "cursor", "=", "self", ".", "_text_edit", ".", "textCursor", "(", ")", "cursor", ".", "setPosition", "(",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BracketMatcher._cursor_position_changed
Updates the document formatting based on the new cursor position.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/bracket_matcher.py
def _cursor_position_changed(self): """ Updates the document formatting based on the new cursor position. """ # Clear out the old formatting. self._text_edit.setExtraSelections([]) # Attempt to match a bracket for the new cursor position. cursor = self._text_edit.textCur...
def _cursor_position_changed(self): """ Updates the document formatting based on the new cursor position. """ # Clear out the old formatting. self._text_edit.setExtraSelections([]) # Attempt to match a bracket for the new cursor position. cursor = self._text_edit.textCur...
[ "Updates", "the", "document", "formatting", "based", "on", "the", "new", "cursor", "position", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/bracket_matcher.py#L86-L100
[ "def", "_cursor_position_changed", "(", "self", ")", ":", "# Clear out the old formatting.", "self", ".", "_text_edit", ".", "setExtraSelections", "(", "[", "]", ")", "# Attempt to match a bracket for the new cursor position.", "cursor", "=", "self", ".", "_text_edit", "....
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ContextSuite._exc_info
Bottleneck to fix up IronPython string exceptions
environment/lib/python2.7/site-packages/nose/suite.py
def _exc_info(self): """Bottleneck to fix up IronPython string exceptions """ e = self.exc_info() if sys.platform == 'cli': if isinstance(e[0], StringException): # IronPython throws these StringExceptions, but # traceback checks type(etype) == ...
def _exc_info(self): """Bottleneck to fix up IronPython string exceptions """ e = self.exc_info() if sys.platform == 'cli': if isinstance(e[0], StringException): # IronPython throws these StringExceptions, but # traceback checks type(etype) == ...
[ "Bottleneck", "to", "fix", "up", "IronPython", "string", "exceptions" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/suite.py#L183-L194
[ "def", "_exc_info", "(", "self", ")", ":", "e", "=", "self", ".", "exc_info", "(", ")", "if", "sys", ".", "platform", "==", "'cli'", ":", "if", "isinstance", "(", "e", "[", "0", "]", ",", "StringException", ")", ":", "# IronPython throws these StringExce...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ContextSuite.run
Run tests in suite inside of suite fixtures.
environment/lib/python2.7/site-packages/nose/suite.py
def run(self, result): """Run tests in suite inside of suite fixtures. """ # proxy the result for myself log.debug("suite %s (%s) run called, tests: %s", id(self), self, self._tests) #import pdb #pdb.set_trace() if self.resultProxy: result, orig = self...
def run(self, result): """Run tests in suite inside of suite fixtures. """ # proxy the result for myself log.debug("suite %s (%s) run called, tests: %s", id(self), self, self._tests) #import pdb #pdb.set_trace() if self.resultProxy: result, orig = self...
[ "Run", "tests", "in", "suite", "inside", "of", "suite", "fixtures", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/suite.py#L196-L232
[ "def", "run", "(", "self", ",", "result", ")", ":", "# proxy the result for myself", "log", ".", "debug", "(", "\"suite %s (%s) run called, tests: %s\"", ",", "id", "(", "self", ")", ",", "self", ",", "self", ".", "_tests", ")", "#import pdb", "#pdb.set_trace()"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ContextSuiteFactory.ancestry
Return the ancestry of the context (that is, all of the packages and modules containing the context), in order of descent with the outermost ancestor last. This method is a generator.
environment/lib/python2.7/site-packages/nose/suite.py
def ancestry(self, context): """Return the ancestry of the context (that is, all of the packages and modules containing the context), in order of descent with the outermost ancestor last. This method is a generator. """ log.debug("get ancestry %s", context) if con...
def ancestry(self, context): """Return the ancestry of the context (that is, all of the packages and modules containing the context), in order of descent with the outermost ancestor last. This method is a generator. """ log.debug("get ancestry %s", context) if con...
[ "Return", "the", "ancestry", "of", "the", "context", "(", "that", "is", "all", "of", "the", "packages", "and", "modules", "containing", "the", "context", ")", "in", "order", "of", "descent", "with", "the", "outermost", "ancestor", "last", ".", "This", "met...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/suite.py#L428-L453
[ "def", "ancestry", "(", "self", ",", "context", ")", ":", "log", ".", "debug", "(", "\"get ancestry %s\"", ",", "context", ")", "if", "context", "is", "None", ":", "return", "# Methods include reference to module they are defined in, we", "# don't want that, instead wan...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ContextSuiteFactory.mixedSuites
The complex case where there are tests that don't all share the same context. Groups tests into suites with common ancestors, according to the following (essentially tail-recursive) procedure: Starting with the context of the first test, if it is not None, look for tests in the remainin...
environment/lib/python2.7/site-packages/nose/suite.py
def mixedSuites(self, tests): """The complex case where there are tests that don't all share the same context. Groups tests into suites with common ancestors, according to the following (essentially tail-recursive) procedure: Starting with the context of the first test, if it is not ...
def mixedSuites(self, tests): """The complex case where there are tests that don't all share the same context. Groups tests into suites with common ancestors, according to the following (essentially tail-recursive) procedure: Starting with the context of the first test, if it is not ...
[ "The", "complex", "case", "where", "there", "are", "tests", "that", "don", "t", "all", "share", "the", "same", "context", ".", "Groups", "tests", "into", "suites", "with", "common", "ancestors", "according", "to", "the", "following", "(", "essentially", "tai...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/suite.py#L487-L535
[ "def", "mixedSuites", "(", "self", ",", "tests", ")", ":", "if", "not", "tests", ":", "return", "[", "]", "head", "=", "tests", ".", "pop", "(", "0", ")", "if", "not", "tests", ":", "return", "[", "head", "]", "# short circuit when none are left to combi...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
CollectOnly.options
Register commandline options.
environment/lib/python2.7/site-packages/nose/plugins/collect.py
def options(self, parser, env): """Register commandline options. """ parser.add_option('--collect-only', action='store_true', dest=self.enableOpt, default=env.get('NOSE_COLLECT_ONLY'), help="E...
def options(self, parser, env): """Register commandline options. """ parser.add_option('--collect-only', action='store_true', dest=self.enableOpt, default=env.get('NOSE_COLLECT_ONLY'), help="E...
[ "Register", "commandline", "options", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/plugins/collect.py#L28-L36
[ "def", "options", "(", "self", ",", "parser", ",", "env", ")", ":", "parser", ".", "add_option", "(", "'--collect-only'", ",", "action", "=", "'store_true'", ",", "dest", "=", "self", ".", "enableOpt", ",", "default", "=", "env", ".", "get", "(", "'NOS...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
create_inputhook_qt4
Create an input hook for running the Qt4 application event loop. Parameters ---------- mgr : an InputHookManager app : Qt Application, optional. Running application to use. If not given, we probe Qt for an existing application object, and create a new one if none is found. Return...
environment/lib/python2.7/site-packages/IPython/lib/inputhookqt4.py
def create_inputhook_qt4(mgr, app=None): """Create an input hook for running the Qt4 application event loop. Parameters ---------- mgr : an InputHookManager app : Qt Application, optional. Running application to use. If not given, we probe Qt for an existing application object, an...
def create_inputhook_qt4(mgr, app=None): """Create an input hook for running the Qt4 application event loop. Parameters ---------- mgr : an InputHookManager app : Qt Application, optional. Running application to use. If not given, we probe Qt for an existing application object, an...
[ "Create", "an", "input", "hook", "for", "running", "the", "Qt4", "application", "event", "loop", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/lib/inputhookqt4.py#L27-L122
[ "def", "create_inputhook_qt4", "(", "mgr", ",", "app", "=", "None", ")", ":", "if", "app", "is", "None", ":", "app", "=", "QtCore", ".", "QCoreApplication", ".", "instance", "(", ")", "if", "app", "is", "None", ":", "app", "=", "QtGui", ".", "QApplic...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Mapper.get
Return a Mapper instance with the given name. If the name already exist return its instance. Does not work if a Mapper was created via its constructor. Using `Mapper.get()`_ is the prefered way. Args: name (str, optional): Name for the newly created instance. ...
mapper.py
def get(cls, name=__name__): """Return a Mapper instance with the given name. If the name already exist return its instance. Does not work if a Mapper was created via its constructor. Using `Mapper.get()`_ is the prefered way. Args: name (str, optional): N...
def get(cls, name=__name__): """Return a Mapper instance with the given name. If the name already exist return its instance. Does not work if a Mapper was created via its constructor. Using `Mapper.get()`_ is the prefered way. Args: name (str, optional): N...
[ "Return", "a", "Mapper", "instance", "with", "the", "given", "name", ".", "If", "the", "name", "already", "exist", "return", "its", "instance", "." ]
linuxwhatelse/mapper
python
https://github.com/linuxwhatelse/mapper/blob/3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59/mapper.py#L37-L62
[ "def", "get", "(", "cls", ",", "name", "=", "__name__", ")", ":", "if", "not", "isinstance", "(", "name", ",", "str", ")", ":", "raise", "TypeError", "(", "'A mapper name must be a string'", ")", "if", "name", "not", "in", "cls", ".", "__instances", ":",...
3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59
test
Mapper.url
Decorator for registering a path pattern. Args: pattern (str): Regex pattern to match a certain path method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever fits your situation though. Defaults to None. ...
mapper.py
def url(self, pattern, method=None, type_cast=None): """Decorator for registering a path pattern. Args: pattern (str): Regex pattern to match a certain path method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever fits yo...
def url(self, pattern, method=None, type_cast=None): """Decorator for registering a path pattern. Args: pattern (str): Regex pattern to match a certain path method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever fits yo...
[ "Decorator", "for", "registering", "a", "path", "pattern", "." ]
linuxwhatelse/mapper
python
https://github.com/linuxwhatelse/mapper/blob/3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59/mapper.py#L64-L84
[ "def", "url", "(", "self", ",", "pattern", ",", "method", "=", "None", ",", "type_cast", "=", "None", ")", ":", "if", "not", "type_cast", ":", "type_cast", "=", "{", "}", "def", "decorator", "(", "function", ")", ":", "self", ".", "add", "(", "patt...
3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59
test
Mapper.s_url
Decorator for registering a simple path. Args: path (str): Path to be matched. method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever fits your situation though. Defaults to None. type_cast (dict, op...
mapper.py
def s_url(self, path, method=None, type_cast=None): """Decorator for registering a simple path. Args: path (str): Path to be matched. method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever fits your situation though. ...
def s_url(self, path, method=None, type_cast=None): """Decorator for registering a simple path. Args: path (str): Path to be matched. method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever fits your situation though. ...
[ "Decorator", "for", "registering", "a", "simple", "path", "." ]
linuxwhatelse/mapper
python
https://github.com/linuxwhatelse/mapper/blob/3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59/mapper.py#L86-L106
[ "def", "s_url", "(", "self", ",", "path", ",", "method", "=", "None", ",", "type_cast", "=", "None", ")", ":", "if", "not", "type_cast", ":", "type_cast", "=", "{", "}", "def", "decorator", "(", "function", ")", ":", "self", ".", "s_add", "(", "pat...
3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59
test
Mapper.add
Function for registering a path pattern. Args: pattern (str): Regex pattern to match a certain path. function (function): Function to associate with this path. method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever ...
mapper.py
def add(self, pattern, function, method=None, type_cast=None): """Function for registering a path pattern. Args: pattern (str): Regex pattern to match a certain path. function (function): Function to associate with this path. method (str, optional): Usually used to d...
def add(self, pattern, function, method=None, type_cast=None): """Function for registering a path pattern. Args: pattern (str): Regex pattern to match a certain path. function (function): Function to associate with this path. method (str, optional): Usually used to d...
[ "Function", "for", "registering", "a", "path", "pattern", "." ]
linuxwhatelse/mapper
python
https://github.com/linuxwhatelse/mapper/blob/3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59/mapper.py#L108-L131
[ "def", "add", "(", "self", ",", "pattern", ",", "function", ",", "method", "=", "None", ",", "type_cast", "=", "None", ")", ":", "if", "not", "type_cast", ":", "type_cast", "=", "{", "}", "with", "self", ".", "_lock", ":", "self", ".", "_data_store",...
3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59
test
Mapper.s_add
Function for registering a simple path. Args: path (str): Path to be matched. function (function): Function to associate with this path. method (str, optional): Usually used to define one of GET, POST, PUT, DELETE. You may use whatever fits your situation tho...
mapper.py
def s_add(self, path, function, method=None, type_cast=None): """Function for registering a simple path. Args: path (str): Path to be matched. function (function): Function to associate with this path. method (str, optional): Usually used to define one of GET, POST, ...
def s_add(self, path, function, method=None, type_cast=None): """Function for registering a simple path. Args: path (str): Path to be matched. function (function): Function to associate with this path. method (str, optional): Usually used to define one of GET, POST, ...
[ "Function", "for", "registering", "a", "simple", "path", "." ]
linuxwhatelse/mapper
python
https://github.com/linuxwhatelse/mapper/blob/3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59/mapper.py#L133-L156
[ "def", "s_add", "(", "self", ",", "path", ",", "function", ",", "method", "=", "None", ",", "type_cast", "=", "None", ")", ":", "with", "self", ".", "_lock", ":", "try", ":", "path", "=", "'^/{}'", ".", "format", "(", "path", ".", "lstrip", "(", ...
3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59
test
Mapper.call
Calls the first function matching the urls pattern and method. Args: url (str): Url for which to call a matching function. method (str, optional): The method used while registering a function. Defaults to None args (dict, optional): Additional...
mapper.py
def call(self, url, method=None, args=None): """Calls the first function matching the urls pattern and method. Args: url (str): Url for which to call a matching function. method (str, optional): The method used while registering a function. Defaul...
def call(self, url, method=None, args=None): """Calls the first function matching the urls pattern and method. Args: url (str): Url for which to call a matching function. method (str, optional): The method used while registering a function. Defaul...
[ "Calls", "the", "first", "function", "matching", "the", "urls", "pattern", "and", "method", "." ]
linuxwhatelse/mapper
python
https://github.com/linuxwhatelse/mapper/blob/3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59/mapper.py#L166-L237
[ "def", "call", "(", "self", ",", "url", ",", "method", "=", "None", ",", "args", "=", "None", ")", ":", "if", "not", "args", ":", "args", "=", "{", "}", "if", "sys", ".", "version_info", ".", "major", "==", "3", ":", "data", "=", "urllib", ".",...
3481715b2a36d2da8bf5e9c6da80ceaed0d7ca59
test
HistoryConsoleWidget.execute
Reimplemented to the store history.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def execute(self, source=None, hidden=False, interactive=False): """ Reimplemented to the store history. """ if not hidden: history = self.input_buffer if source is None else source executed = super(HistoryConsoleWidget, self).execute( source, hidden, interactive...
def execute(self, source=None, hidden=False, interactive=False): """ Reimplemented to the store history. """ if not hidden: history = self.input_buffer if source is None else source executed = super(HistoryConsoleWidget, self).execute( source, hidden, interactive...
[ "Reimplemented", "to", "the", "store", "history", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L38-L60
[ "def", "execute", "(", "self", ",", "source", "=", "None", ",", "hidden", "=", "False", ",", "interactive", "=", "False", ")", ":", "if", "not", "hidden", ":", "history", "=", "self", ".", "input_buffer", "if", "source", "is", "None", "else", "source",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget._up_pressed
Called when the up key is pressed. Returns whether to continue processing the event.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def _up_pressed(self, shift_modifier): """ Called when the up key is pressed. Returns whether to continue processing the event. """ prompt_cursor = self._get_prompt_cursor() if self._get_cursor().blockNumber() == prompt_cursor.blockNumber(): # Bail out if we're lo...
def _up_pressed(self, shift_modifier): """ Called when the up key is pressed. Returns whether to continue processing the event. """ prompt_cursor = self._get_prompt_cursor() if self._get_cursor().blockNumber() == prompt_cursor.blockNumber(): # Bail out if we're lo...
[ "Called", "when", "the", "up", "key", "is", "pressed", ".", "Returns", "whether", "to", "continue", "processing", "the", "event", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L66-L101
[ "def", "_up_pressed", "(", "self", ",", "shift_modifier", ")", ":", "prompt_cursor", "=", "self", ".", "_get_prompt_cursor", "(", ")", "if", "self", ".", "_get_cursor", "(", ")", ".", "blockNumber", "(", ")", "==", "prompt_cursor", ".", "blockNumber", "(", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget._down_pressed
Called when the down key is pressed. Returns whether to continue processing the event.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def _down_pressed(self, shift_modifier): """ Called when the down key is pressed. Returns whether to continue processing the event. """ end_cursor = self._get_end_cursor() if self._get_cursor().blockNumber() == end_cursor.blockNumber(): # Bail out if we're locked....
def _down_pressed(self, shift_modifier): """ Called when the down key is pressed. Returns whether to continue processing the event. """ end_cursor = self._get_end_cursor() if self._get_cursor().blockNumber() == end_cursor.blockNumber(): # Bail out if we're locked....
[ "Called", "when", "the", "down", "key", "is", "pressed", ".", "Returns", "whether", "to", "continue", "processing", "the", "event", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L103-L129
[ "def", "_down_pressed", "(", "self", ",", "shift_modifier", ")", ":", "end_cursor", "=", "self", ".", "_get_end_cursor", "(", ")", "if", "self", ".", "_get_cursor", "(", ")", ".", "blockNumber", "(", ")", "==", "end_cursor", ".", "blockNumber", "(", ")", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget.history_previous
If possible, set the input buffer to a previous history item. Parameters: ----------- substring : str, optional If specified, search for an item with this substring. as_prefix : bool, optional If True, the substring must match at the beginning (default). ...
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def history_previous(self, substring='', as_prefix=True): """ If possible, set the input buffer to a previous history item. Parameters: ----------- substring : str, optional If specified, search for an item with this substring. as_prefix : bool, optional ...
def history_previous(self, substring='', as_prefix=True): """ If possible, set the input buffer to a previous history item. Parameters: ----------- substring : str, optional If specified, search for an item with this substring. as_prefix : bool, optional ...
[ "If", "possible", "set", "the", "input", "buffer", "to", "a", "previous", "history", "item", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L135-L164
[ "def", "history_previous", "(", "self", ",", "substring", "=", "''", ",", "as_prefix", "=", "True", ")", ":", "index", "=", "self", ".", "_history_index", "replace", "=", "False", "while", "index", ">", "0", ":", "index", "-=", "1", "history", "=", "se...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget.history_next
If possible, set the input buffer to a subsequent history item. Parameters: ----------- substring : str, optional If specified, search for an item with this substring. as_prefix : bool, optional If True, the substring must match at the beginning (default). ...
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def history_next(self, substring='', as_prefix=True): """ If possible, set the input buffer to a subsequent history item. Parameters: ----------- substring : str, optional If specified, search for an item with this substring. as_prefix : bool, optional If...
def history_next(self, substring='', as_prefix=True): """ If possible, set the input buffer to a subsequent history item. Parameters: ----------- substring : str, optional If specified, search for an item with this substring. as_prefix : bool, optional If...
[ "If", "possible", "set", "the", "input", "buffer", "to", "a", "subsequent", "history", "item", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L166-L195
[ "def", "history_next", "(", "self", ",", "substring", "=", "''", ",", "as_prefix", "=", "True", ")", ":", "index", "=", "self", ".", "_history_index", "replace", "=", "False", "while", "self", ".", "_history_index", "<", "len", "(", "self", ".", "_histor...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget._handle_execute_reply
Handles replies for code execution, here only session history length
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def _handle_execute_reply(self, msg): """ Handles replies for code execution, here only session history length """ msg_id = msg['parent_header']['msg_id'] info = self._request_info['execute'].pop(msg_id,None) if info and info.kind == 'save_magic' and not self._hidden: ...
def _handle_execute_reply(self, msg): """ Handles replies for code execution, here only session history length """ msg_id = msg['parent_header']['msg_id'] info = self._request_info['execute'].pop(msg_id,None) if info and info.kind == 'save_magic' and not self._hidden: ...
[ "Handles", "replies", "for", "code", "execution", "here", "only", "session", "history", "length" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L216-L225
[ "def", "_handle_execute_reply", "(", "self", ",", "msg", ")", ":", "msg_id", "=", "msg", "[", "'parent_header'", "]", "[", "'msg_id'", "]", "info", "=", "self", ".", "_request_info", "[", "'execute'", "]", ".", "pop", "(", "msg_id", ",", "None", ")", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget._history_locked
Returns whether history movement is locked.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def _history_locked(self): """ Returns whether history movement is locked. """ return (self.history_lock and (self._get_edited_history(self._history_index) != self.input_buffer) and (self._get_prompt_cursor().blockNumber() != self...
def _history_locked(self): """ Returns whether history movement is locked. """ return (self.history_lock and (self._get_edited_history(self._history_index) != self.input_buffer) and (self._get_prompt_cursor().blockNumber() != self...
[ "Returns", "whether", "history", "movement", "is", "locked", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L252-L259
[ "def", "_history_locked", "(", "self", ")", ":", "return", "(", "self", ".", "history_lock", "and", "(", "self", ".", "_get_edited_history", "(", "self", ".", "_history_index", ")", "!=", "self", ".", "input_buffer", ")", "and", "(", "self", ".", "_get_pro...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget._get_edited_history
Retrieves a history item, possibly with temporary edits.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def _get_edited_history(self, index): """ Retrieves a history item, possibly with temporary edits. """ if index in self._history_edits: return self._history_edits[index] elif index == len(self._history): return unicode() return self._history[index]
def _get_edited_history(self, index): """ Retrieves a history item, possibly with temporary edits. """ if index in self._history_edits: return self._history_edits[index] elif index == len(self._history): return unicode() return self._history[index]
[ "Retrieves", "a", "history", "item", "possibly", "with", "temporary", "edits", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L261-L268
[ "def", "_get_edited_history", "(", "self", ",", "index", ")", ":", "if", "index", "in", "self", ".", "_history_edits", ":", "return", "self", ".", "_history_edits", "[", "index", "]", "elif", "index", "==", "len", "(", "self", ".", "_history", ")", ":", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget._set_history
Replace the current history with a sequence of history items.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def _set_history(self, history): """ Replace the current history with a sequence of history items. """ self._history = list(history) self._history_edits = {} self._history_index = len(self._history)
def _set_history(self, history): """ Replace the current history with a sequence of history items. """ self._history = list(history) self._history_edits = {} self._history_index = len(self._history)
[ "Replace", "the", "current", "history", "with", "a", "sequence", "of", "history", "items", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L270-L275
[ "def", "_set_history", "(", "self", ",", "history", ")", ":", "self", ".", "_history", "=", "list", "(", "history", ")", "self", ".", "_history_edits", "=", "{", "}", "self", ".", "_history_index", "=", "len", "(", "self", ".", "_history", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HistoryConsoleWidget._store_edits
If there are edits to the current input buffer, store them.
environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py
def _store_edits(self): """ If there are edits to the current input buffer, store them. """ current = self.input_buffer if self._history_index == len(self._history) or \ self._history[self._history_index] != current: self._history_edits[self._history_index] = ...
def _store_edits(self): """ If there are edits to the current input buffer, store them. """ current = self.input_buffer if self._history_index == len(self._history) or \ self._history[self._history_index] != current: self._history_edits[self._history_index] = ...
[ "If", "there", "are", "edits", "to", "the", "current", "input", "buffer", "store", "them", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/console/history_console_widget.py#L277-L283
[ "def", "_store_edits", "(", "self", ")", ":", "current", "=", "self", ".", "input_buffer", "if", "self", ".", "_history_index", "==", "len", "(", "self", ".", "_history", ")", "or", "self", ".", "_history", "[", "self", ".", "_history_index", "]", "!=", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
t_NAME
r'[A-Za-z_][A-Za-z0-9_]*
sql_mojo_parser/__init__.py
def t_NAME(t): r'[A-Za-z_][A-Za-z0-9_]*' # to simplify lexing, we match identifiers and keywords as a single thing # if it's a keyword, we change the type to the name of that keyword if t.value.upper() in reserved: t.type = t.value.upper() t.value = t.value.upper() return t
def t_NAME(t): r'[A-Za-z_][A-Za-z0-9_]*' # to simplify lexing, we match identifiers and keywords as a single thing # if it's a keyword, we change the type to the name of that keyword if t.value.upper() in reserved: t.type = t.value.upper() t.value = t.value.upper() return t
[ "r", "[", "A", "-", "Za", "-", "z_", "]", "[", "A", "-", "Za", "-", "z0", "-", "9_", "]", "*" ]
L3viathan/sql-mojo-parser
python
https://github.com/L3viathan/sql-mojo-parser/blob/fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3/sql_mojo_parser/__init__.py#L19-L26
[ "def", "t_NAME", "(", "t", ")", ":", "# to simplify lexing, we match identifiers and keywords as a single thing", "# if it's a keyword, we change the type to the name of that keyword", "if", "t", ".", "value", ".", "upper", "(", ")", "in", "reserved", ":", "t", ".", "type",...
fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3
test
t_STRING
r"'([^'\\]+|\\'|\\\\)*
sql_mojo_parser/__init__.py
def t_STRING(t): r"'([^'\\]+|\\'|\\\\)*'" t.value = t.value.replace(r'\\', chr(92)).replace(r"\'", r"'")[1:-1] return t
def t_STRING(t): r"'([^'\\]+|\\'|\\\\)*'" t.value = t.value.replace(r'\\', chr(92)).replace(r"\'", r"'")[1:-1] return t
[ "r", "(", "[", "^", "\\\\", "]", "+", "|", "\\\\", "|", "\\\\\\\\", ")", "*" ]
L3viathan/sql-mojo-parser
python
https://github.com/L3viathan/sql-mojo-parser/blob/fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3/sql_mojo_parser/__init__.py#L33-L36
[ "def", "t_STRING", "(", "t", ")", ":", "t", ".", "value", "=", "t", ".", "value", ".", "replace", "(", "r'\\\\'", ",", "chr", "(", "92", ")", ")", ".", "replace", "(", "r\"\\'\"", ",", "r\"'\"", ")", "[", "1", ":", "-", "1", "]", "return", "t...
fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3
test
p_postpositions
postpositions : LIMIT NUMBER postpositions | ORDER BY colspec postpositions | empty
sql_mojo_parser/__init__.py
def p_postpositions(p): ''' postpositions : LIMIT NUMBER postpositions | ORDER BY colspec postpositions | empty ''' if len(p) > 2: if p[1] == "LIMIT": postposition = { "limit": p[2] } rest = p[3] if p[3] else...
def p_postpositions(p): ''' postpositions : LIMIT NUMBER postpositions | ORDER BY colspec postpositions | empty ''' if len(p) > 2: if p[1] == "LIMIT": postposition = { "limit": p[2] } rest = p[3] if p[3] else...
[ "postpositions", ":", "LIMIT", "NUMBER", "postpositions", "|", "ORDER", "BY", "colspec", "postpositions", "|", "empty" ]
L3viathan/sql-mojo-parser
python
https://github.com/L3viathan/sql-mojo-parser/blob/fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3/sql_mojo_parser/__init__.py#L70-L91
[ "def", "p_postpositions", "(", "p", ")", ":", "if", "len", "(", "p", ")", ">", "2", ":", "if", "p", "[", "1", "]", "==", "\"LIMIT\"", ":", "postposition", "=", "{", "\"limit\"", ":", "p", "[", "2", "]", "}", "rest", "=", "p", "[", "3", "]", ...
fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3
test
p_colspec
colspec : STAR | NAME | function | NAME COMMA colspec | function COMMA colspec
sql_mojo_parser/__init__.py
def p_colspec(p): ''' colspec : STAR | NAME | function | NAME COMMA colspec | function COMMA colspec ''' rest = p[3] if len(p) > 3 else [] if p[1] == "*": p[0] = [{"type": "star"}] elif isinstance(p[1], dict) and p[1].get("type") == "functi...
def p_colspec(p): ''' colspec : STAR | NAME | function | NAME COMMA colspec | function COMMA colspec ''' rest = p[3] if len(p) > 3 else [] if p[1] == "*": p[0] = [{"type": "star"}] elif isinstance(p[1], dict) and p[1].get("type") == "functi...
[ "colspec", ":", "STAR", "|", "NAME", "|", "function", "|", "NAME", "COMMA", "colspec", "|", "function", "COMMA", "colspec" ]
L3viathan/sql-mojo-parser
python
https://github.com/L3viathan/sql-mojo-parser/blob/fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3/sql_mojo_parser/__init__.py#L103-L125
[ "def", "p_colspec", "(", "p", ")", ":", "rest", "=", "p", "[", "3", "]", "if", "len", "(", "p", ")", ">", "3", "else", "[", "]", "if", "p", "[", "1", "]", "==", "\"*\"", ":", "p", "[", "0", "]", "=", "[", "{", "\"type\"", ":", "\"star\"",...
fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3
test
p_expression
expression : value | expression AND expression | expression OR expression | expression EQUALS expression | NOT expression | LPAREN expression RPAREN
sql_mojo_parser/__init__.py
def p_expression(p): ''' expression : value | expression AND expression | expression OR expression | expression EQUALS expression | NOT expression | LPAREN expression RPAREN ''' if len(p) < 3: p[0] = p[1] elif len(p) ...
def p_expression(p): ''' expression : value | expression AND expression | expression OR expression | expression EQUALS expression | NOT expression | LPAREN expression RPAREN ''' if len(p) < 3: p[0] = p[1] elif len(p) ...
[ "expression", ":", "value", "|", "expression", "AND", "expression", "|", "expression", "OR", "expression", "|", "expression", "EQUALS", "expression", "|", "NOT", "expression", "|", "LPAREN", "expression", "RPAREN" ]
L3viathan/sql-mojo-parser
python
https://github.com/L3viathan/sql-mojo-parser/blob/fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3/sql_mojo_parser/__init__.py#L147-L169
[ "def", "p_expression", "(", "p", ")", ":", "if", "len", "(", "p", ")", "<", "3", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "elif", "len", "(", "p", ")", "==", "3", ":", "# not", "p", "[", "0", "]", "=", "{", "\"op\"", ":", "\"no...
fc460c42f3fbcc21c6fc08c0aede8e2a5db637f3
test
MyFrame.OnTimeToClose
Event handler for the button click.
environment/share/doc/ipython/examples/lib/ipkernel_wxapp.py
def OnTimeToClose(self, evt): """Event handler for the button click.""" print("See ya later!") sys.stdout.flush() self.cleanup_consoles(evt) self.Close() # Not sure why, but our IPython kernel seems to prevent normal WX # shutdown, so an explicit exit() call is ne...
def OnTimeToClose(self, evt): """Event handler for the button click.""" print("See ya later!") sys.stdout.flush() self.cleanup_consoles(evt) self.Close() # Not sure why, but our IPython kernel seems to prevent normal WX # shutdown, so an explicit exit() call is ne...
[ "Event", "handler", "for", "the", "button", "click", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/lib/ipkernel_wxapp.py#L91-L99
[ "def", "OnTimeToClose", "(", "self", ",", "evt", ")", ":", "print", "(", "\"See ya later!\"", ")", "sys", ".", "stdout", ".", "flush", "(", ")", "self", ".", "cleanup_consoles", "(", "evt", ")", "self", ".", "Close", "(", ")", "# Not sure why, but our IPyt...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
upgrade_dir
Copy over all files in srcdir to tgtdir w/ native line endings Creates .upgrade_report in tgtdir that stores md5sums of all files to notice changed files b/w upgrades.
environment/lib/python2.7/site-packages/IPython/utils/upgradedir.py
def upgrade_dir(srcdir, tgtdir): """ Copy over all files in srcdir to tgtdir w/ native line endings Creates .upgrade_report in tgtdir that stores md5sums of all files to notice changed files b/w upgrades. """ def pr(s): print s junk = ['.svn','ipythonrc*','*.pyc', '*.pyo', '*~', '.hg']...
def upgrade_dir(srcdir, tgtdir): """ Copy over all files in srcdir to tgtdir w/ native line endings Creates .upgrade_report in tgtdir that stores md5sums of all files to notice changed files b/w upgrades. """ def pr(s): print s junk = ['.svn','ipythonrc*','*.pyc', '*.pyo', '*~', '.hg']...
[ "Copy", "over", "all", "files", "in", "srcdir", "to", "tgtdir", "w", "/", "native", "line", "endings" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/upgradedir.py#L27-L87
[ "def", "upgrade_dir", "(", "srcdir", ",", "tgtdir", ")", ":", "def", "pr", "(", "s", ")", ":", "print", "s", "junk", "=", "[", "'.svn'", ",", "'ipythonrc*'", ",", "'*.pyc'", ",", "'*.pyo'", ",", "'*~'", ",", "'.hg'", "]", "def", "ignorable", "(", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
RequirementSet.prepare_files
Prepare process. Create temp directories, download and/or unpack files.
virtualEnvironment/lib/python2.7/site-packages/pip/req/req_set.py
def prepare_files(self, finder): """ Prepare process. Create temp directories, download and/or unpack files. """ from pip.index import Link unnamed = list(self.unnamed_requirements) reqs = list(self.requirements.values()) while reqs or unnamed: if unn...
def prepare_files(self, finder): """ Prepare process. Create temp directories, download and/or unpack files. """ from pip.index import Link unnamed = list(self.unnamed_requirements) reqs = list(self.requirements.values()) while reqs or unnamed: if unn...
[ "Prepare", "process", ".", "Create", "temp", "directories", "download", "and", "/", "or", "unpack", "files", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/req/req_set.py#L207-L459
[ "def", "prepare_files", "(", "self", ",", "finder", ")", ":", "from", "pip", ".", "index", "import", "Link", "unnamed", "=", "list", "(", "self", ".", "unnamed_requirements", ")", "reqs", "=", "list", "(", "self", ".", "requirements", ".", "values", "(",...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
RequirementSet.cleanup_files
Clean up files, remove builds.
virtualEnvironment/lib/python2.7/site-packages/pip/req/req_set.py
def cleanup_files(self): """Clean up files, remove builds.""" logger.debug('Cleaning up...') with indent_log(): for req in self.reqs_to_cleanup: req.remove_temporary_source() if self._pip_has_created_build_dir(): logger.debug('Removing tem...
def cleanup_files(self): """Clean up files, remove builds.""" logger.debug('Cleaning up...') with indent_log(): for req in self.reqs_to_cleanup: req.remove_temporary_source() if self._pip_has_created_build_dir(): logger.debug('Removing tem...
[ "Clean", "up", "files", "remove", "builds", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/req/req_set.py#L461-L470
[ "def", "cleanup_files", "(", "self", ")", ":", "logger", ".", "debug", "(", "'Cleaning up...'", ")", "with", "indent_log", "(", ")", ":", "for", "req", "in", "self", ".", "reqs_to_cleanup", ":", "req", ".", "remove_temporary_source", "(", ")", "if", "self"...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
RequirementSet.install
Install everything in this set (after having downloaded and unpacked the packages)
virtualEnvironment/lib/python2.7/site-packages/pip/req/req_set.py
def install(self, install_options, global_options=(), *args, **kwargs): """ Install everything in this set (after having downloaded and unpacked the packages) """ to_install = [r for r in self.requirements.values()[::-1] if not r.satisfied_by] # DIS...
def install(self, install_options, global_options=(), *args, **kwargs): """ Install everything in this set (after having downloaded and unpacked the packages) """ to_install = [r for r in self.requirements.values()[::-1] if not r.satisfied_by] # DIS...
[ "Install", "everything", "in", "this", "set", "(", "after", "having", "downloaded", "and", "unpacked", "the", "packages", ")" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/req/req_set.py#L480-L563
[ "def", "install", "(", "self", ",", "install_options", ",", "global_options", "=", "(", ")", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "to_install", "=", "[", "r", "for", "r", "in", "self", ".", "requirements", ".", "values", "(", ")", "...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
load_record
Generates an instance of Record() from a tuple of the form (index, pandas.Series) with associated parameters kwargs Paremeters ---------- index_series_tuple : tuple tuple consisting of (index, pandas.Series) kwargs : dict aditional arguments Returns ------- Record : ob...
turntable/press.py
def load_record(index_series_tuple, kwargs): ''' Generates an instance of Record() from a tuple of the form (index, pandas.Series) with associated parameters kwargs Paremeters ---------- index_series_tuple : tuple tuple consisting of (index, pandas.Series) kwargs : dict adi...
def load_record(index_series_tuple, kwargs): ''' Generates an instance of Record() from a tuple of the form (index, pandas.Series) with associated parameters kwargs Paremeters ---------- index_series_tuple : tuple tuple consisting of (index, pandas.Series) kwargs : dict adi...
[ "Generates", "an", "instance", "of", "Record", "()", "from", "a", "tuple", "of", "the", "form", "(", "index", "pandas", ".", "Series", ")", "with", "associated", "parameters", "kwargs" ]
jshiv/turntable
python
https://github.com/jshiv/turntable/blob/c095a93df14d672ba54db164a7ab7373444d1829/turntable/press.py#L240-L264
[ "def", "load_record", "(", "index_series_tuple", ",", "kwargs", ")", ":", "index_record", "=", "index_series_tuple", "[", "0", "]", "series", "=", "index_series_tuple", "[", "1", "]", "record", "=", "Record", "(", ")", "record", ".", "series", "=", "series",...
c095a93df14d672ba54db164a7ab7373444d1829
test
build_collection
Generates a list of Record objects given a DataFrame. Each Record instance has a series attribute which is a pandas.Series of the same attributes in the DataFrame. Optional data can be passed in through kwargs which will be included by the name of each object. parameters ---------- df : pandas...
turntable/press.py
def build_collection(df, **kwargs): ''' Generates a list of Record objects given a DataFrame. Each Record instance has a series attribute which is a pandas.Series of the same attributes in the DataFrame. Optional data can be passed in through kwargs which will be included by the name of each object...
def build_collection(df, **kwargs): ''' Generates a list of Record objects given a DataFrame. Each Record instance has a series attribute which is a pandas.Series of the same attributes in the DataFrame. Optional data can be passed in through kwargs which will be included by the name of each object...
[ "Generates", "a", "list", "of", "Record", "objects", "given", "a", "DataFrame", ".", "Each", "Record", "instance", "has", "a", "series", "attribute", "which", "is", "a", "pandas", ".", "Series", "of", "the", "same", "attributes", "in", "the", "DataFrame", ...
jshiv/turntable
python
https://github.com/jshiv/turntable/blob/c095a93df14d672ba54db164a7ab7373444d1829/turntable/press.py#L266-L311
[ "def", "build_collection", "(", "df", ",", "*", "*", "kwargs", ")", ":", "print", "'Generating the Record Collection...\\n'", "df", "[", "'index_original'", "]", "=", "df", ".", "index", "df", ".", "reset_index", "(", "drop", "=", "True", ",", "inplace", "="...
c095a93df14d672ba54db164a7ab7373444d1829
test
collection_to_df
Converts a collection back into a pandas DataFrame parameters ---------- collection : list list of Record objects where each Record represents one row from a dataframe Returns ------- df : pandas.DataFrame DataFrame of length=len(collection) where each row represents one Record
turntable/press.py
def collection_to_df(collection): ''' Converts a collection back into a pandas DataFrame parameters ---------- collection : list list of Record objects where each Record represents one row from a dataframe Returns ------- df : pandas.DataFrame DataFrame of length=len(c...
def collection_to_df(collection): ''' Converts a collection back into a pandas DataFrame parameters ---------- collection : list list of Record objects where each Record represents one row from a dataframe Returns ------- df : pandas.DataFrame DataFrame of length=len(c...
[ "Converts", "a", "collection", "back", "into", "a", "pandas", "DataFrame" ]
jshiv/turntable
python
https://github.com/jshiv/turntable/blob/c095a93df14d672ba54db164a7ab7373444d1829/turntable/press.py#L313-L329
[ "def", "collection_to_df", "(", "collection", ")", ":", "return", "pd", ".", "concat", "(", "[", "record", ".", "series", "for", "record", "in", "collection", "]", ",", "axis", "=", "1", ")", ".", "T" ]
c095a93df14d672ba54db164a7ab7373444d1829
test
spin_frame
Runs the full turntable process on a pandas DataFrame parameters ---------- df : pandas.DataFrame each row represents a record method : def method(record) function used to process each row Returns ------- df : pandas.DataFrame DataFrame processed by method Exam...
turntable/press.py
def spin_frame(df, method): ''' Runs the full turntable process on a pandas DataFrame parameters ---------- df : pandas.DataFrame each row represents a record method : def method(record) function used to process each row Returns ------- df : pandas.DataFrame ...
def spin_frame(df, method): ''' Runs the full turntable process on a pandas DataFrame parameters ---------- df : pandas.DataFrame each row represents a record method : def method(record) function used to process each row Returns ------- df : pandas.DataFrame ...
[ "Runs", "the", "full", "turntable", "process", "on", "a", "pandas", "DataFrame" ]
jshiv/turntable
python
https://github.com/jshiv/turntable/blob/c095a93df14d672ba54db164a7ab7373444d1829/turntable/press.py#L332-L365
[ "def", "spin_frame", "(", "df", ",", "method", ")", ":", "collection", "=", "build_collection", "(", "df", ")", "collection", "=", "turntable", ".", "spin", ".", "batch", "(", "collection", ",", "method", ")", "return", "collection_to_df", "(", "collection",...
c095a93df14d672ba54db164a7ab7373444d1829
test
RecordSetter.set_attributes
Initalizes the given argument structure as properties of the class to be used by name in specific method execution. Parameters ---------- kwargs : dictionary Dictionary of extra attributes, where keys are attributes names and values attributes values.
turntable/press.py
def set_attributes(self, kwargs): ''' Initalizes the given argument structure as properties of the class to be used by name in specific method execution. Parameters ---------- kwargs : dictionary Dictionary of extra attributes, where keys are attr...
def set_attributes(self, kwargs): ''' Initalizes the given argument structure as properties of the class to be used by name in specific method execution. Parameters ---------- kwargs : dictionary Dictionary of extra attributes, where keys are attr...
[ "Initalizes", "the", "given", "argument", "structure", "as", "properties", "of", "the", "class", "to", "be", "used", "by", "name", "in", "specific", "method", "execution", "." ]
jshiv/turntable
python
https://github.com/jshiv/turntable/blob/c095a93df14d672ba54db164a7ab7373444d1829/turntable/press.py#L149-L163
[ "def", "set_attributes", "(", "self", ",", "kwargs", ")", ":", "for", "key", ",", "value", "in", "kwargs", ".", "items", "(", ")", ":", "setattr", "(", "self", ",", "key", ",", "value", ")" ]
c095a93df14d672ba54db164a7ab7373444d1829
test
LogWatcher.subscribe
Update our SUB socket's subscriptions.
environment/lib/python2.7/site-packages/IPython/parallel/apps/logwatcher.py
def subscribe(self): """Update our SUB socket's subscriptions.""" self.stream.setsockopt(zmq.UNSUBSCRIBE, '') if '' in self.topics: self.log.debug("Subscribing to: everything") self.stream.setsockopt(zmq.SUBSCRIBE, '') else: for topic in self.topics: ...
def subscribe(self): """Update our SUB socket's subscriptions.""" self.stream.setsockopt(zmq.UNSUBSCRIBE, '') if '' in self.topics: self.log.debug("Subscribing to: everything") self.stream.setsockopt(zmq.SUBSCRIBE, '') else: for topic in self.topics: ...
[ "Update", "our", "SUB", "socket", "s", "subscriptions", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/apps/logwatcher.py#L74-L83
[ "def", "subscribe", "(", "self", ")", ":", "self", ".", "stream", ".", "setsockopt", "(", "zmq", ".", "UNSUBSCRIBE", ",", "''", ")", "if", "''", "in", "self", ".", "topics", ":", "self", ".", "log", ".", "debug", "(", "\"Subscribing to: everything\"", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
LogWatcher._extract_level
Turn 'engine.0.INFO.extra' into (logging.INFO, 'engine.0.extra')
environment/lib/python2.7/site-packages/IPython/parallel/apps/logwatcher.py
def _extract_level(self, topic_str): """Turn 'engine.0.INFO.extra' into (logging.INFO, 'engine.0.extra')""" topics = topic_str.split('.') for idx,t in enumerate(topics): level = getattr(logging, t, None) if level is not None: break if leve...
def _extract_level(self, topic_str): """Turn 'engine.0.INFO.extra' into (logging.INFO, 'engine.0.extra')""" topics = topic_str.split('.') for idx,t in enumerate(topics): level = getattr(logging, t, None) if level is not None: break if leve...
[ "Turn", "engine", ".", "0", ".", "INFO", ".", "extra", "into", "(", "logging", ".", "INFO", "engine", ".", "0", ".", "extra", ")" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/apps/logwatcher.py#L85-L98
[ "def", "_extract_level", "(", "self", ",", "topic_str", ")", ":", "topics", "=", "topic_str", ".", "split", "(", "'.'", ")", "for", "idx", ",", "t", "in", "enumerate", "(", "topics", ")", ":", "level", "=", "getattr", "(", "logging", ",", "t", ",", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
LogWatcher.log_message
receive and parse a message, then log it.
environment/lib/python2.7/site-packages/IPython/parallel/apps/logwatcher.py
def log_message(self, raw): """receive and parse a message, then log it.""" if len(raw) != 2 or '.' not in raw[0]: self.log.error("Invalid log message: %s"%raw) return else: topic, msg = raw # don't newline, since log messages always newline: ...
def log_message(self, raw): """receive and parse a message, then log it.""" if len(raw) != 2 or '.' not in raw[0]: self.log.error("Invalid log message: %s"%raw) return else: topic, msg = raw # don't newline, since log messages always newline: ...
[ "receive", "and", "parse", "a", "message", "then", "log", "it", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/apps/logwatcher.py#L101-L113
[ "def", "log_message", "(", "self", ",", "raw", ")", ":", "if", "len", "(", "raw", ")", "!=", "2", "or", "'.'", "not", "in", "raw", "[", "0", "]", ":", "self", ".", "log", ".", "error", "(", "\"Invalid log message: %s\"", "%", "raw", ")", "return", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
mergesort
Perform an N-way merge operation on sorted lists. @param list_of_lists: (really iterable of iterable) of sorted elements (either by naturally or by C{key}) @param key: specify sort key function (like C{sort()}, C{sorted()}) Yields tuples of the form C{(item, iterator)}, where the iterator is the b...
environment/share/doc/ipython/examples/parallel/nwmerge.py
def mergesort(list_of_lists, key=None): """ Perform an N-way merge operation on sorted lists. @param list_of_lists: (really iterable of iterable) of sorted elements (either by naturally or by C{key}) @param key: specify sort key function (like C{sort()}, C{sorted()}) Yields tuples of the form C{(i...
def mergesort(list_of_lists, key=None): """ Perform an N-way merge operation on sorted lists. @param list_of_lists: (really iterable of iterable) of sorted elements (either by naturally or by C{key}) @param key: specify sort key function (like C{sort()}, C{sorted()}) Yields tuples of the form C{(i...
[ "Perform", "an", "N", "-", "way", "merge", "operation", "on", "sorted", "lists", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/nwmerge.py#L10-L75
[ "def", "mergesort", "(", "list_of_lists", ",", "key", "=", "None", ")", ":", "heap", "=", "[", "]", "for", "i", ",", "itr", "in", "enumerate", "(", "iter", "(", "pl", ")", "for", "pl", "in", "list_of_lists", ")", ":", "try", ":", "item", "=", "it...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
remote_iterator
Return an iterator on an object living on a remote engine.
environment/share/doc/ipython/examples/parallel/nwmerge.py
def remote_iterator(view,name): """Return an iterator on an object living on a remote engine. """ view.execute('it%s=iter(%s)'%(name,name), block=True) while True: try: result = view.apply_sync(lambda x: x.next(), Reference('it'+name)) # This causes the StopIteration exceptio...
def remote_iterator(view,name): """Return an iterator on an object living on a remote engine. """ view.execute('it%s=iter(%s)'%(name,name), block=True) while True: try: result = view.apply_sync(lambda x: x.next(), Reference('it'+name)) # This causes the StopIteration exceptio...
[ "Return", "an", "iterator", "on", "an", "object", "living", "on", "a", "remote", "engine", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/nwmerge.py#L78-L92
[ "def", "remote_iterator", "(", "view", ",", "name", ")", ":", "view", ".", "execute", "(", "'it%s=iter(%s)'", "%", "(", "name", ",", "name", ")", ",", "block", "=", "True", ")", "while", "True", ":", "try", ":", "result", "=", "view", ".", "apply_syn...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
convert_to_this_nbformat
Convert a notebook to the v2 format. Parameters ---------- nb : NotebookNode The Python representation of the notebook to convert. orig_version : int The original version of the notebook to convert.
environment/lib/python2.7/site-packages/IPython/nbformat/v2/convert.py
def convert_to_this_nbformat(nb, orig_version=1): """Convert a notebook to the v2 format. Parameters ---------- nb : NotebookNode The Python representation of the notebook to convert. orig_version : int The original version of the notebook to convert. """ if orig_version == ...
def convert_to_this_nbformat(nb, orig_version=1): """Convert a notebook to the v2 format. Parameters ---------- nb : NotebookNode The Python representation of the notebook to convert. orig_version : int The original version of the notebook to convert. """ if orig_version == ...
[ "Convert", "a", "notebook", "to", "the", "v2", "format", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v2/convert.py#L27-L49
[ "def", "convert_to_this_nbformat", "(", "nb", ",", "orig_version", "=", "1", ")", ":", "if", "orig_version", "==", "1", ":", "newnb", "=", "new_notebook", "(", ")", "ws", "=", "new_worksheet", "(", ")", "for", "cell", "in", "nb", ".", "cells", ":", "if...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
get_supported_platform
Return this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version of Mac OS X that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the version of Mac OS X that we are *running*. To...
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def get_supported_platform(): """Return this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version of Mac OS X that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the version o...
def get_supported_platform(): """Return this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version of Mac OS X that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the version o...
[ "Return", "this", "platform", "s", "maximum", "compatible", "version", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L93-L112
[ "def", "get_supported_platform", "(", ")", ":", "plat", "=", "get_build_platform", "(", ")", "m", "=", "macosVersionString", ".", "match", "(", "plat", ")", "if", "m", "is", "not", "None", "and", "sys", ".", "platform", "==", "\"darwin\"", ":", "try", ":...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
get_importer
Retrieve a PEP 302 "importer" for the given path item If there is no importer, this returns a wrapper around the builtin import machinery. The returned importer is only cached if it was created by a path hook.
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def get_importer(path_item): """Retrieve a PEP 302 "importer" for the given path item If there is no importer, this returns a wrapper around the builtin import machinery. The returned importer is only cached if it was created by a path hook. """ try: importer = sys.path_importer_cache[...
def get_importer(path_item): """Retrieve a PEP 302 "importer" for the given path item If there is no importer, this returns a wrapper around the builtin import machinery. The returned importer is only cached if it was created by a path hook. """ try: importer = sys.path_importer_cache[...
[ "Retrieve", "a", "PEP", "302", "importer", "for", "the", "given", "path", "item" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L1663-L1689
[ "def", "get_importer", "(", "path_item", ")", ":", "try", ":", "importer", "=", "sys", ".", "path_importer_cache", "[", "path_item", "]", "except", "KeyError", ":", "for", "hook", "in", "sys", ".", "path_hooks", ":", "try", ":", "importer", "=", "hook", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
StringIO
Thunk to load the real StringIO on demand
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def StringIO(*args, **kw): """Thunk to load the real StringIO on demand""" global StringIO try: from cStringIO import StringIO except ImportError: from StringIO import StringIO return StringIO(*args,**kw)
def StringIO(*args, **kw): """Thunk to load the real StringIO on demand""" global StringIO try: from cStringIO import StringIO except ImportError: from StringIO import StringIO return StringIO(*args,**kw)
[ "Thunk", "to", "load", "the", "real", "StringIO", "on", "demand" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L1736-L1743
[ "def", "StringIO", "(", "*", "args", ",", "*", "*", "kw", ")", ":", "global", "StringIO", "try", ":", "from", "cStringIO", "import", "StringIO", "except", "ImportError", ":", "from", "StringIO", "import", "StringIO", "return", "StringIO", "(", "*", "args",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
parse_version
Convert a version string to a chronologically-sortable key This is a rough cross between distutils' StrictVersion and LooseVersion; if you give it versions that would work with StrictVersion, then it behaves the same; otherwise it acts like a slightly-smarter LooseVersion. It is *possible* to create pa...
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def parse_version(s): """Convert a version string to a chronologically-sortable key This is a rough cross between distutils' StrictVersion and LooseVersion; if you give it versions that would work with StrictVersion, then it behaves the same; otherwise it acts like a slightly-smarter LooseVersion. It i...
def parse_version(s): """Convert a version string to a chronologically-sortable key This is a rough cross between distutils' StrictVersion and LooseVersion; if you give it versions that would work with StrictVersion, then it behaves the same; otherwise it acts like a slightly-smarter LooseVersion. It i...
[ "Convert", "a", "version", "string", "to", "a", "chronologically", "-", "sortable", "key" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L1974-L2012
[ "def", "parse_version", "(", "s", ")", ":", "parts", "=", "[", "]", "for", "part", "in", "_parse_version_parts", "(", "s", ".", "lower", "(", ")", ")", ":", "if", "part", ".", "startswith", "(", "'*'", ")", ":", "# remove trailing zeros from each series of...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
_override_setuptools
Return True when distribute wants to override a setuptools dependency. We want to override when the requirement is setuptools and the version is a variant of 0.6.
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def _override_setuptools(req): """Return True when distribute wants to override a setuptools dependency. We want to override when the requirement is setuptools and the version is a variant of 0.6. """ if req.project_name == 'setuptools': if not len(req.specs): # Just setuptools...
def _override_setuptools(req): """Return True when distribute wants to override a setuptools dependency. We want to override when the requirement is setuptools and the version is a variant of 0.6. """ if req.project_name == 'setuptools': if not len(req.specs): # Just setuptools...
[ "Return", "True", "when", "distribute", "wants", "to", "override", "a", "setuptools", "dependency", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L2735-L2752
[ "def", "_override_setuptools", "(", "req", ")", ":", "if", "req", ".", "project_name", "==", "'setuptools'", ":", "if", "not", "len", "(", "req", ".", "specs", ")", ":", "# Just setuptools: ok", "return", "True", "for", "comparator", ",", "version", "in", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
WorkingSet.add
Add `dist` to working set, associated with `entry` If `entry` is unspecified, it defaults to the ``.location`` of `dist`. On exit from this routine, `entry` is added to the end of the working set's ``.entries`` (if it wasn't already present). `dist` is only added to the working set if ...
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def add(self, dist, entry=None, insert=True, replace=False): """Add `dist` to working set, associated with `entry` If `entry` is unspecified, it defaults to the ``.location`` of `dist`. On exit from this routine, `entry` is added to the end of the working set's ``.entries`` (if it wasn'...
def add(self, dist, entry=None, insert=True, replace=False): """Add `dist` to working set, associated with `entry` If `entry` is unspecified, it defaults to the ``.location`` of `dist`. On exit from this routine, `entry` is added to the end of the working set's ``.entries`` (if it wasn'...
[ "Add", "dist", "to", "working", "set", "associated", "with", "entry" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L520-L547
[ "def", "add", "(", "self", ",", "dist", ",", "entry", "=", "None", ",", "insert", "=", "True", ",", "replace", "=", "False", ")", ":", "if", "insert", ":", "dist", ".", "insert_on", "(", "self", ".", "entries", ",", "entry", ")", "if", "entry", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
WorkingSet.resolve
List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environment`` instance. If not supplied, it defaults to all distributions available within any entry or distribution in t...
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def resolve(self, requirements, env=None, installer=None, replacement=True, replace_conflicting=False): """List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environ...
def resolve(self, requirements, env=None, installer=None, replacement=True, replace_conflicting=False): """List all distributions needed to (recursively) meet `requirements` `requirements` must be a sequence of ``Requirement`` objects. `env`, if supplied, should be an ``Environ...
[ "List", "all", "distributions", "needed", "to", "(", "recursively", ")", "meet", "requirements" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L549-L612
[ "def", "resolve", "(", "self", ",", "requirements", ",", "env", "=", "None", ",", "installer", "=", "None", ",", "replacement", "=", "True", ",", "replace_conflicting", "=", "False", ")", ":", "requirements", "=", "list", "(", "requirements", ")", "[", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
WorkingSet.find_plugins
Find all activatable distributions in `plugin_env` Example usage:: distributions, errors = working_set.find_plugins( Environment(plugin_dirlist) ) map(working_set.add, distributions) # add plugins+libs to sys.path print 'Could not load', errors ...
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def find_plugins(self, plugin_env, full_env=None, installer=None, fallback=True ): """Find all activatable distributions in `plugin_env` Example usage:: distributions, errors = working_set.find_plugins( Environment(plugin_dirlist) ) map(w...
def find_plugins(self, plugin_env, full_env=None, installer=None, fallback=True ): """Find all activatable distributions in `plugin_env` Example usage:: distributions, errors = working_set.find_plugins( Environment(plugin_dirlist) ) map(w...
[ "Find", "all", "activatable", "distributions", "in", "plugin_env" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L614-L690
[ "def", "find_plugins", "(", "self", ",", "plugin_env", ",", "full_env", "=", "None", ",", "installer", "=", "None", ",", "fallback", "=", "True", ")", ":", "plugin_projects", "=", "list", "(", "plugin_env", ")", "plugin_projects", ".", "sort", "(", ")", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Environment.add
Add `dist` if we ``can_add()`` it and it isn't already added
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def add(self,dist): """Add `dist` if we ``can_add()`` it and it isn't already added""" if self.can_add(dist) and dist.has_version(): dists = self._distmap.setdefault(dist.key,[]) if dist not in dists: dists.append(dist) if dist.key in self._cache: ...
def add(self,dist): """Add `dist` if we ``can_add()`` it and it isn't already added""" if self.can_add(dist) and dist.has_version(): dists = self._distmap.setdefault(dist.key,[]) if dist not in dists: dists.append(dist) if dist.key in self._cache: ...
[ "Add", "dist", "if", "we", "can_add", "()", "it", "and", "it", "isn", "t", "already", "added" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L812-L819
[ "def", "add", "(", "self", ",", "dist", ")", ":", "if", "self", ".", "can_add", "(", "dist", ")", "and", "dist", ".", "has_version", "(", ")", ":", "dists", "=", "self", ".", "_distmap", ".", "setdefault", "(", "dist", ".", "key", ",", "[", "]", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
ResourceManager.get_cache_path
Return absolute location in cache for `archive_name` and `names` The parent directory of the resulting path will be created if it does not already exist. `archive_name` should be the base filename of the enclosing egg (which may not be the name of the enclosing zipfile!), including its...
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def get_cache_path(self, archive_name, names=()): """Return absolute location in cache for `archive_name` and `names` The parent directory of the resulting path will be created if it does not already exist. `archive_name` should be the base filename of the enclosing egg (which may not ...
def get_cache_path(self, archive_name, names=()): """Return absolute location in cache for `archive_name` and `names` The parent directory of the resulting path will be created if it does not already exist. `archive_name` should be the base filename of the enclosing egg (which may not ...
[ "Return", "absolute", "location", "in", "cache", "for", "archive_name", "and", "names" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L986-L1007
[ "def", "get_cache_path", "(", "self", ",", "archive_name", ",", "names", "=", "(", ")", ")", ":", "extract_path", "=", "self", ".", "extraction_path", "or", "get_default_cache", "(", ")", "target_path", "=", "os", ".", "path", ".", "join", "(", "extract_pa...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
EntryPoint.parse
Parse a single entry point from string `src` Entry point syntax follows the form:: name = some.module:some.attr [extra1,extra2] The entry name and module name are required, but the ``:attrs`` and ``[extras]`` parts are optional
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def parse(cls, src, dist=None): """Parse a single entry point from string `src` Entry point syntax follows the form:: name = some.module:some.attr [extra1,extra2] The entry name and module name are required, but the ``:attrs`` and ``[extras]`` parts are optional ""...
def parse(cls, src, dist=None): """Parse a single entry point from string `src` Entry point syntax follows the form:: name = some.module:some.attr [extra1,extra2] The entry name and module name are required, but the ``:attrs`` and ``[extras]`` parts are optional ""...
[ "Parse", "a", "single", "entry", "point", "from", "string", "src" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L2056-L2085
[ "def", "parse", "(", "cls", ",", "src", ",", "dist", "=", "None", ")", ":", "try", ":", "attrs", "=", "extras", "=", "(", ")", "name", ",", "value", "=", "src", ".", "split", "(", "'='", ",", "1", ")", "if", "'['", "in", "value", ":", "value"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Distribution.activate
Ensure distribution is importable on `path` (default=sys.path)
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def activate(self,path=None): """Ensure distribution is importable on `path` (default=sys.path)""" if path is None: path = sys.path self.insert_on(path) if path is sys.path: fixup_namespace_packages(self.location) map(declare_namespace, self._get_metadata('namespa...
def activate(self,path=None): """Ensure distribution is importable on `path` (default=sys.path)""" if path is None: path = sys.path self.insert_on(path) if path is sys.path: fixup_namespace_packages(self.location) map(declare_namespace, self._get_metadata('namespa...
[ "Ensure", "distribution", "is", "importable", "on", "path", "(", "default", "=", "sys", ".", "path", ")" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L2278-L2284
[ "def", "activate", "(", "self", ",", "path", "=", "None", ")", ":", "if", "path", "is", "None", ":", "path", "=", "sys", ".", "path", "self", ".", "insert_on", "(", "path", ")", "if", "path", "is", "sys", ".", "path", ":", "fixup_namespace_packages",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Distribution.insert_on
Insert self.location in path before its nearest parent directory
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def insert_on(self, path, loc = None): """Insert self.location in path before its nearest parent directory""" loc = loc or self.location if self.project_name == 'setuptools': try: version = self.version except ValueError: version = '' ...
def insert_on(self, path, loc = None): """Insert self.location in path before its nearest parent directory""" loc = loc or self.location if self.project_name == 'setuptools': try: version = self.version except ValueError: version = '' ...
[ "Insert", "self", ".", "location", "in", "path", "before", "its", "nearest", "parent", "directory" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L2369-L2417
[ "def", "insert_on", "(", "self", ",", "path", ",", "loc", "=", "None", ")", ":", "loc", "=", "loc", "or", "self", ".", "location", "if", "self", ".", "project_name", "==", "'setuptools'", ":", "try", ":", "version", "=", "self", ".", "version", "exce...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
DistInfoDistribution._parsed_pkg_info
Parse and cache metadata
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def _parsed_pkg_info(self): """Parse and cache metadata""" try: return self._pkg_info except AttributeError: from email.parser import Parser self._pkg_info = Parser().parsestr(self.get_metadata(self.PKG_INFO)) return self._pkg_info
def _parsed_pkg_info(self): """Parse and cache metadata""" try: return self._pkg_info except AttributeError: from email.parser import Parser self._pkg_info = Parser().parsestr(self.get_metadata(self.PKG_INFO)) return self._pkg_info
[ "Parse", "and", "cache", "metadata" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L2476-L2483
[ "def", "_parsed_pkg_info", "(", "self", ")", ":", "try", ":", "return", "self", ".", "_pkg_info", "except", "AttributeError", ":", "from", "email", ".", "parser", "import", "Parser", "self", ".", "_pkg_info", "=", "Parser", "(", ")", ".", "parsestr", "(", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
DistInfoDistribution._compute_dependencies
Recompute this distribution's dependencies.
environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py
def _compute_dependencies(self): """Recompute this distribution's dependencies.""" from _markerlib import compile as compile_marker dm = self.__dep_map = {None: []} reqs = [] # Including any condition expressions for req in self._parsed_pkg_info.get_all('Requires-Dist') ...
def _compute_dependencies(self): """Recompute this distribution's dependencies.""" from _markerlib import compile as compile_marker dm = self.__dep_map = {None: []} reqs = [] # Including any condition expressions for req in self._parsed_pkg_info.get_all('Requires-Dist') ...
[ "Recompute", "this", "distribution", "s", "dependencies", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/distribute-0.6.31-py2.7.egg/pkg_resources.py#L2505-L2530
[ "def", "_compute_dependencies", "(", "self", ")", ":", "from", "_markerlib", "import", "compile", "as", "compile_marker", "dm", "=", "self", ".", "__dep_map", "=", "{", "None", ":", "[", "]", "}", "reqs", "=", "[", "]", "# Including any condition expressions",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
parse_filename
Parse a notebook filename. This function takes a notebook filename and returns the notebook format (json/py) and the notebook name. This logic can be summarized as follows: * notebook.ipynb -> (notebook.ipynb, notebook, json) * notebook.json -> (notebook.json, notebook, json) * notebook.py ...
environment/lib/python2.7/site-packages/IPython/nbformat/v2/__init__.py
def parse_filename(fname): """Parse a notebook filename. This function takes a notebook filename and returns the notebook format (json/py) and the notebook name. This logic can be summarized as follows: * notebook.ipynb -> (notebook.ipynb, notebook, json) * notebook.json -> (notebook.json, no...
def parse_filename(fname): """Parse a notebook filename. This function takes a notebook filename and returns the notebook format (json/py) and the notebook name. This logic can be summarized as follows: * notebook.ipynb -> (notebook.ipynb, notebook, json) * notebook.json -> (notebook.json, no...
[ "Parse", "a", "notebook", "filename", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/nbformat/v2/__init__.py#L43-L77
[ "def", "parse_filename", "(", "fname", ")", ":", "if", "fname", ".", "endswith", "(", "u'.ipynb'", ")", ":", "format", "=", "u'json'", "elif", "fname", ".", "endswith", "(", "u'.json'", ")", ":", "format", "=", "u'json'", "elif", "fname", ".", "endswith"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
_collapse_leading_ws
``Description`` header must preserve newlines; all others need not
virtualEnvironment/lib/python2.7/site-packages/pkginfo/distribution.py
def _collapse_leading_ws(header, txt): """ ``Description`` header must preserve newlines; all others need not """ if header.lower() == 'description': # preserve newlines return '\n'.join([x[8:] if x.startswith(' ' * 8) else x for x in txt.strip().splitlines()]) els...
def _collapse_leading_ws(header, txt): """ ``Description`` header must preserve newlines; all others need not """ if header.lower() == 'description': # preserve newlines return '\n'.join([x[8:] if x.startswith(' ' * 8) else x for x in txt.strip().splitlines()]) els...
[ "Description", "header", "must", "preserve", "newlines", ";", "all", "others", "need", "not" ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pkginfo/distribution.py#L14-L22
[ "def", "_collapse_leading_ws", "(", "header", ",", "txt", ")", ":", "if", "header", ".", "lower", "(", ")", "==", "'description'", ":", "# preserve newlines", "return", "'\\n'", ".", "join", "(", "[", "x", "[", "8", ":", "]", "if", "x", ".", "startswit...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
Git.get_refs
Return map of named refs (branches or tags) to commit hashes.
virtualEnvironment/lib/python2.7/site-packages/pip/vcs/git.py
def get_refs(self, location): """Return map of named refs (branches or tags) to commit hashes.""" output = call_subprocess([self.cmd, 'show-ref'], show_stdout=False, cwd=location) rv = {} for line in output.strip().splitlines(): commit, ref = ...
def get_refs(self, location): """Return map of named refs (branches or tags) to commit hashes.""" output = call_subprocess([self.cmd, 'show-ref'], show_stdout=False, cwd=location) rv = {} for line in output.strip().splitlines(): commit, ref = ...
[ "Return", "map", "of", "named", "refs", "(", "branches", "or", "tags", ")", "to", "commit", "hashes", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/pip/vcs/git.py#L143-L160
[ "def", "get_refs", "(", "self", ",", "location", ")", ":", "output", "=", "call_subprocess", "(", "[", "self", ".", "cmd", ",", "'show-ref'", "]", ",", "show_stdout", "=", "False", ",", "cwd", "=", "location", ")", "rv", "=", "{", "}", "for", "line",...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb