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
reverse_bintree
construct {parent:[children]} dict from {child:parent} keys are the nodes in the tree, and values are the lists of children of that node in the tree. reverse_tree[None] is the root node >>> tree = bintree(range(7)) >>> reverse_bintree(tree) {None: 0, 0: [1, 4], 4: [5, 6], 1: [2, 3...
environment/share/doc/ipython/examples/parallel/interengine/bintree.py
def reverse_bintree(parents): """construct {parent:[children]} dict from {child:parent} keys are the nodes in the tree, and values are the lists of children of that node in the tree. reverse_tree[None] is the root node >>> tree = bintree(range(7)) >>> reverse_bintree(tree) {No...
def reverse_bintree(parents): """construct {parent:[children]} dict from {child:parent} keys are the nodes in the tree, and values are the lists of children of that node in the tree. reverse_tree[None] is the root node >>> tree = bintree(range(7)) >>> reverse_bintree(tree) {No...
[ "construct", "{", "parent", ":", "[", "children", "]", "}", "dict", "from", "{", "child", ":", "parent", "}", "keys", "are", "the", "nodes", "in", "the", "tree", "and", "values", "are", "the", "lists", "of", "children", "of", "that", "node", "in", "t...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree.py#L60-L81
[ "def", "reverse_bintree", "(", "parents", ")", ":", "children", "=", "{", "}", "for", "child", ",", "parent", "in", "parents", ".", "iteritems", "(", ")", ":", "if", "parent", "is", "None", ":", "children", "[", "None", "]", "=", "child", "continue", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
depth
get depth of an element in the tree
environment/share/doc/ipython/examples/parallel/interengine/bintree.py
def depth(n, tree): """get depth of an element in the tree""" d = 0 parent = tree[n] while parent is not None: d += 1 parent = tree[parent] return d
def depth(n, tree): """get depth of an element in the tree""" d = 0 parent = tree[n] while parent is not None: d += 1 parent = tree[parent] return d
[ "get", "depth", "of", "an", "element", "in", "the", "tree" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree.py#L83-L90
[ "def", "depth", "(", "n", ",", "tree", ")", ":", "d", "=", "0", "parent", "=", "tree", "[", "n", "]", "while", "parent", "is", "not", "None", ":", "d", "+=", "1", "parent", "=", "tree", "[", "parent", "]", "return", "d" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
print_bintree
print a binary tree
environment/share/doc/ipython/examples/parallel/interengine/bintree.py
def print_bintree(tree, indent=' '): """print a binary tree""" for n in sorted(tree.keys()): print "%s%s" % (indent * depth(n,tree), n)
def print_bintree(tree, indent=' '): """print a binary tree""" for n in sorted(tree.keys()): print "%s%s" % (indent * depth(n,tree), n)
[ "print", "a", "binary", "tree" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree.py#L92-L95
[ "def", "print_bintree", "(", "tree", ",", "indent", "=", "' '", ")", ":", "for", "n", "in", "sorted", "(", "tree", ".", "keys", "(", ")", ")", ":", "print", "\"%s%s\"", "%", "(", "indent", "*", "depth", "(", "n", ",", "tree", ")", ",", "n", ")...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
disambiguate_dns_url
accept either IP address or dns name, and return IP
environment/share/doc/ipython/examples/parallel/interengine/bintree.py
def disambiguate_dns_url(url, location): """accept either IP address or dns name, and return IP""" if not ip_pat.match(location): location = socket.gethostbyname(location) return disambiguate_url(url, location)
def disambiguate_dns_url(url, location): """accept either IP address or dns name, and return IP""" if not ip_pat.match(location): location = socket.gethostbyname(location) return disambiguate_url(url, location)
[ "accept", "either", "IP", "address", "or", "dns", "name", "and", "return", "IP" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree.py#L103-L107
[ "def", "disambiguate_dns_url", "(", "url", ",", "location", ")", ":", "if", "not", "ip_pat", ".", "match", "(", "location", ")", ":", "location", "=", "socket", ".", "gethostbyname", "(", "location", ")", "return", "disambiguate_url", "(", "url", ",", "loc...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BinaryTreeCommunicator.connect
connect to peers. `peers` will be a dict of 4-tuples, keyed by name. {peer : (ident, addr, pub_addr, location)} where peer is the name, ident is the XREP identity, addr,pub_addr are the
environment/share/doc/ipython/examples/parallel/interengine/bintree.py
def connect(self, peers, btree, pub_url, root_id=0): """connect to peers. `peers` will be a dict of 4-tuples, keyed by name. {peer : (ident, addr, pub_addr, location)} where peer is the name, ident is the XREP identity, addr,pub_addr are the """ # count the number of ch...
def connect(self, peers, btree, pub_url, root_id=0): """connect to peers. `peers` will be a dict of 4-tuples, keyed by name. {peer : (ident, addr, pub_addr, location)} where peer is the name, ident is the XREP identity, addr,pub_addr are the """ # count the number of ch...
[ "connect", "to", "peers", ".", "peers", "will", "be", "a", "dict", "of", "4", "-", "tuples", "keyed", "by", "name", ".", "{", "peer", ":", "(", "ident", "addr", "pub_addr", "location", ")", "}", "where", "peer", "is", "the", "name", "ident", "is", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree.py#L161-L179
[ "def", "connect", "(", "self", ",", "peers", ",", "btree", ",", "pub_url", ",", "root_id", "=", "0", ")", ":", "# count the number of children we have", "self", ".", "nchildren", "=", "btree", ".", "values", "(", ")", ".", "count", "(", "self", ".", "id"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BinaryTreeCommunicator.reduce
parallel reduce on binary tree if flat: value is an entry in the sequence else: value is a list of entries in the sequence if all: broadcast final result to all nodes else: only root gets final result
environment/share/doc/ipython/examples/parallel/interengine/bintree.py
def reduce(self, f, value, flat=True, all=False): """parallel reduce on binary tree if flat: value is an entry in the sequence else: value is a list of entries in the sequence if all: broadcast final result to all nodes else: ...
def reduce(self, f, value, flat=True, all=False): """parallel reduce on binary tree if flat: value is an entry in the sequence else: value is a list of entries in the sequence if all: broadcast final result to all nodes else: ...
[ "parallel", "reduce", "on", "binary", "tree", "if", "flat", ":", "value", "is", "an", "entry", "in", "the", "sequence", "else", ":", "value", "is", "a", "list", "of", "entries", "in", "the", "sequence", "if", "all", ":", "broadcast", "final", "result", ...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree.py#L213-L240
[ "def", "reduce", "(", "self", ",", "f", ",", "value", ",", "flat", "=", "True", ",", "all", "=", "False", ")", ":", "if", "not", "flat", ":", "value", "=", "reduce", "(", "f", ",", "value", ")", "for", "i", "in", "range", "(", "self", ".", "n...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BinaryTreeCommunicator.allreduce
parallel reduce followed by broadcast of the result
environment/share/doc/ipython/examples/parallel/interengine/bintree.py
def allreduce(self, f, value, flat=True): """parallel reduce followed by broadcast of the result""" return self.reduce(f, value, flat=flat, all=True)
def allreduce(self, f, value, flat=True): """parallel reduce followed by broadcast of the result""" return self.reduce(f, value, flat=flat, all=True)
[ "parallel", "reduce", "followed", "by", "broadcast", "of", "the", "result" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/share/doc/ipython/examples/parallel/interengine/bintree.py#L242-L244
[ "def", "allreduce", "(", "self", ",", "f", ",", "value", ",", "flat", "=", "True", ")", ":", "return", "self", ".", "reduce", "(", "f", ",", "value", ",", "flat", "=", "flat", ",", "all", "=", "True", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
HubFactory.init_hub
construct
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def init_hub(self): """construct""" client_iface = "%s://%s:" % (self.client_transport, self.client_ip) + "%i" engine_iface = "%s://%s:" % (self.engine_transport, self.engine_ip) + "%i" ctx = self.context loop = self.loop # Registrar socket q = ZMQStream(ctx.soc...
def init_hub(self): """construct""" client_iface = "%s://%s:" % (self.client_transport, self.client_ip) + "%i" engine_iface = "%s://%s:" % (self.engine_transport, self.engine_ip) + "%i" ctx = self.context loop = self.loop # Registrar socket q = ZMQStream(ctx.soc...
[ "construct" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L234-L316
[ "def", "init_hub", "(", "self", ")", ":", "client_iface", "=", "\"%s://%s:\"", "%", "(", "self", ".", "client_transport", ",", "self", ".", "client_ip", ")", "+", "\"%i\"", "engine_iface", "=", "\"%s://%s:\"", "%", "(", "self", ".", "engine_transport", ",", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub._validate_targets
turn any valid targets argument into a list of integer ids
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def _validate_targets(self, targets): """turn any valid targets argument into a list of integer ids""" if targets is None: # default to all return self.ids if isinstance(targets, (int,str,unicode)): # only one target specified targets = [targets] ...
def _validate_targets(self, targets): """turn any valid targets argument into a list of integer ids""" if targets is None: # default to all return self.ids if isinstance(targets, (int,str,unicode)): # only one target specified targets = [targets] ...
[ "turn", "any", "valid", "targets", "argument", "into", "a", "list", "of", "integer", "ids" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L448-L469
[ "def", "_validate_targets", "(", "self", ",", "targets", ")", ":", "if", "targets", "is", "None", ":", "# default to all", "return", "self", ".", "ids", "if", "isinstance", "(", "targets", ",", "(", "int", ",", "str", ",", "unicode", ")", ")", ":", "# ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.dispatch_monitor_traffic
all ME and Task queue messages come through here, as well as IOPub traffic.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def dispatch_monitor_traffic(self, msg): """all ME and Task queue messages come through here, as well as IOPub traffic.""" self.log.debug("monitor traffic: %r", msg[0]) switch = msg[0] try: idents, msg = self.session.feed_identities(msg[1:]) except ValueError:...
def dispatch_monitor_traffic(self, msg): """all ME and Task queue messages come through here, as well as IOPub traffic.""" self.log.debug("monitor traffic: %r", msg[0]) switch = msg[0] try: idents, msg = self.session.feed_identities(msg[1:]) except ValueError:...
[ "all", "ME", "and", "Task", "queue", "messages", "come", "through", "here", "as", "well", "as", "IOPub", "traffic", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L477-L493
[ "def", "dispatch_monitor_traffic", "(", "self", ",", "msg", ")", ":", "self", ".", "log", ".", "debug", "(", "\"monitor traffic: %r\"", ",", "msg", "[", "0", "]", ")", "switch", "=", "msg", "[", "0", "]", "try", ":", "idents", ",", "msg", "=", "self"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.dispatch_query
Route registration requests and queries from clients.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def dispatch_query(self, msg): """Route registration requests and queries from clients.""" try: idents, msg = self.session.feed_identities(msg) except ValueError: idents = [] if not idents: self.log.error("Bad Query Message: %r", msg) retur...
def dispatch_query(self, msg): """Route registration requests and queries from clients.""" try: idents, msg = self.session.feed_identities(msg) except ValueError: idents = [] if not idents: self.log.error("Bad Query Message: %r", msg) retur...
[ "Route", "registration", "requests", "and", "queries", "from", "clients", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L497-L530
[ "def", "dispatch_query", "(", "self", ",", "msg", ")", ":", "try", ":", "idents", ",", "msg", "=", "self", ".", "session", ".", "feed_identities", "(", "msg", ")", "except", "ValueError", ":", "idents", "=", "[", "]", "if", "not", "idents", ":", "sel...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.handle_new_heart
handler to attach to heartbeater. Called when a new heart starts to beat. Triggers completion of registration.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def handle_new_heart(self, heart): """handler to attach to heartbeater. Called when a new heart starts to beat. Triggers completion of registration.""" self.log.debug("heartbeat::handle_new_heart(%r)", heart) if heart not in self.incoming_registrations: self.log.info(...
def handle_new_heart(self, heart): """handler to attach to heartbeater. Called when a new heart starts to beat. Triggers completion of registration.""" self.log.debug("heartbeat::handle_new_heart(%r)", heart) if heart not in self.incoming_registrations: self.log.info(...
[ "handler", "to", "attach", "to", "heartbeater", ".", "Called", "when", "a", "new", "heart", "starts", "to", "beat", ".", "Triggers", "completion", "of", "registration", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L542-L550
[ "def", "handle_new_heart", "(", "self", ",", "heart", ")", ":", "self", ".", "log", ".", "debug", "(", "\"heartbeat::handle_new_heart(%r)\"", ",", "heart", ")", "if", "heart", "not", "in", "self", ".", "incoming_registrations", ":", "self", ".", "log", ".", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.handle_heart_failure
handler to attach to heartbeater. called when a previously registered heart fails to respond to beat request. triggers unregistration
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def handle_heart_failure(self, heart): """handler to attach to heartbeater. called when a previously registered heart fails to respond to beat request. triggers unregistration""" self.log.debug("heartbeat::handle_heart_failure(%r)", heart) eid = self.hearts.get(heart, None) ...
def handle_heart_failure(self, heart): """handler to attach to heartbeater. called when a previously registered heart fails to respond to beat request. triggers unregistration""" self.log.debug("heartbeat::handle_heart_failure(%r)", heart) eid = self.hearts.get(heart, None) ...
[ "handler", "to", "attach", "to", "heartbeater", ".", "called", "when", "a", "previously", "registered", "heart", "fails", "to", "respond", "to", "beat", "request", ".", "triggers", "unregistration" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L553-L563
[ "def", "handle_heart_failure", "(", "self", ",", "heart", ")", ":", "self", ".", "log", ".", "debug", "(", "\"heartbeat::handle_heart_failure(%r)\"", ",", "heart", ")", "eid", "=", "self", ".", "hearts", ".", "get", "(", "heart", ",", "None", ")", "queue",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.save_task_request
Save the submission of a task.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def save_task_request(self, idents, msg): """Save the submission of a task.""" client_id = idents[0] try: msg = self.session.unserialize(msg) except Exception: self.log.error("task::client %r sent invalid task message: %r", client_id, msg, exc...
def save_task_request(self, idents, msg): """Save the submission of a task.""" client_id = idents[0] try: msg = self.session.unserialize(msg) except Exception: self.log.error("task::client %r sent invalid task message: %r", client_id, msg, exc...
[ "Save", "the", "submission", "of", "a", "task", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L668-L717
[ "def", "save_task_request", "(", "self", ",", "idents", ",", "msg", ")", ":", "client_id", "=", "idents", "[", "0", "]", "try", ":", "msg", "=", "self", ".", "session", ".", "unserialize", "(", "msg", ")", "except", "Exception", ":", "self", ".", "lo...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.save_task_result
save the result of a completed task.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def save_task_result(self, idents, msg): """save the result of a completed task.""" client_id = idents[0] try: msg = self.session.unserialize(msg) except Exception: self.log.error("task::invalid task result message send to %r: %r", client_id, m...
def save_task_result(self, idents, msg): """save the result of a completed task.""" client_id = idents[0] try: msg = self.session.unserialize(msg) except Exception: self.log.error("task::invalid task result message send to %r: %r", client_id, m...
[ "save", "the", "result", "of", "a", "completed", "task", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L719-L771
[ "def", "save_task_result", "(", "self", ",", "idents", ",", "msg", ")", ":", "client_id", "=", "idents", "[", "0", "]", "try", ":", "msg", "=", "self", ".", "session", ".", "unserialize", "(", "msg", ")", "except", "Exception", ":", "self", ".", "log...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.save_iopub_message
save an iopub message into the db
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def save_iopub_message(self, topics, msg): """save an iopub message into the db""" # print (topics) try: msg = self.session.unserialize(msg, content=True) except Exception: self.log.error("iopub::invalid IOPub message", exc_info=True) return p...
def save_iopub_message(self, topics, msg): """save an iopub message into the db""" # print (topics) try: msg = self.session.unserialize(msg, content=True) except Exception: self.log.error("iopub::invalid IOPub message", exc_info=True) return p...
[ "save", "an", "iopub", "message", "into", "the", "db" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L808-L856
[ "def", "save_iopub_message", "(", "self", ",", "topics", ",", "msg", ")", ":", "# print (topics)", "try", ":", "msg", "=", "self", ".", "session", ".", "unserialize", "(", "msg", ",", "content", "=", "True", ")", "except", "Exception", ":", "self", ".", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.connection_request
Reply with connection addresses for clients.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def connection_request(self, client_id, msg): """Reply with connection addresses for clients.""" self.log.info("client::client %r connected", client_id) content = dict(status='ok') content.update(self.client_info) jsonable = {} for k,v in self.keytable.iteritems(): ...
def connection_request(self, client_id, msg): """Reply with connection addresses for clients.""" self.log.info("client::client %r connected", client_id) content = dict(status='ok') content.update(self.client_info) jsonable = {} for k,v in self.keytable.iteritems(): ...
[ "Reply", "with", "connection", "addresses", "for", "clients", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L864-L874
[ "def", "connection_request", "(", "self", ",", "client_id", ",", "msg", ")", ":", "self", ".", "log", ".", "info", "(", "\"client::client %r connected\"", ",", "client_id", ")", "content", "=", "dict", "(", "status", "=", "'ok'", ")", "content", ".", "upda...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.register_engine
Register a new engine.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def register_engine(self, reg, msg): """Register a new engine.""" content = msg['content'] try: queue = cast_bytes(content['queue']) except KeyError: self.log.error("registration::queue not specified", exc_info=True) return heart = content.get(...
def register_engine(self, reg, msg): """Register a new engine.""" content = msg['content'] try: queue = cast_bytes(content['queue']) except KeyError: self.log.error("registration::queue not specified", exc_info=True) return heart = content.get(...
[ "Register", "a", "new", "engine", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L876-L941
[ "def", "register_engine", "(", "self", ",", "reg", ",", "msg", ")", ":", "content", "=", "msg", "[", "'content'", "]", "try", ":", "queue", "=", "cast_bytes", "(", "content", "[", "'queue'", "]", ")", "except", "KeyError", ":", "self", ".", "log", "....
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.unregister_engine
Unregister an engine that explicitly requested to leave.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def unregister_engine(self, ident, msg): """Unregister an engine that explicitly requested to leave.""" try: eid = msg['content']['id'] except: self.log.error("registration::bad engine id for unregistration: %r", ident, exc_info=True) return self.log.i...
def unregister_engine(self, ident, msg): """Unregister an engine that explicitly requested to leave.""" try: eid = msg['content']['id'] except: self.log.error("registration::bad engine id for unregistration: %r", ident, exc_info=True) return self.log.i...
[ "Unregister", "an", "engine", "that", "explicitly", "requested", "to", "leave", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L943-L968
[ "def", "unregister_engine", "(", "self", ",", "ident", ",", "msg", ")", ":", "try", ":", "eid", "=", "msg", "[", "'content'", "]", "[", "'id'", "]", "except", ":", "self", ".", "log", ".", "error", "(", "\"registration::bad engine id for unregistration: %r\"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub._handle_stranded_msgs
Handle messages known to be on an engine when the engine unregisters. It is possible that this will fire prematurely - that is, an engine will go down after completing a result, and the client will be notified that the result failed and later receive the actual result.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def _handle_stranded_msgs(self, eid, uuid): """Handle messages known to be on an engine when the engine unregisters. It is possible that this will fire prematurely - that is, an engine will go down after completing a result, and the client will be notified that the result failed and lat...
def _handle_stranded_msgs(self, eid, uuid): """Handle messages known to be on an engine when the engine unregisters. It is possible that this will fire prematurely - that is, an engine will go down after completing a result, and the client will be notified that the result failed and lat...
[ "Handle", "messages", "known", "to", "be", "on", "an", "engine", "when", "the", "engine", "unregisters", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L970-L997
[ "def", "_handle_stranded_msgs", "(", "self", ",", "eid", ",", "uuid", ")", ":", "outstanding", "=", "self", ".", "queues", "[", "eid", "]", "for", "msg_id", "in", "outstanding", ":", "self", ".", "pending", ".", "remove", "(", "msg_id", ")", "self", "....
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.finish_registration
Second half of engine registration, called after our HeartMonitor has received a beat from the Engine's Heart.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def finish_registration(self, heart): """Second half of engine registration, called after our HeartMonitor has received a beat from the Engine's Heart.""" try: (eid,queue,reg,purge) = self.incoming_registrations.pop(heart) except KeyError: self.log.error("registra...
def finish_registration(self, heart): """Second half of engine registration, called after our HeartMonitor has received a beat from the Engine's Heart.""" try: (eid,queue,reg,purge) = self.incoming_registrations.pop(heart) except KeyError: self.log.error("registra...
[ "Second", "half", "of", "engine", "registration", "called", "after", "our", "HeartMonitor", "has", "received", "a", "beat", "from", "the", "Engine", "s", "Heart", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1000-L1024
[ "def", "finish_registration", "(", "self", ",", "heart", ")", ":", "try", ":", "(", "eid", ",", "queue", ",", "reg", ",", "purge", ")", "=", "self", ".", "incoming_registrations", ".", "pop", "(", "heart", ")", "except", "KeyError", ":", "self", ".", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.shutdown_request
handle shutdown request.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def shutdown_request(self, client_id, msg): """handle shutdown request.""" self.session.send(self.query, 'shutdown_reply', content={'status': 'ok'}, ident=client_id) # also notify other clients of shutdown self.session.send(self.notifier, 'shutdown_notice', content={'status': 'ok'}) ...
def shutdown_request(self, client_id, msg): """handle shutdown request.""" self.session.send(self.query, 'shutdown_reply', content={'status': 'ok'}, ident=client_id) # also notify other clients of shutdown self.session.send(self.notifier, 'shutdown_notice', content={'status': 'ok'}) ...
[ "handle", "shutdown", "request", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1037-L1043
[ "def", "shutdown_request", "(", "self", ",", "client_id", ",", "msg", ")", ":", "self", ".", "session", ".", "send", "(", "self", ".", "query", ",", "'shutdown_reply'", ",", "content", "=", "{", "'status'", ":", "'ok'", "}", ",", "ident", "=", "client_...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.queue_status
Return the Queue status of one or more targets. if verbose: return the msg_ids else: return len of each type. keys: queue (pending MUX jobs) tasks (pending Task jobs) completed (finished jobs from both queues)
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def queue_status(self, client_id, msg): """Return the Queue status of one or more targets. if verbose: return the msg_ids else: return len of each type. keys: queue (pending MUX jobs) tasks (pending Task jobs) completed (finished jobs from both queues)""" ...
def queue_status(self, client_id, msg): """Return the Queue status of one or more targets. if verbose: return the msg_ids else: return len of each type. keys: queue (pending MUX jobs) tasks (pending Task jobs) completed (finished jobs from both queues)""" ...
[ "Return", "the", "Queue", "status", "of", "one", "or", "more", "targets", ".", "if", "verbose", ":", "return", "the", "msg_ids", "else", ":", "return", "len", "of", "each", "type", ".", "keys", ":", "queue", "(", "pending", "MUX", "jobs", ")", "tasks",...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1069-L1098
[ "def", "queue_status", "(", "self", ",", "client_id", ",", "msg", ")", ":", "content", "=", "msg", "[", "'content'", "]", "targets", "=", "content", "[", "'targets'", "]", "try", ":", "targets", "=", "self", ".", "_validate_targets", "(", "targets", ")",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.purge_results
Purge results from memory. This method is more valuable before we move to a DB based message storage mechanism.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def purge_results(self, client_id, msg): """Purge results from memory. This method is more valuable before we move to a DB based message storage mechanism.""" content = msg['content'] self.log.info("Dropping records with %s", content) msg_ids = content.get('msg_ids', []) ...
def purge_results(self, client_id, msg): """Purge results from memory. This method is more valuable before we move to a DB based message storage mechanism.""" content = msg['content'] self.log.info("Dropping records with %s", content) msg_ids = content.get('msg_ids', []) ...
[ "Purge", "results", "from", "memory", ".", "This", "method", "is", "more", "valuable", "before", "we", "move", "to", "a", "DB", "based", "message", "storage", "mechanism", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1100-L1141
[ "def", "purge_results", "(", "self", ",", "client_id", ",", "msg", ")", ":", "content", "=", "msg", "[", "'content'", "]", "self", ".", "log", ".", "info", "(", "\"Dropping records with %s\"", ",", "content", ")", "msg_ids", "=", "content", ".", "get", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.resubmit_task
Resubmit one or more tasks.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def resubmit_task(self, client_id, msg): """Resubmit one or more tasks.""" def finish(reply): self.session.send(self.query, 'resubmit_reply', content=reply, ident=client_id) content = msg['content'] msg_ids = content['msg_ids'] reply = dict(status='ok') try: ...
def resubmit_task(self, client_id, msg): """Resubmit one or more tasks.""" def finish(reply): self.session.send(self.query, 'resubmit_reply', content=reply, ident=client_id) content = msg['content'] msg_ids = content['msg_ids'] reply = dict(status='ok') try: ...
[ "Resubmit", "one", "or", "more", "tasks", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1143-L1216
[ "def", "resubmit_task", "(", "self", ",", "client_id", ",", "msg", ")", ":", "def", "finish", "(", "reply", ")", ":", "self", ".", "session", ".", "send", "(", "self", ".", "query", ",", "'resubmit_reply'", ",", "content", "=", "reply", ",", "ident", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub._extract_record
decompose a TaskRecord dict into subsection of reply for get_result
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def _extract_record(self, rec): """decompose a TaskRecord dict into subsection of reply for get_result""" io_dict = {} for key in ('pyin', 'pyout', 'pyerr', 'stdout', 'stderr'): io_dict[key] = rec[key] content = { 'result_content': rec['result_content'], ...
def _extract_record(self, rec): """decompose a TaskRecord dict into subsection of reply for get_result""" io_dict = {} for key in ('pyin', 'pyout', 'pyerr', 'stdout', 'stderr'): io_dict[key] = rec[key] content = { 'result_content': rec['result_content'], ...
[ "decompose", "a", "TaskRecord", "dict", "into", "subsection", "of", "reply", "for", "get_result" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1219-L1235
[ "def", "_extract_record", "(", "self", ",", "rec", ")", ":", "io_dict", "=", "{", "}", "for", "key", "in", "(", "'pyin'", ",", "'pyout'", ",", "'pyerr'", ",", "'stdout'", ",", "'stderr'", ")", ":", "io_dict", "[", "key", "]", "=", "rec", "[", "key"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.get_results
Get the result of 1 or more messages.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def get_results(self, client_id, msg): """Get the result of 1 or more messages.""" content = msg['content'] msg_ids = sorted(set(content['msg_ids'])) statusonly = content.get('status_only', False) pending = [] completed = [] content = dict(status='ok') con...
def get_results(self, client_id, msg): """Get the result of 1 or more messages.""" content = msg['content'] msg_ids = sorted(set(content['msg_ids'])) statusonly = content.get('status_only', False) pending = [] completed = [] content = dict(status='ok') con...
[ "Get", "the", "result", "of", "1", "or", "more", "messages", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1237-L1287
[ "def", "get_results", "(", "self", ",", "client_id", ",", "msg", ")", ":", "content", "=", "msg", "[", "'content'", "]", "msg_ids", "=", "sorted", "(", "set", "(", "content", "[", "'msg_ids'", "]", ")", ")", "statusonly", "=", "content", ".", "get", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.get_history
Get a list of all msg_ids in our DB records
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def get_history(self, client_id, msg): """Get a list of all msg_ids in our DB records""" try: msg_ids = self.db.get_history() except Exception as e: content = error.wrap_exception() else: content = dict(status='ok', history=msg_ids) self.sessi...
def get_history(self, client_id, msg): """Get a list of all msg_ids in our DB records""" try: msg_ids = self.db.get_history() except Exception as e: content = error.wrap_exception() else: content = dict(status='ok', history=msg_ids) self.sessi...
[ "Get", "a", "list", "of", "all", "msg_ids", "in", "our", "DB", "records" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1289-L1299
[ "def", "get_history", "(", "self", ",", "client_id", ",", "msg", ")", ":", "try", ":", "msg_ids", "=", "self", ".", "db", ".", "get_history", "(", ")", "except", "Exception", "as", "e", ":", "content", "=", "error", ".", "wrap_exception", "(", ")", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Hub.db_query
Perform a raw query on the task record database.
environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
def db_query(self, client_id, msg): """Perform a raw query on the task record database.""" content = msg['content'] query = content.get('query', {}) keys = content.get('keys', None) buffers = [] empty = list() try: records = self.db.find_records(query,...
def db_query(self, client_id, msg): """Perform a raw query on the task record database.""" content = msg['content'] query = content.get('query', {}) keys = content.get('keys', None) buffers = [] empty = list() try: records = self.db.find_records(query,...
[ "Perform", "a", "raw", "query", "on", "the", "task", "record", "database", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/parallel/controller/hub.py#L1301-L1336
[ "def", "db_query", "(", "self", ",", "client_id", ",", "msg", ")", ":", "content", "=", "msg", "[", "'content'", "]", "query", "=", "content", ".", "get", "(", "'query'", ",", "{", "}", ")", "keys", "=", "content", ".", "get", "(", "'keys'", ",", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Rscript.cd
go to the path
pyRscript/pyRscript.py
def cd(self, newdir): """ go to the path """ prevdir = os.getcwd() os.chdir(newdir) try: yield finally: os.chdir(prevdir)
def cd(self, newdir): """ go to the path """ prevdir = os.getcwd() os.chdir(newdir) try: yield finally: os.chdir(prevdir)
[ "go", "to", "the", "path" ]
chairco/pyRscript
python
https://github.com/chairco/pyRscript/blob/e952f450a873de52baa4fe80ed901f0cf990c0b7/pyRscript/pyRscript.py#L52-L61
[ "def", "cd", "(", "self", ",", "newdir", ")", ":", "prevdir", "=", "os", ".", "getcwd", "(", ")", "os", ".", "chdir", "(", "newdir", ")", "try", ":", "yield", "finally", ":", "os", ".", "chdir", "(", "prevdir", ")" ]
e952f450a873de52baa4fe80ed901f0cf990c0b7
test
Rscript.decode_cmd_out
return a standard message
pyRscript/pyRscript.py
def decode_cmd_out(self, completed_cmd): """ return a standard message """ try: stdout = completed_cmd.stdout.encode('utf-8').decode() except AttributeError: try: stdout = str(bytes(completed_cmd.stdout), 'big5').strip() except ...
def decode_cmd_out(self, completed_cmd): """ return a standard message """ try: stdout = completed_cmd.stdout.encode('utf-8').decode() except AttributeError: try: stdout = str(bytes(completed_cmd.stdout), 'big5').strip() except ...
[ "return", "a", "standard", "message" ]
chairco/pyRscript
python
https://github.com/chairco/pyRscript/blob/e952f450a873de52baa4fe80ed901f0cf990c0b7/pyRscript/pyRscript.py#L63-L86
[ "def", "decode_cmd_out", "(", "self", ",", "completed_cmd", ")", ":", "try", ":", "stdout", "=", "completed_cmd", ".", "stdout", ".", "encode", "(", "'utf-8'", ")", ".", "decode", "(", ")", "except", "AttributeError", ":", "try", ":", "stdout", "=", "str...
e952f450a873de52baa4fe80ed901f0cf990c0b7
test
Rscript.run_command_under_r_root
subprocess run on here
pyRscript/pyRscript.py
def run_command_under_r_root(self, cmd, catched=True): """ subprocess run on here """ RPATH = self.path with self.cd(newdir=RPATH): if catched: process = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE) else: process = sp.run(cmd...
def run_command_under_r_root(self, cmd, catched=True): """ subprocess run on here """ RPATH = self.path with self.cd(newdir=RPATH): if catched: process = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE) else: process = sp.run(cmd...
[ "subprocess", "run", "on", "here" ]
chairco/pyRscript
python
https://github.com/chairco/pyRscript/blob/e952f450a873de52baa4fe80ed901f0cf990c0b7/pyRscript/pyRscript.py#L88-L98
[ "def", "run_command_under_r_root", "(", "self", ",", "cmd", ",", "catched", "=", "True", ")", ":", "RPATH", "=", "self", ".", "path", "with", "self", ".", "cd", "(", "newdir", "=", "RPATH", ")", ":", "if", "catched", ":", "process", "=", "sp", ".", ...
e952f450a873de52baa4fe80ed901f0cf990c0b7
test
Rscript.execute
Execute R script
pyRscript/pyRscript.py
def execute(self): """ Execute R script """ rprocess = OrderedDict() commands = OrderedDict([ (self.file, ['Rscript', self.file] + self.cmd), ]) for cmd_name, cmd in commands.items(): rprocess[cmd_name] = self.run_command_under_r_root(cmd) ...
def execute(self): """ Execute R script """ rprocess = OrderedDict() commands = OrderedDict([ (self.file, ['Rscript', self.file] + self.cmd), ]) for cmd_name, cmd in commands.items(): rprocess[cmd_name] = self.run_command_under_r_root(cmd) ...
[ "Execute", "R", "script" ]
chairco/pyRscript
python
https://github.com/chairco/pyRscript/blob/e952f450a873de52baa4fe80ed901f0cf990c0b7/pyRscript/pyRscript.py#L100-L111
[ "def", "execute", "(", "self", ")", ":", "rprocess", "=", "OrderedDict", "(", ")", "commands", "=", "OrderedDict", "(", "[", "(", "self", ".", "file", ",", "[", "'Rscript'", ",", "self", ".", "file", "]", "+", "self", ".", "cmd", ")", ",", "]", "...
e952f450a873de52baa4fe80ed901f0cf990c0b7
test
BaseFrontendMixin._set_kernel_manager
Disconnect from the current kernel manager (if any) and set a new kernel manager.
environment/lib/python2.7/site-packages/IPython/frontend/qt/base_frontend_mixin.py
def _set_kernel_manager(self, kernel_manager): """ Disconnect from the current kernel manager (if any) and set a new kernel manager. """ # Disconnect the old kernel manager, if necessary. old_manager = self._kernel_manager if old_manager is not None: old_m...
def _set_kernel_manager(self, kernel_manager): """ Disconnect from the current kernel manager (if any) and set a new kernel manager. """ # Disconnect the old kernel manager, if necessary. old_manager = self._kernel_manager if old_manager is not None: old_m...
[ "Disconnect", "from", "the", "current", "kernel", "manager", "(", "if", "any", ")", "and", "set", "a", "new", "kernel", "manager", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/base_frontend_mixin.py#L21-L62
[ "def", "_set_kernel_manager", "(", "self", ",", "kernel_manager", ")", ":", "# Disconnect the old kernel manager, if necessary.", "old_manager", "=", "self", ".", "_kernel_manager", "if", "old_manager", "is", "not", "None", ":", "old_manager", ".", "started_kernel", "."...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BaseFrontendMixin._dispatch
Calls the frontend handler associated with the message type of the given message.
environment/lib/python2.7/site-packages/IPython/frontend/qt/base_frontend_mixin.py
def _dispatch(self, msg): """ Calls the frontend handler associated with the message type of the given message. """ msg_type = msg['header']['msg_type'] handler = getattr(self, '_handle_' + msg_type, None) if handler: handler(msg)
def _dispatch(self, msg): """ Calls the frontend handler associated with the message type of the given message. """ msg_type = msg['header']['msg_type'] handler = getattr(self, '_handle_' + msg_type, None) if handler: handler(msg)
[ "Calls", "the", "frontend", "handler", "associated", "with", "the", "message", "type", "of", "the", "given", "message", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/base_frontend_mixin.py#L102-L109
[ "def", "_dispatch", "(", "self", ",", "msg", ")", ":", "msg_type", "=", "msg", "[", "'header'", "]", "[", "'msg_type'", "]", "handler", "=", "getattr", "(", "self", ",", "'_handle_'", "+", "msg_type", ",", "None", ")", "if", "handler", ":", "handler", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
BaseFrontendMixin._is_from_this_session
Returns whether a reply from the kernel originated from a request from this frontend.
environment/lib/python2.7/site-packages/IPython/frontend/qt/base_frontend_mixin.py
def _is_from_this_session(self, msg): """ Returns whether a reply from the kernel originated from a request from this frontend. """ session = self._kernel_manager.session.session parent = msg['parent_header'] if not parent: # if the message has no parent, ...
def _is_from_this_session(self, msg): """ Returns whether a reply from the kernel originated from a request from this frontend. """ session = self._kernel_manager.session.session parent = msg['parent_header'] if not parent: # if the message has no parent, ...
[ "Returns", "whether", "a", "reply", "from", "the", "kernel", "originated", "from", "a", "request", "from", "this", "frontend", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/base_frontend_mixin.py#L111-L121
[ "def", "_is_from_this_session", "(", "self", ",", "msg", ")", ":", "session", "=", "self", ".", "_kernel_manager", ".", "session", ".", "session", "parent", "=", "msg", "[", "'parent_header'", "]", "if", "not", "parent", ":", "# if the message has no parent, ass...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
AnnotateReporter.report
Run the report. See `coverage.report()` for arguments.
virtualEnvironment/lib/python2.7/site-packages/coverage/annotate.py
def report(self, morfs, directory=None): """Run the report. See `coverage.report()` for arguments. """ self.report_files(self.annotate_file, morfs, directory)
def report(self, morfs, directory=None): """Run the report. See `coverage.report()` for arguments. """ self.report_files(self.annotate_file, morfs, directory)
[ "Run", "the", "report", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/annotate.py#L37-L43
[ "def", "report", "(", "self", ",", "morfs", ",", "directory", "=", "None", ")", ":", "self", ".", "report_files", "(", "self", ".", "annotate_file", ",", "morfs", ",", "directory", ")" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
AnnotateReporter.annotate_file
Annotate a single file. `cu` is the CodeUnit for the file to annotate.
virtualEnvironment/lib/python2.7/site-packages/coverage/annotate.py
def annotate_file(self, cu, analysis): """Annotate a single file. `cu` is the CodeUnit for the file to annotate. """ if not cu.relative: return filename = cu.filename source = cu.source_file() if self.directory: dest_file = os.path.join(...
def annotate_file(self, cu, analysis): """Annotate a single file. `cu` is the CodeUnit for the file to annotate. """ if not cu.relative: return filename = cu.filename source = cu.source_file() if self.directory: dest_file = os.path.join(...
[ "Annotate", "a", "single", "file", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/annotate.py#L45-L102
[ "def", "annotate_file", "(", "self", ",", "cu", ",", "analysis", ")", ":", "if", "not", "cu", ".", "relative", ":", "return", "filename", "=", "cu", ".", "filename", "source", "=", "cu", ".", "source_file", "(", ")", "if", "self", ".", "directory", "...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
find
returns a list of tuples (package_name, description) for apt-cache search results
environment/lib/python2.7/site-packages/gurumate-2.8.6-py2.7.egg/gurumate/linux2/apt.py
def find(name): ''' returns a list of tuples (package_name, description) for apt-cache search results ''' cmd = 'apt-cache search %s' % name args = shlex.split(cmd) try: output = subprocess.check_output(args) except CalledProcessError: return [] lines = output.splitli...
def find(name): ''' returns a list of tuples (package_name, description) for apt-cache search results ''' cmd = 'apt-cache search %s' % name args = shlex.split(cmd) try: output = subprocess.check_output(args) except CalledProcessError: return [] lines = output.splitli...
[ "returns", "a", "list", "of", "tuples", "(", "package_name", "description", ")", "for", "apt", "-", "cache", "search", "results" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/gurumate-2.8.6-py2.7.egg/gurumate/linux2/apt.py#L7-L22
[ "def", "find", "(", "name", ")", ":", "cmd", "=", "'apt-cache search %s'", "%", "name", "args", "=", "shlex", ".", "split", "(", "cmd", ")", "try", ":", "output", "=", "subprocess", ".", "check_output", "(", "args", ")", "except", "CalledProcessError", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
get_installed_version
returns installed package version and None if package is not installed
environment/lib/python2.7/site-packages/gurumate-2.8.6-py2.7.egg/gurumate/linux2/apt.py
def get_installed_version(name): ''' returns installed package version and None if package is not installed ''' pattern = re.compile(r'''Installed:\s+(?P<version>.*)''') cmd = 'apt-cache policy %s' % name args = shlex.split(cmd) try: output = subprocess.check_output(args) ...
def get_installed_version(name): ''' returns installed package version and None if package is not installed ''' pattern = re.compile(r'''Installed:\s+(?P<version>.*)''') cmd = 'apt-cache policy %s' % name args = shlex.split(cmd) try: output = subprocess.check_output(args) ...
[ "returns", "installed", "package", "version", "and", "None", "if", "package", "is", "not", "installed" ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/gurumate-2.8.6-py2.7.egg/gurumate/linux2/apt.py#L30-L50
[ "def", "get_installed_version", "(", "name", ")", ":", "pattern", "=", "re", ".", "compile", "(", "r'''Installed:\\s+(?P<version>.*)'''", ")", "cmd", "=", "'apt-cache policy %s'", "%", "name", "args", "=", "shlex", ".", "split", "(", "cmd", ")", "try", ":", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
squash_unicode
coerce unicode back to bytestrings.
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def squash_unicode(obj): """coerce unicode back to bytestrings.""" if isinstance(obj,dict): for key in obj.keys(): obj[key] = squash_unicode(obj[key]) if isinstance(key, unicode): obj[squash_unicode(key)] = obj.pop(key) elif isinstance(obj, list): for ...
def squash_unicode(obj): """coerce unicode back to bytestrings.""" if isinstance(obj,dict): for key in obj.keys(): obj[key] = squash_unicode(obj[key]) if isinstance(key, unicode): obj[squash_unicode(key)] = obj.pop(key) elif isinstance(obj, list): for ...
[ "coerce", "unicode", "back", "to", "bytestrings", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L58-L70
[ "def", "squash_unicode", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "dict", ")", ":", "for", "key", "in", "obj", ".", "keys", "(", ")", ":", "obj", "[", "key", "]", "=", "squash_unicode", "(", "obj", "[", "key", "]", ")", "if", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
default_secure
Set the default behavior for a config environment to be secure. If Session.key/keyfile have not been set, set Session.key to a new random UUID.
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def default_secure(cfg): """Set the default behavior for a config environment to be secure. If Session.key/keyfile have not been set, set Session.key to a new random UUID. """ if 'Session' in cfg: if 'key' in cfg.Session or 'keyfile' in cfg.Session: return # key/key...
def default_secure(cfg): """Set the default behavior for a config environment to be secure. If Session.key/keyfile have not been set, set Session.key to a new random UUID. """ if 'Session' in cfg: if 'key' in cfg.Session or 'keyfile' in cfg.Session: return # key/key...
[ "Set", "the", "default", "behavior", "for", "a", "config", "environment", "to", "be", "secure", ".", "If", "Session", ".", "key", "/", "keyfile", "have", "not", "been", "set", "set", "Session", ".", "key", "to", "a", "new", "random", "UUID", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L110-L121
[ "def", "default_secure", "(", "cfg", ")", ":", "if", "'Session'", "in", "cfg", ":", "if", "'key'", "in", "cfg", ".", "Session", "or", "'keyfile'", "in", "cfg", ".", "Session", ":", "return", "# key/keyfile not specified, generate new UUID:", "cfg", ".", "Sessi...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
extract_header
Given a message or header, return the header.
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def extract_header(msg_or_header): """Given a message or header, return the header.""" if not msg_or_header: return {} try: # See if msg_or_header is the entire message. h = msg_or_header['header'] except KeyError: try: # See if msg_or_header is just the heade...
def extract_header(msg_or_header): """Given a message or header, return the header.""" if not msg_or_header: return {} try: # See if msg_or_header is the entire message. h = msg_or_header['header'] except KeyError: try: # See if msg_or_header is just the heade...
[ "Given", "a", "message", "or", "header", "return", "the", "header", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L190-L207
[ "def", "extract_header", "(", "msg_or_header", ")", ":", "if", "not", "msg_or_header", ":", "return", "{", "}", "try", ":", "# See if msg_or_header is the entire message.", "h", "=", "msg_or_header", "[", "'header'", "]", "except", "KeyError", ":", "try", ":", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session._check_packers
check packers for binary data and datetime support.
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def _check_packers(self): """check packers for binary data and datetime support.""" pack = self.pack unpack = self.unpack # check simple serialization msg = dict(a=[1,'hi']) try: packed = pack(msg) except Exception: raise ValueError("packe...
def _check_packers(self): """check packers for binary data and datetime support.""" pack = self.pack unpack = self.unpack # check simple serialization msg = dict(a=[1,'hi']) try: packed = pack(msg) except Exception: raise ValueError("packe...
[ "check", "packers", "for", "binary", "data", "and", "datetime", "support", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L372-L400
[ "def", "_check_packers", "(", "self", ")", ":", "pack", "=", "self", ".", "pack", "unpack", "=", "self", ".", "unpack", "# check simple serialization", "msg", "=", "dict", "(", "a", "=", "[", "1", ",", "'hi'", "]", ")", "try", ":", "packed", "=", "pa...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.msg
Return the nested message dict. This format is different from what is sent over the wire. The serialize/unserialize methods converts this nested message dict to the wire format, which is a list of message parts.
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def msg(self, msg_type, content=None, parent=None, subheader=None, header=None): """Return the nested message dict. This format is different from what is sent over the wire. The serialize/unserialize methods converts this nested message dict to the wire format, which is a list of messag...
def msg(self, msg_type, content=None, parent=None, subheader=None, header=None): """Return the nested message dict. This format is different from what is sent over the wire. The serialize/unserialize methods converts this nested message dict to the wire format, which is a list of messag...
[ "Return", "the", "nested", "message", "dict", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L405-L421
[ "def", "msg", "(", "self", ",", "msg_type", ",", "content", "=", "None", ",", "parent", "=", "None", ",", "subheader", "=", "None", ",", "header", "=", "None", ")", ":", "msg", "=", "{", "}", "header", "=", "self", ".", "msg_header", "(", "msg_type...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.sign
Sign a message with HMAC digest. If no auth, return b''. Parameters ---------- msg_list : list The [p_header,p_parent,p_content] part of the message list.
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def sign(self, msg_list): """Sign a message with HMAC digest. If no auth, return b''. Parameters ---------- msg_list : list The [p_header,p_parent,p_content] part of the message list. """ if self.auth is None: return b'' h = self.auth.copy...
def sign(self, msg_list): """Sign a message with HMAC digest. If no auth, return b''. Parameters ---------- msg_list : list The [p_header,p_parent,p_content] part of the message list. """ if self.auth is None: return b'' h = self.auth.copy...
[ "Sign", "a", "message", "with", "HMAC", "digest", ".", "If", "no", "auth", "return", "b", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L423-L436
[ "def", "sign", "(", "self", ",", "msg_list", ")", ":", "if", "self", ".", "auth", "is", "None", ":", "return", "b''", "h", "=", "self", ".", "auth", ".", "copy", "(", ")", "for", "m", "in", "msg_list", ":", "h", ".", "update", "(", "m", ")", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.serialize
Serialize the message components to bytes. This is roughly the inverse of unserialize. The serialize/unserialize methods work with full message lists, whereas pack/unpack work with the individual message parts in the message list. Parameters ---------- msg : dict or Mes...
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def serialize(self, msg, ident=None): """Serialize the message components to bytes. This is roughly the inverse of unserialize. The serialize/unserialize methods work with full message lists, whereas pack/unpack work with the individual message parts in the message list. Parame...
def serialize(self, msg, ident=None): """Serialize the message components to bytes. This is roughly the inverse of unserialize. The serialize/unserialize methods work with full message lists, whereas pack/unpack work with the individual message parts in the message list. Parame...
[ "Serialize", "the", "message", "components", "to", "bytes", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L438-L492
[ "def", "serialize", "(", "self", ",", "msg", ",", "ident", "=", "None", ")", ":", "content", "=", "msg", ".", "get", "(", "'content'", ",", "{", "}", ")", "if", "content", "is", "None", ":", "content", "=", "self", ".", "none", "elif", "isinstance"...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.send
Build and send a message via stream or socket. The message format used by this function internally is as follows: [ident1,ident2,...,DELIM,HMAC,p_header,p_parent,p_content, buffer1,buffer2,...] The serialize/unserialize methods convert the nested message dict into this format...
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def send(self, stream, msg_or_type, content=None, parent=None, ident=None, buffers=None, subheader=None, track=False, header=None): """Build and send a message via stream or socket. The message format used by this function internally is as follows: [ident1,ident2,...,DELIM,HMAC,p_...
def send(self, stream, msg_or_type, content=None, parent=None, ident=None, buffers=None, subheader=None, track=False, header=None): """Build and send a message via stream or socket. The message format used by this function internally is as follows: [ident1,ident2,...,DELIM,HMAC,p_...
[ "Build", "and", "send", "a", "message", "via", "stream", "or", "socket", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L494-L586
[ "def", "send", "(", "self", ",", "stream", ",", "msg_or_type", ",", "content", "=", "None", ",", "parent", "=", "None", ",", "ident", "=", "None", ",", "buffers", "=", "None", ",", "subheader", "=", "None", ",", "track", "=", "False", ",", "header", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.send_raw
Send a raw message via ident path. This method is used to send a already serialized message. Parameters ---------- stream : ZMQStream or Socket The ZMQ stream or socket to use for sending the message. msg_list : list The serialized list of messages to se...
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def send_raw(self, stream, msg_list, flags=0, copy=True, ident=None): """Send a raw message via ident path. This method is used to send a already serialized message. Parameters ---------- stream : ZMQStream or Socket The ZMQ stream or socket to use for sending the m...
def send_raw(self, stream, msg_list, flags=0, copy=True, ident=None): """Send a raw message via ident path. This method is used to send a already serialized message. Parameters ---------- stream : ZMQStream or Socket The ZMQ stream or socket to use for sending the m...
[ "Send", "a", "raw", "message", "via", "ident", "path", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L588-L613
[ "def", "send_raw", "(", "self", ",", "stream", ",", "msg_list", ",", "flags", "=", "0", ",", "copy", "=", "True", ",", "ident", "=", "None", ")", ":", "to_send", "=", "[", "]", "if", "isinstance", "(", "ident", ",", "bytes", ")", ":", "ident", "=...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.recv
Receive and unpack a message. Parameters ---------- socket : ZMQStream or Socket The socket or stream to use in receiving. Returns ------- [idents], msg [idents] is a list of idents and msg is a nested message dict of same format as s...
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def recv(self, socket, mode=zmq.NOBLOCK, content=True, copy=True): """Receive and unpack a message. Parameters ---------- socket : ZMQStream or Socket The socket or stream to use in receiving. Returns ------- [idents], msg [idents] is a l...
def recv(self, socket, mode=zmq.NOBLOCK, content=True, copy=True): """Receive and unpack a message. Parameters ---------- socket : ZMQStream or Socket The socket or stream to use in receiving. Returns ------- [idents], msg [idents] is a l...
[ "Receive", "and", "unpack", "a", "message", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L615-L647
[ "def", "recv", "(", "self", ",", "socket", ",", "mode", "=", "zmq", ".", "NOBLOCK", ",", "content", "=", "True", ",", "copy", "=", "True", ")", ":", "if", "isinstance", "(", "socket", ",", "ZMQStream", ")", ":", "socket", "=", "socket", ".", "socke...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.feed_identities
Split the identities from the rest of the message. Feed until DELIM is reached, then return the prefix as idents and remainder as msg_list. This is easily broken by setting an IDENT to DELIM, but that would be silly. Parameters ---------- msg_list : a list of Message or...
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def feed_identities(self, msg_list, copy=True): """Split the identities from the rest of the message. Feed until DELIM is reached, then return the prefix as idents and remainder as msg_list. This is easily broken by setting an IDENT to DELIM, but that would be silly. Parameters...
def feed_identities(self, msg_list, copy=True): """Split the identities from the rest of the message. Feed until DELIM is reached, then return the prefix as idents and remainder as msg_list. This is easily broken by setting an IDENT to DELIM, but that would be silly. Parameters...
[ "Split", "the", "identities", "from", "the", "rest", "of", "the", "message", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L649-L684
[ "def", "feed_identities", "(", "self", ",", "msg_list", ",", "copy", "=", "True", ")", ":", "if", "copy", ":", "idx", "=", "msg_list", ".", "index", "(", "DELIM", ")", "return", "msg_list", "[", ":", "idx", "]", ",", "msg_list", "[", "idx", "+", "1...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Session.unserialize
Unserialize a msg_list to a nested message dict. This is roughly the inverse of serialize. The serialize/unserialize methods work with full message lists, whereas pack/unpack work with the individual message parts in the message list. Parameters: ----------- msg_list : ...
environment/lib/python2.7/site-packages/IPython/zmq/session.py
def unserialize(self, msg_list, content=True, copy=True): """Unserialize a msg_list to a nested message dict. This is roughly the inverse of serialize. The serialize/unserialize methods work with full message lists, whereas pack/unpack work with the individual message parts in the messa...
def unserialize(self, msg_list, content=True, copy=True): """Unserialize a msg_list to a nested message dict. This is roughly the inverse of serialize. The serialize/unserialize methods work with full message lists, whereas pack/unpack work with the individual message parts in the messa...
[ "Unserialize", "a", "msg_list", "to", "a", "nested", "message", "dict", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/zmq/session.py#L686-L739
[ "def", "unserialize", "(", "self", ",", "msg_list", ",", "content", "=", "True", ",", "copy", "=", "True", ")", ":", "minlen", "=", "4", "message", "=", "{", "}", "if", "not", "copy", ":", "for", "i", "in", "range", "(", "minlen", ")", ":", "msg_...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
save_svg
Prompts the user to save an SVG document to disk. Parameters: ----------- string : basestring A Python string containing a SVG document. parent : QWidget, optional The parent to use for the file dialog. Returns: -------- The name of the file to which the document was saved...
environment/lib/python2.7/site-packages/IPython/frontend/qt/svg.py
def save_svg(string, parent=None): """ Prompts the user to save an SVG document to disk. Parameters: ----------- string : basestring A Python string containing a SVG document. parent : QWidget, optional The parent to use for the file dialog. Returns: -------- The name ...
def save_svg(string, parent=None): """ Prompts the user to save an SVG document to disk. Parameters: ----------- string : basestring A Python string containing a SVG document. parent : QWidget, optional The parent to use for the file dialog. Returns: -------- The name ...
[ "Prompts", "the", "user", "to", "save", "an", "SVG", "document", "to", "disk", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/svg.py#L8-L39
[ "def", "save_svg", "(", "string", ",", "parent", "=", "None", ")", ":", "if", "isinstance", "(", "string", ",", "unicode", ")", ":", "string", "=", "string", ".", "encode", "(", "'utf-8'", ")", "dialog", "=", "QtGui", ".", "QFileDialog", "(", "parent",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
svg_to_clipboard
Copy a SVG document to the clipboard. Parameters: ----------- string : basestring A Python string containing a SVG document.
environment/lib/python2.7/site-packages/IPython/frontend/qt/svg.py
def svg_to_clipboard(string): """ Copy a SVG document to the clipboard. Parameters: ----------- string : basestring A Python string containing a SVG document. """ if isinstance(string, unicode): string = string.encode('utf-8') mime_data = QtCore.QMimeData() mime_data.se...
def svg_to_clipboard(string): """ Copy a SVG document to the clipboard. Parameters: ----------- string : basestring A Python string containing a SVG document. """ if isinstance(string, unicode): string = string.encode('utf-8') mime_data = QtCore.QMimeData() mime_data.se...
[ "Copy", "a", "SVG", "document", "to", "the", "clipboard", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/svg.py#L41-L54
[ "def", "svg_to_clipboard", "(", "string", ")", ":", "if", "isinstance", "(", "string", ",", "unicode", ")", ":", "string", "=", "string", ".", "encode", "(", "'utf-8'", ")", "mime_data", "=", "QtCore", ".", "QMimeData", "(", ")", "mime_data", ".", "setDa...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
svg_to_image
Convert a SVG document to a QImage. Parameters: ----------- string : basestring A Python string containing a SVG document. size : QSize, optional The size of the image that is produced. If not specified, the SVG document's default size is used. Raises: ------- ...
environment/lib/python2.7/site-packages/IPython/frontend/qt/svg.py
def svg_to_image(string, size=None): """ Convert a SVG document to a QImage. Parameters: ----------- string : basestring A Python string containing a SVG document. size : QSize, optional The size of the image that is produced. If not specified, the SVG document's default si...
def svg_to_image(string, size=None): """ Convert a SVG document to a QImage. Parameters: ----------- string : basestring A Python string containing a SVG document. size : QSize, optional The size of the image that is produced. If not specified, the SVG document's default si...
[ "Convert", "a", "SVG", "document", "to", "a", "QImage", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/frontend/qt/svg.py#L56-L89
[ "def", "svg_to_image", "(", "string", ",", "size", "=", "None", ")", ":", "if", "isinstance", "(", "string", ",", "unicode", ")", ":", "string", "=", "string", ".", "encode", "(", "'utf-8'", ")", "renderer", "=", "QtSvg", ".", "QSvgRenderer", "(", "QtC...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
object_info
Make an object info dict with all fields present.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def object_info(**kw): """Make an object info dict with all fields present.""" infodict = dict(izip_longest(info_fields, [None])) infodict.update(kw) return infodict
def object_info(**kw): """Make an object info dict with all fields present.""" infodict = dict(izip_longest(info_fields, [None])) infodict.update(kw) return infodict
[ "Make", "an", "object", "info", "dict", "with", "all", "fields", "present", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L85-L89
[ "def", "object_info", "(", "*", "*", "kw", ")", ":", "infodict", "=", "dict", "(", "izip_longest", "(", "info_fields", ",", "[", "None", "]", ")", ")", "infodict", ".", "update", "(", "kw", ")", "return", "infodict" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
getdoc
Stable wrapper around inspect.getdoc. This can't crash because of attribute problems. It also attempts to call a getdoc() method on the given object. This allows objects which provide their docstrings via non-standard mechanisms (like Pyro proxies) to still be inspected by ipython's ? system.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def getdoc(obj): """Stable wrapper around inspect.getdoc. This can't crash because of attribute problems. It also attempts to call a getdoc() method on the given object. This allows objects which provide their docstrings via non-standard mechanisms (like Pyro proxies) to still be inspected by ipy...
def getdoc(obj): """Stable wrapper around inspect.getdoc. This can't crash because of attribute problems. It also attempts to call a getdoc() method on the given object. This allows objects which provide their docstrings via non-standard mechanisms (like Pyro proxies) to still be inspected by ipy...
[ "Stable", "wrapper", "around", "inspect", ".", "getdoc", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L92-L115
[ "def", "getdoc", "(", "obj", ")", ":", "# Allow objects to offer customized documentation via a getdoc method:", "try", ":", "ds", "=", "obj", ".", "getdoc", "(", ")", "except", "Exception", ":", "pass", "else", ":", "# if we get extra info, we add it to the normal docstr...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
getsource
Wrapper around inspect.getsource. This can be modified by other projects to provide customized source extraction. Inputs: - obj: an object whose source code we will attempt to extract. Optional inputs: - is_binary: whether the object is known to come from a binary source. This implement...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def getsource(obj,is_binary=False): """Wrapper around inspect.getsource. This can be modified by other projects to provide customized source extraction. Inputs: - obj: an object whose source code we will attempt to extract. Optional inputs: - is_binary: whether the object is known to co...
def getsource(obj,is_binary=False): """Wrapper around inspect.getsource. This can be modified by other projects to provide customized source extraction. Inputs: - obj: an object whose source code we will attempt to extract. Optional inputs: - is_binary: whether the object is known to co...
[ "Wrapper", "around", "inspect", ".", "getsource", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L118-L145
[ "def", "getsource", "(", "obj", ",", "is_binary", "=", "False", ")", ":", "if", "is_binary", ":", "return", "None", "else", ":", "# get source if obj was decorated with @decorator", "if", "hasattr", "(", "obj", ",", "\"__wrapped__\"", ")", ":", "obj", "=", "ob...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
getargspec
Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'defaults' is an n-tuple of the ...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def getargspec(obj): """Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'def...
def getargspec(obj): """Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'def...
[ "Get", "the", "names", "and", "default", "values", "of", "a", "function", "s", "arguments", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L147-L167
[ "def", "getargspec", "(", "obj", ")", ":", "if", "inspect", ".", "isfunction", "(", "obj", ")", ":", "func_obj", "=", "obj", "elif", "inspect", ".", "ismethod", "(", "obj", ")", ":", "func_obj", "=", "obj", ".", "im_func", "elif", "hasattr", "(", "ob...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
call_tip
Extract call tip data from an oinfo dict. Parameters ---------- oinfo : dict format_call : bool, optional If True, the call line is formatted and returned as a string. If not, a tuple of (name, argspec) is returned. Returns ------- call_info : None, str or (str, dict) tuple. ...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def call_tip(oinfo, format_call=True): """Extract call tip data from an oinfo dict. Parameters ---------- oinfo : dict format_call : bool, optional If True, the call line is formatted and returned as a string. If not, a tuple of (name, argspec) is returned. Returns ------- ...
def call_tip(oinfo, format_call=True): """Extract call tip data from an oinfo dict. Parameters ---------- oinfo : dict format_call : bool, optional If True, the call line is formatted and returned as a string. If not, a tuple of (name, argspec) is returned. Returns ------- ...
[ "Extract", "call", "tip", "data", "from", "an", "oinfo", "dict", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L180-L230
[ "def", "call_tip", "(", "oinfo", ",", "format_call", "=", "True", ")", ":", "# Get call definition", "argspec", "=", "oinfo", ".", "get", "(", "'argspec'", ")", "if", "argspec", "is", "None", ":", "call_line", "=", "None", "else", ":", "# Callable objects wi...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
find_file
Find the absolute path to the file where an object was defined. This is essentially a robust wrapper around `inspect.getabsfile`. Returns None if no file can be found. Parameters ---------- obj : any Python object Returns ------- fname : str The absolute path to the file where ...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def find_file(obj): """Find the absolute path to the file where an object was defined. This is essentially a robust wrapper around `inspect.getabsfile`. Returns None if no file can be found. Parameters ---------- obj : any Python object Returns ------- fname : str The absol...
def find_file(obj): """Find the absolute path to the file where an object was defined. This is essentially a robust wrapper around `inspect.getabsfile`. Returns None if no file can be found. Parameters ---------- obj : any Python object Returns ------- fname : str The absol...
[ "Find", "the", "absolute", "path", "to", "the", "file", "where", "an", "object", "was", "defined", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L233-L267
[ "def", "find_file", "(", "obj", ")", ":", "# get source if obj was decorated with @decorator", "if", "hasattr", "(", "obj", ",", "'__wrapped__'", ")", ":", "obj", "=", "obj", ".", "__wrapped__", "fname", "=", "None", "try", ":", "fname", "=", "inspect", ".", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
find_source_lines
Find the line number in a file where an object was defined. This is essentially a robust wrapper around `inspect.getsourcelines`. Returns None if no file can be found. Parameters ---------- obj : any Python object Returns ------- lineno : int The line number where the object de...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def find_source_lines(obj): """Find the line number in a file where an object was defined. This is essentially a robust wrapper around `inspect.getsourcelines`. Returns None if no file can be found. Parameters ---------- obj : any Python object Returns ------- lineno : int ...
def find_source_lines(obj): """Find the line number in a file where an object was defined. This is essentially a robust wrapper around `inspect.getsourcelines`. Returns None if no file can be found. Parameters ---------- obj : any Python object Returns ------- lineno : int ...
[ "Find", "the", "line", "number", "in", "a", "file", "where", "an", "object", "was", "defined", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L270-L300
[ "def", "find_source_lines", "(", "obj", ")", ":", "# get source if obj was decorated with @decorator", "if", "hasattr", "(", "obj", ",", "'__wrapped__'", ")", ":", "obj", "=", "obj", ".", "__wrapped__", "try", ":", "try", ":", "lineno", "=", "inspect", ".", "g...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector._getdef
Return the definition header for any callable object. If any exception is generated, None is returned instead and the exception is suppressed.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def _getdef(self,obj,oname=''): """Return the definition header for any callable object. If any exception is generated, None is returned instead and the exception is suppressed.""" try: # We need a plain string here, NOT unicode! hdef = oname + inspect.formatarg...
def _getdef(self,obj,oname=''): """Return the definition header for any callable object. If any exception is generated, None is returned instead and the exception is suppressed.""" try: # We need a plain string here, NOT unicode! hdef = oname + inspect.formatarg...
[ "Return", "the", "definition", "header", "for", "any", "callable", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L314-L325
[ "def", "_getdef", "(", "self", ",", "obj", ",", "oname", "=", "''", ")", ":", "try", ":", "# We need a plain string here, NOT unicode!", "hdef", "=", "oname", "+", "inspect", ".", "formatargspec", "(", "*", "getargspec", "(", "obj", ")", ")", "return", "py...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.__head
Return a header string with proper colors.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def __head(self,h): """Return a header string with proper colors.""" return '%s%s%s' % (self.color_table.active_colors.header,h, self.color_table.active_colors.normal)
def __head(self,h): """Return a header string with proper colors.""" return '%s%s%s' % (self.color_table.active_colors.header,h, self.color_table.active_colors.normal)
[ "Return", "a", "header", "string", "with", "proper", "colors", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L327-L330
[ "def", "__head", "(", "self", ",", "h", ")", ":", "return", "'%s%s%s'", "%", "(", "self", ".", "color_table", ".", "active_colors", ".", "header", ",", "h", ",", "self", ".", "color_table", ".", "active_colors", ".", "normal", ")" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.noinfo
Generic message when no information is found.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def noinfo(self, msg, oname): """Generic message when no information is found.""" print 'No %s found' % msg, if oname: print 'for %s' % oname else: print
def noinfo(self, msg, oname): """Generic message when no information is found.""" print 'No %s found' % msg, if oname: print 'for %s' % oname else: print
[ "Generic", "message", "when", "no", "information", "is", "found", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L336-L342
[ "def", "noinfo", "(", "self", ",", "msg", ",", "oname", ")", ":", "print", "'No %s found'", "%", "msg", ",", "if", "oname", ":", "print", "'for %s'", "%", "oname", "else", ":", "print" ]
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.pdef
Print the definition header for any callable object. If the object is a class, print the constructor information.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def pdef(self, obj, oname=''): """Print the definition header for any callable object. If the object is a class, print the constructor information.""" if not callable(obj): print 'Object is not callable.' return header = '' if inspect.isclass(obj): ...
def pdef(self, obj, oname=''): """Print the definition header for any callable object. If the object is a class, print the constructor information.""" if not callable(obj): print 'Object is not callable.' return header = '' if inspect.isclass(obj): ...
[ "Print", "the", "definition", "header", "for", "any", "callable", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L344-L365
[ "def", "pdef", "(", "self", ",", "obj", ",", "oname", "=", "''", ")", ":", "if", "not", "callable", "(", "obj", ")", ":", "print", "'Object is not callable.'", "return", "header", "=", "''", "if", "inspect", ".", "isclass", "(", "obj", ")", ":", "hea...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.pdoc
Print the docstring for any object. Optional: -formatter: a function to run the docstring through for specially formatted docstrings. Examples -------- In [1]: class NoInit: ...: pass In [2]: class NoDoc: ...: def __init__(self): ...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def pdoc(self,obj,oname='',formatter = None): """Print the docstring for any object. Optional: -formatter: a function to run the docstring through for specially formatted docstrings. Examples -------- In [1]: class NoInit: ...: pass In [...
def pdoc(self,obj,oname='',formatter = None): """Print the docstring for any object. Optional: -formatter: a function to run the docstring through for specially formatted docstrings. Examples -------- In [1]: class NoInit: ...: pass In [...
[ "Print", "the", "docstring", "for", "any", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L369-L425
[ "def", "pdoc", "(", "self", ",", "obj", ",", "oname", "=", "''", ",", "formatter", "=", "None", ")", ":", "head", "=", "self", ".", "__head", "# For convenience", "lines", "=", "[", "]", "ds", "=", "getdoc", "(", "obj", ")", "if", "formatter", ":",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.psource
Print the source code for an object.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def psource(self,obj,oname=''): """Print the source code for an object.""" # Flush the source cache because inspect can return out-of-date source linecache.checkcache() try: src = getsource(obj) except: self.noinfo('source',oname) else: ...
def psource(self,obj,oname=''): """Print the source code for an object.""" # Flush the source cache because inspect can return out-of-date source linecache.checkcache() try: src = getsource(obj) except: self.noinfo('source',oname) else: ...
[ "Print", "the", "source", "code", "for", "an", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L427-L437
[ "def", "psource", "(", "self", ",", "obj", ",", "oname", "=", "''", ")", ":", "# Flush the source cache because inspect can return out-of-date source", "linecache", ".", "checkcache", "(", ")", "try", ":", "src", "=", "getsource", "(", "obj", ")", "except", ":",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.pfile
Show the whole file where an object was defined.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def pfile(self, obj, oname=''): """Show the whole file where an object was defined.""" lineno = find_source_lines(obj) if lineno is None: self.noinfo('file', oname) return ofile = find_file(obj) # run contents of file through pager starting at li...
def pfile(self, obj, oname=''): """Show the whole file where an object was defined.""" lineno = find_source_lines(obj) if lineno is None: self.noinfo('file', oname) return ofile = find_file(obj) # run contents of file through pager starting at li...
[ "Show", "the", "whole", "file", "where", "an", "object", "was", "defined", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L439-L459
[ "def", "pfile", "(", "self", ",", "obj", ",", "oname", "=", "''", ")", ":", "lineno", "=", "find_source_lines", "(", "obj", ")", "if", "lineno", "is", "None", ":", "self", ".", "noinfo", "(", "'file'", ",", "oname", ")", "return", "ofile", "=", "fi...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector._format_fields
Formats a list of fields for display. Parameters ---------- fields : list A list of 2-tuples: (field_title, field_content) title_width : int How many characters to pad titles to. Default 12.
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def _format_fields(self, fields, title_width=12): """Formats a list of fields for display. Parameters ---------- fields : list A list of 2-tuples: (field_title, field_content) title_width : int How many characters to pad titles to. Default 12. """ ...
def _format_fields(self, fields, title_width=12): """Formats a list of fields for display. Parameters ---------- fields : list A list of 2-tuples: (field_title, field_content) title_width : int How many characters to pad titles to. Default 12. """ ...
[ "Formats", "a", "list", "of", "fields", "for", "display", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L461-L479
[ "def", "_format_fields", "(", "self", ",", "fields", ",", "title_width", "=", "12", ")", ":", "out", "=", "[", "]", "header", "=", "self", ".", "__head", "for", "title", ",", "content", "in", "fields", ":", "if", "len", "(", "content", ".", "splitlin...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.pinfo
Show detailed information about an object. Optional arguments: - oname: name of the variable pointing to the object. - formatter: special formatter for docstrings (see pdoc) - info: a structure with some information fields which may have been precomputed already. - d...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def pinfo(self,obj,oname='',formatter=None,info=None,detail_level=0): """Show detailed information about an object. Optional arguments: - oname: name of the variable pointing to the object. - formatter: special formatter for docstrings (see pdoc) - info: a structure with some...
def pinfo(self,obj,oname='',formatter=None,info=None,detail_level=0): """Show detailed information about an object. Optional arguments: - oname: name of the variable pointing to the object. - formatter: special formatter for docstrings (see pdoc) - info: a structure with some...
[ "Show", "detailed", "information", "about", "an", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L498-L559
[ "def", "pinfo", "(", "self", ",", "obj", ",", "oname", "=", "''", ",", "formatter", "=", "None", ",", "info", "=", "None", ",", "detail_level", "=", "0", ")", ":", "info", "=", "self", ".", "info", "(", "obj", ",", "oname", "=", "oname", ",", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.info
Compute a dict with detailed information about an object. Optional arguments: - oname: name of the variable pointing to the object. - formatter: special formatter for docstrings (see pdoc) - info: a structure with some information fields which may have been precomputed alread...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def info(self, obj, oname='', formatter=None, info=None, detail_level=0): """Compute a dict with detailed information about an object. Optional arguments: - oname: name of the variable pointing to the object. - formatter: special formatter for docstrings (see pdoc) - info: a ...
def info(self, obj, oname='', formatter=None, info=None, detail_level=0): """Compute a dict with detailed information about an object. Optional arguments: - oname: name of the variable pointing to the object. - formatter: special formatter for docstrings (see pdoc) - info: a ...
[ "Compute", "a", "dict", "with", "detailed", "information", "about", "an", "object", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L561-L781
[ "def", "info", "(", "self", ",", "obj", ",", "oname", "=", "''", ",", "formatter", "=", "None", ",", "info", "=", "None", ",", "detail_level", "=", "0", ")", ":", "obj_type", "=", "type", "(", "obj", ")", "header", "=", "self", ".", "__head", "if...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Inspector.psearch
Search namespaces with wildcards for objects. Arguments: - pattern: string containing shell-like wildcards to use in namespace searches and optionally a type specification to narrow the search to objects of that type. - ns_table: dict of name->namespaces for search. O...
environment/lib/python2.7/site-packages/IPython/core/oinspect.py
def psearch(self,pattern,ns_table,ns_search=[], ignore_case=False,show_all=False): """Search namespaces with wildcards for objects. Arguments: - pattern: string containing shell-like wildcards to use in namespace searches and optionally a type specification to narrow th...
def psearch(self,pattern,ns_table,ns_search=[], ignore_case=False,show_all=False): """Search namespaces with wildcards for objects. Arguments: - pattern: string containing shell-like wildcards to use in namespace searches and optionally a type specification to narrow th...
[ "Search", "namespaces", "with", "wildcards", "for", "objects", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/oinspect.py#L784-L841
[ "def", "psearch", "(", "self", ",", "pattern", ",", "ns_table", ",", "ns_search", "=", "[", "]", ",", "ignore_case", "=", "False", ",", "show_all", "=", "False", ")", ":", "#print 'ps pattern:<%r>' % pattern # dbg", "# defaults", "type_pattern", "=", "'all'", ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
threaded_reactor
Start the Twisted reactor in a separate thread, if not already done. Returns the reactor. The thread will automatically be destroyed when all the tests are done.
environment/lib/python2.7/site-packages/nose/twistedtools.py
def threaded_reactor(): """ Start the Twisted reactor in a separate thread, if not already done. Returns the reactor. The thread will automatically be destroyed when all the tests are done. """ global _twisted_thread try: from twisted.internet import reactor except ImportError: ...
def threaded_reactor(): """ Start the Twisted reactor in a separate thread, if not already done. Returns the reactor. The thread will automatically be destroyed when all the tests are done. """ global _twisted_thread try: from twisted.internet import reactor except ImportError: ...
[ "Start", "the", "Twisted", "reactor", "in", "a", "separate", "thread", "if", "not", "already", "done", ".", "Returns", "the", "reactor", ".", "The", "thread", "will", "automatically", "be", "destroyed", "when", "all", "the", "tests", "are", "done", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/twistedtools.py#L42-L60
[ "def", "threaded_reactor", "(", ")", ":", "global", "_twisted_thread", "try", ":", "from", "twisted", ".", "internet", "import", "reactor", "except", "ImportError", ":", "return", "None", ",", "None", "if", "not", "_twisted_thread", ":", "from", "twisted", "."...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
stop_reactor
Stop the reactor and join the reactor thread until it stops. Call this function in teardown at the module or package level to reset the twisted system after your tests. You *must* do this if you mix tests using these tools and tests using twisted.trial.
environment/lib/python2.7/site-packages/nose/twistedtools.py
def stop_reactor(): """Stop the reactor and join the reactor thread until it stops. Call this function in teardown at the module or package level to reset the twisted system after your tests. You *must* do this if you mix tests using these tools and tests using twisted.trial. """ global _twisted...
def stop_reactor(): """Stop the reactor and join the reactor thread until it stops. Call this function in teardown at the module or package level to reset the twisted system after your tests. You *must* do this if you mix tests using these tools and tests using twisted.trial. """ global _twisted...
[ "Stop", "the", "reactor", "and", "join", "the", "reactor", "thread", "until", "it", "stops", ".", "Call", "this", "function", "in", "teardown", "at", "the", "module", "or", "package", "level", "to", "reset", "the", "twisted", "system", "after", "your", "te...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/twistedtools.py#L66-L83
[ "def", "stop_reactor", "(", ")", ":", "global", "_twisted_thread", "def", "stop_reactor", "(", ")", ":", "'''Helper for calling stop from withing the thread.'''", "reactor", ".", "stop", "(", ")", "reactor", ".", "callFromThread", "(", "stop_reactor", ")", "reactor_th...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
deferred
By wrapping a test function with this decorator, you can return a twisted Deferred and the test will wait for the deferred to be triggered. The whole test function will run inside the Twisted event loop. The optional timeout parameter specifies the maximum duration of the test. The difference with time...
environment/lib/python2.7/site-packages/nose/twistedtools.py
def deferred(timeout=None): """ By wrapping a test function with this decorator, you can return a twisted Deferred and the test will wait for the deferred to be triggered. The whole test function will run inside the Twisted event loop. The optional timeout parameter specifies the maximum duration o...
def deferred(timeout=None): """ By wrapping a test function with this decorator, you can return a twisted Deferred and the test will wait for the deferred to be triggered. The whole test function will run inside the Twisted event loop. The optional timeout parameter specifies the maximum duration o...
[ "By", "wrapping", "a", "test", "function", "with", "this", "decorator", "you", "can", "return", "a", "twisted", "Deferred", "and", "the", "test", "will", "wait", "for", "the", "deferred", "to", "be", "triggered", ".", "The", "whole", "test", "function", "w...
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/nose/twistedtools.py#L86-L172
[ "def", "deferred", "(", "timeout", "=", "None", ")", ":", "reactor", ",", "reactor_thread", "=", "threaded_reactor", "(", ")", "if", "reactor", "is", "None", ":", "raise", "ImportError", "(", "\"twisted is not available or could not be imported\"", ")", "# Check for...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
find_best_string
Return best matching substring of corpus. Parameters ---------- query : str corpus : str step : int Step size of first match-value scan through corpus. Can be thought of as a sort of "scan resolution". Should not exceed length of query. flex : int Max. left/right substri...
src/find_best_string/main.py
def find_best_string(query, corpus, step=4, flex=3, case_sensitive=False): """Return best matching substring of corpus. Parameters ---------- query : str corpus : str step : int Step size of first match-...
def find_best_string(query, corpus, step=4, flex=3, case_sensitive=False): """Return best matching substring of corpus. Parameters ---------- query : str corpus : str step : int Step size of first match-...
[ "Return", "best", "matching", "substring", "of", "corpus", "." ]
alexseitsinger/find_best_string
python
https://github.com/alexseitsinger/find_best_string/blob/833499113d9c560c91fe4761921a4d5717939ae7/src/find_best_string/main.py#L8-L101
[ "def", "find_best_string", "(", "query", ",", "corpus", ",", "step", "=", "4", ",", "flex", "=", "3", ",", "case_sensitive", "=", "False", ")", ":", "def", "ratio", "(", "a", ",", "b", ")", ":", "\"\"\"Compact alias for SequenceMatcher.\"\"\"", "return", "...
833499113d9c560c91fe4761921a4d5717939ae7
test
_singleton_method
Return a function to the `name` method on a singleton `coverage` object. The singleton object is created the first time one of these functions is called.
virtualEnvironment/lib/python2.7/site-packages/coverage/__init__.py
def _singleton_method(name): """Return a function to the `name` method on a singleton `coverage` object. The singleton object is created the first time one of these functions is called. """ # Disable pylint msg W0612, because a bunch of variables look unused, but # they're accessed via locals(...
def _singleton_method(name): """Return a function to the `name` method on a singleton `coverage` object. The singleton object is created the first time one of these functions is called. """ # Disable pylint msg W0612, because a bunch of variables look unused, but # they're accessed via locals(...
[ "Return", "a", "function", "to", "the", "name", "method", "on", "a", "singleton", "coverage", "object", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/__init__.py#L26-L61
[ "def", "_singleton_method", "(", "name", ")", ":", "# Disable pylint msg W0612, because a bunch of variables look unused, but", "# they're accessed via locals().", "# pylint: disable=W0612", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Singlet...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
XMLEncoder.to_string
Encodes the stored ``data`` to XML and returns a ``string``. Setting ``indent`` to ``False`` will forego any pretty-printing and return a condensed value. Setting ``declaration`` to ``False`` will skip inserting the XML declaration.
exemelopy/__init__.py
def to_string(self, indent=True, declaration=True): """Encodes the stored ``data`` to XML and returns a ``string``. Setting ``indent`` to ``False`` will forego any pretty-printing and return a condensed value. Setting ``declaration`` to ``False`` will skip inserting the ...
def to_string(self, indent=True, declaration=True): """Encodes the stored ``data`` to XML and returns a ``string``. Setting ``indent`` to ``False`` will forego any pretty-printing and return a condensed value. Setting ``declaration`` to ``False`` will skip inserting the ...
[ "Encodes", "the", "stored", "data", "to", "XML", "and", "returns", "a", "string", "." ]
OldhamMade/exemelopy
python
https://github.com/OldhamMade/exemelopy/blob/5f5141b169e61a5b6912146a995917f5d862ee9c/exemelopy/__init__.py#L52-L66
[ "def", "to_string", "(", "self", ",", "indent", "=", "True", ",", "declaration", "=", "True", ")", ":", "return", "etree", ".", "tostring", "(", "self", ".", "to_xml", "(", ")", ",", "encoding", "=", "self", ".", "encoding", ",", "xml_declaration", "="...
5f5141b169e61a5b6912146a995917f5d862ee9c
test
XMLEncoder.to_xml
Encodes the stored ``data`` to XML and returns an ``lxml.etree`` value.
exemelopy/__init__.py
def to_xml(self): """Encodes the stored ``data`` to XML and returns an ``lxml.etree`` value. """ if self.data: self.document = self._update_document(self.document, self.data) return self.document
def to_xml(self): """Encodes the stored ``data`` to XML and returns an ``lxml.etree`` value. """ if self.data: self.document = self._update_document(self.document, self.data) return self.document
[ "Encodes", "the", "stored", "data", "to", "XML", "and", "returns", "an", "lxml", ".", "etree", "value", "." ]
OldhamMade/exemelopy
python
https://github.com/OldhamMade/exemelopy/blob/5f5141b169e61a5b6912146a995917f5d862ee9c/exemelopy/__init__.py#L68-L75
[ "def", "to_xml", "(", "self", ")", ":", "if", "self", ".", "data", ":", "self", ".", "document", "=", "self", ".", "_update_document", "(", "self", ".", "document", ",", "self", ".", "data", ")", "return", "self", ".", "document" ]
5f5141b169e61a5b6912146a995917f5d862ee9c
test
load_all_modules_in_packages
Recursively loads all modules from a package object, or set of package objects :param package_or_set_of_packages: package object, or iterable of package objects :return: list of all unique modules discovered by the function
module_discovery_utils/module_discovery_utils.py
def load_all_modules_in_packages(package_or_set_of_packages): """ Recursively loads all modules from a package object, or set of package objects :param package_or_set_of_packages: package object, or iterable of package objects :return: list of all unique modules discovered by the function """ i...
def load_all_modules_in_packages(package_or_set_of_packages): """ Recursively loads all modules from a package object, or set of package objects :param package_or_set_of_packages: package object, or iterable of package objects :return: list of all unique modules discovered by the function """ i...
[ "Recursively", "loads", "all", "modules", "from", "a", "package", "object", "or", "set", "of", "package", "objects" ]
zsennenga/module-discovery-utils
python
https://github.com/zsennenga/module-discovery-utils/blob/146d31051915f2347483fff9549eb272bd6b7d45/module_discovery_utils/module_discovery_utils.py#L8-L50
[ "def", "load_all_modules_in_packages", "(", "package_or_set_of_packages", ")", ":", "if", "isinstance", "(", "package_or_set_of_packages", ",", "types", ".", "ModuleType", ")", ":", "packages", "=", "[", "package_or_set_of_packages", "]", "elif", "isinstance", "(", "p...
146d31051915f2347483fff9549eb272bd6b7d45
test
Struct.__dict_invert
Helper function for merge. Takes a dictionary whose values are lists and returns a dict with the elements of each list as keys and the original keys as values.
environment/lib/python2.7/site-packages/IPython/utils/ipstruct.py
def __dict_invert(self, data): """Helper function for merge. Takes a dictionary whose values are lists and returns a dict with the elements of each list as keys and the original keys as values. """ outdict = {} for k,lst in data.items(): if isinstance(lst, st...
def __dict_invert(self, data): """Helper function for merge. Takes a dictionary whose values are lists and returns a dict with the elements of each list as keys and the original keys as values. """ outdict = {} for k,lst in data.items(): if isinstance(lst, st...
[ "Helper", "function", "for", "merge", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/ipstruct.py#L219-L231
[ "def", "__dict_invert", "(", "self", ",", "data", ")", ":", "outdict", "=", "{", "}", "for", "k", ",", "lst", "in", "data", ".", "items", "(", ")", ":", "if", "isinstance", "(", "lst", ",", "str", ")", ":", "lst", "=", "lst", ".", "split", "(",...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Struct.merge
Merge two Structs with customizable conflict resolution. This is similar to :meth:`update`, but much more flexible. First, a dict is made from data+key=value pairs. When merging this dict with the Struct S, the optional dictionary 'conflict' is used to decide what to do. If con...
environment/lib/python2.7/site-packages/IPython/utils/ipstruct.py
def merge(self, __loc_data__=None, __conflict_solve=None, **kw): """Merge two Structs with customizable conflict resolution. This is similar to :meth:`update`, but much more flexible. First, a dict is made from data+key=value pairs. When merging this dict with the Struct S, the optional...
def merge(self, __loc_data__=None, __conflict_solve=None, **kw): """Merge two Structs with customizable conflict resolution. This is similar to :meth:`update`, but much more flexible. First, a dict is made from data+key=value pairs. When merging this dict with the Struct S, the optional...
[ "Merge", "two", "Structs", "with", "customizable", "conflict", "resolution", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/ipstruct.py#L275-L392
[ "def", "merge", "(", "self", ",", "__loc_data__", "=", "None", ",", "__conflict_solve", "=", "None", ",", "*", "*", "kw", ")", ":", "data_dict", "=", "dict", "(", "__loc_data__", ",", "*", "*", "kw", ")", "# policies for conflict resolution: two argument funct...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
fullvars
like `vars()` but support `__slots__`.
jasily/data/fullvars.py
def fullvars(obj): ''' like `vars()` but support `__slots__`. ''' try: return vars(obj) except TypeError: pass # __slots__ slotsnames = set() for cls in type(obj).__mro__: __slots__ = getattr(cls, '__slots__', None) if __slots__: if isinstanc...
def fullvars(obj): ''' like `vars()` but support `__slots__`. ''' try: return vars(obj) except TypeError: pass # __slots__ slotsnames = set() for cls in type(obj).__mro__: __slots__ = getattr(cls, '__slots__', None) if __slots__: if isinstanc...
[ "like", "vars", "()", "but", "support", "__slots__", "." ]
Jasily/jasily-python
python
https://github.com/Jasily/jasily-python/blob/1c821a120ebbbbc3c5761f5f1e8a73588059242a/jasily/data/fullvars.py#L32-L51
[ "def", "fullvars", "(", "obj", ")", ":", "try", ":", "return", "vars", "(", "obj", ")", "except", "TypeError", ":", "pass", "# __slots__", "slotsnames", "=", "set", "(", ")", "for", "cls", "in", "type", "(", "obj", ")", ".", "__mro__", ":", "__slots_...
1c821a120ebbbbc3c5761f5f1e8a73588059242a
test
object_to_primitive
convert object to primitive type so we can serialize it to data format like python. all primitive types: dict, list, int, float, bool, str, None
jasily/format/utils.py
def object_to_primitive(obj): ''' convert object to primitive type so we can serialize it to data format like python. all primitive types: dict, list, int, float, bool, str, None ''' if obj is None: return obj if isinstance(obj, (int, float, bool, str)): return obj if isin...
def object_to_primitive(obj): ''' convert object to primitive type so we can serialize it to data format like python. all primitive types: dict, list, int, float, bool, str, None ''' if obj is None: return obj if isinstance(obj, (int, float, bool, str)): return obj if isin...
[ "convert", "object", "to", "primitive", "type", "so", "we", "can", "serialize", "it", "to", "data", "format", "like", "python", "." ]
Jasily/jasily-python
python
https://github.com/Jasily/jasily-python/blob/1c821a120ebbbbc3c5761f5f1e8a73588059242a/jasily/format/utils.py#L9-L29
[ "def", "object_to_primitive", "(", "obj", ")", ":", "if", "obj", "is", "None", ":", "return", "obj", "if", "isinstance", "(", "obj", ",", "(", "int", ",", "float", ",", "bool", ",", "str", ")", ")", ":", "return", "obj", "if", "isinstance", "(", "o...
1c821a120ebbbbc3c5761f5f1e8a73588059242a
test
main
Run as a command-line script: colorize a python file or stdin using ANSI color escapes and print to stdout. Inputs: - argv(None): a list of strings like sys.argv[1:] giving the command-line arguments. If None, use sys.argv[1:].
environment/lib/python2.7/site-packages/IPython/utils/PyColorize.py
def main(argv=None): """Run as a command-line script: colorize a python file or stdin using ANSI color escapes and print to stdout. Inputs: - argv(None): a list of strings like sys.argv[1:] giving the command-line arguments. If None, use sys.argv[1:]. """ usage_msg = """%prog [optio...
def main(argv=None): """Run as a command-line script: colorize a python file or stdin using ANSI color escapes and print to stdout. Inputs: - argv(None): a list of strings like sys.argv[1:] giving the command-line arguments. If None, use sys.argv[1:]. """ usage_msg = """%prog [optio...
[ "Run", "as", "a", "command", "-", "line", "script", ":", "colorize", "a", "python", "file", "or", "stdin", "using", "ANSI", "color", "escapes", "and", "print", "to", "stdout", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/PyColorize.py#L247-L303
[ "def", "main", "(", "argv", "=", "None", ")", ":", "usage_msg", "=", "\"\"\"%prog [options] [filename]\n\nColorize a python file or stdin using ANSI color escapes and print to stdout.\nIf no filename is given, or if filename is -, read standard input.\"\"\"", "parser", "=", "optparse", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
Parser.format2
Parse and send the colored source. If out and scheme are not specified, the defaults (given to constructor) are used. out should be a file-type object. Optionally, out can be given as the string 'str' and the parser will automatically return the output in a string.
environment/lib/python2.7/site-packages/IPython/utils/PyColorize.py
def format2(self, raw, out = None, scheme = ''): """ Parse and send the colored source. If out and scheme are not specified, the defaults (given to constructor) are used. out should be a file-type object. Optionally, out can be given as the string 'str' and the parser will auto...
def format2(self, raw, out = None, scheme = ''): """ Parse and send the colored source. If out and scheme are not specified, the defaults (given to constructor) are used. out should be a file-type object. Optionally, out can be given as the string 'str' and the parser will auto...
[ "Parse", "and", "send", "the", "colored", "source", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/utils/PyColorize.py#L131-L203
[ "def", "format2", "(", "self", ",", "raw", ",", "out", "=", "None", ",", "scheme", "=", "''", ")", ":", "string_output", "=", "0", "if", "out", "==", "'str'", "or", "self", ".", "out", "==", "'str'", "or", "isinstance", "(", "self", ".", "out", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
getfigs
Get a list of matplotlib figures by figure numbers. If no arguments are given, all available figures are returned. If the argument list contains references to invalid figures, a warning is printed but the function continues pasting further figures. Parameters ---------- figs : tuple A...
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def getfigs(*fig_nums): """Get a list of matplotlib figures by figure numbers. If no arguments are given, all available figures are returned. If the argument list contains references to invalid figures, a warning is printed but the function continues pasting further figures. Parameters ------...
def getfigs(*fig_nums): """Get a list of matplotlib figures by figure numbers. If no arguments are given, all available figures are returned. If the argument list contains references to invalid figures, a warning is printed but the function continues pasting further figures. Parameters ------...
[ "Get", "a", "list", "of", "matplotlib", "figures", "by", "figure", "numbers", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L53-L77
[ "def", "getfigs", "(", "*", "fig_nums", ")", ":", "from", "matplotlib", ".", "_pylab_helpers", "import", "Gcf", "if", "not", "fig_nums", ":", "fig_managers", "=", "Gcf", ".", "get_all_fig_managers", "(", ")", "return", "[", "fm", ".", "canvas", ".", "figur...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
print_figure
Convert a figure to svg or png for inline display.
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def print_figure(fig, fmt='png'): """Convert a figure to svg or png for inline display.""" # When there's an empty figure, we shouldn't return anything, otherwise we # get big blank areas in the qt console. if not fig.axes and not fig.lines: return fc = fig.get_facecolor() ec = fig.get_...
def print_figure(fig, fmt='png'): """Convert a figure to svg or png for inline display.""" # When there's an empty figure, we shouldn't return anything, otherwise we # get big blank areas in the qt console. if not fig.axes and not fig.lines: return fc = fig.get_facecolor() ec = fig.get_...
[ "Convert", "a", "figure", "to", "svg", "or", "png", "for", "inline", "display", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L91-L109
[ "def", "print_figure", "(", "fig", ",", "fmt", "=", "'png'", ")", ":", "# When there's an empty figure, we shouldn't return anything, otherwise we", "# get big blank areas in the qt console.", "if", "not", "fig", ".", "axes", "and", "not", "fig", ".", "lines", ":", "ret...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
mpl_runner
Factory to return a matplotlib-enabled runner for %run. Parameters ---------- safe_execfile : function This must be a function with the same interface as the :meth:`safe_execfile` method of IPython. Returns ------- A function suitable for use as the ``runner`` argument of the %run ...
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def mpl_runner(safe_execfile): """Factory to return a matplotlib-enabled runner for %run. Parameters ---------- safe_execfile : function This must be a function with the same interface as the :meth:`safe_execfile` method of IPython. Returns ------- A function suitable for use a...
def mpl_runner(safe_execfile): """Factory to return a matplotlib-enabled runner for %run. Parameters ---------- safe_execfile : function This must be a function with the same interface as the :meth:`safe_execfile` method of IPython. Returns ------- A function suitable for use a...
[ "Factory", "to", "return", "a", "matplotlib", "-", "enabled", "runner", "for", "%run", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L114-L151
[ "def", "mpl_runner", "(", "safe_execfile", ")", ":", "def", "mpl_execfile", "(", "fname", ",", "*", "where", ",", "*", "*", "kw", ")", ":", "\"\"\"matplotlib-aware wrapper around safe_execfile.\n\n Its interface is identical to that of the :func:`execfile` builtin.\n\n ...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
select_figure_format
Select figure format for inline backend, either 'png' or 'svg'. Using this method ensures only one figure format is active at a time.
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def select_figure_format(shell, fmt): """Select figure format for inline backend, either 'png' or 'svg'. Using this method ensures only one figure format is active at a time. """ from matplotlib.figure import Figure from IPython.zmq.pylab import backend_inline svg_formatter = shell.display_for...
def select_figure_format(shell, fmt): """Select figure format for inline backend, either 'png' or 'svg'. Using this method ensures only one figure format is active at a time. """ from matplotlib.figure import Figure from IPython.zmq.pylab import backend_inline svg_formatter = shell.display_for...
[ "Select", "figure", "format", "for", "inline", "backend", "either", "png", "or", "svg", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L154-L175
[ "def", "select_figure_format", "(", "shell", ",", "fmt", ")", ":", "from", "matplotlib", ".", "figure", "import", "Figure", "from", "IPython", ".", "zmq", ".", "pylab", "import", "backend_inline", "svg_formatter", "=", "shell", ".", "display_formatter", ".", "...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
find_gui_and_backend
Given a gui string return the gui and mpl backend. Parameters ---------- gui : str Can be one of ('tk','gtk','wx','qt','qt4','inline'). Returns ------- A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg', 'WXAgg','Qt4Agg','module://IPython.zmq.pylab.backend_inline')...
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def find_gui_and_backend(gui=None): """Given a gui string return the gui and mpl backend. Parameters ---------- gui : str Can be one of ('tk','gtk','wx','qt','qt4','inline'). Returns ------- A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg', 'WXAgg','Qt4Agg','...
def find_gui_and_backend(gui=None): """Given a gui string return the gui and mpl backend. Parameters ---------- gui : str Can be one of ('tk','gtk','wx','qt','qt4','inline'). Returns ------- A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg', 'WXAgg','Qt4Agg','...
[ "Given", "a", "gui", "string", "return", "the", "gui", "and", "mpl", "backend", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L182-L206
[ "def", "find_gui_and_backend", "(", "gui", "=", "None", ")", ":", "import", "matplotlib", "if", "gui", "and", "gui", "!=", "'auto'", ":", "# select backend based on requested gui", "backend", "=", "backends", "[", "gui", "]", "else", ":", "backend", "=", "matp...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
activate_matplotlib
Activate the given backend and set interactive to True.
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def activate_matplotlib(backend): """Activate the given backend and set interactive to True.""" import matplotlib if backend.startswith('module://'): # Work around bug in matplotlib: matplotlib.use converts the # backend_id to lowercase even if a module name is specified! matplotlib...
def activate_matplotlib(backend): """Activate the given backend and set interactive to True.""" import matplotlib if backend.startswith('module://'): # Work around bug in matplotlib: matplotlib.use converts the # backend_id to lowercase even if a module name is specified! matplotlib...
[ "Activate", "the", "given", "backend", "and", "set", "interactive", "to", "True", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L209-L233
[ "def", "activate_matplotlib", "(", "backend", ")", ":", "import", "matplotlib", "if", "backend", ".", "startswith", "(", "'module://'", ")", ":", "# Work around bug in matplotlib: matplotlib.use converts the", "# backend_id to lowercase even if a module name is specified!", "matp...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
import_pylab
Import the standard pylab symbols into user_ns.
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def import_pylab(user_ns, import_all=True): """Import the standard pylab symbols into user_ns.""" # Import numpy as np/pyplot as plt are conventions we're trying to # somewhat standardize on. Making them available to users by default # will greatly help this. s = ("import numpy\n" "impor...
def import_pylab(user_ns, import_all=True): """Import the standard pylab symbols into user_ns.""" # Import numpy as np/pyplot as plt are conventions we're trying to # somewhat standardize on. Making them available to users by default # will greatly help this. s = ("import numpy\n" "impor...
[ "Import", "the", "standard", "pylab", "symbols", "into", "user_ns", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L236-L253
[ "def", "import_pylab", "(", "user_ns", ",", "import_all", "=", "True", ")", ":", "# Import numpy as np/pyplot as plt are conventions we're trying to", "# somewhat standardize on. Making them available to users by default", "# will greatly help this.", "s", "=", "(", "\"import numpy\...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
configure_inline_support
Configure an IPython shell object for matplotlib use. Parameters ---------- shell : InteractiveShell instance backend : matplotlib backend user_ns : dict A namespace where all configured variables will be placed. If not given, the `user_ns` attribute of the shell object is used.
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def configure_inline_support(shell, backend, user_ns=None): """Configure an IPython shell object for matplotlib use. Parameters ---------- shell : InteractiveShell instance backend : matplotlib backend user_ns : dict A namespace where all configured variables will be placed. If not giv...
def configure_inline_support(shell, backend, user_ns=None): """Configure an IPython shell object for matplotlib use. Parameters ---------- shell : InteractiveShell instance backend : matplotlib backend user_ns : dict A namespace where all configured variables will be placed. If not giv...
[ "Configure", "an", "IPython", "shell", "object", "for", "matplotlib", "use", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L256-L305
[ "def", "configure_inline_support", "(", "shell", ",", "backend", ",", "user_ns", "=", "None", ")", ":", "# If using our svg payload backend, register the post-execution", "# function that will pick up the results for display. This can only be", "# done with access to the real shell obje...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
pylab_activate
Activate pylab mode in the user's namespace. Loads and initializes numpy, matplotlib and friends for interactive use. Parameters ---------- user_ns : dict Namespace where the imports will occur. gui : optional, string A valid gui name following the conventions of the %gui magic. ...
environment/lib/python2.7/site-packages/IPython/core/pylabtools.py
def pylab_activate(user_ns, gui=None, import_all=True, shell=None): """Activate pylab mode in the user's namespace. Loads and initializes numpy, matplotlib and friends for interactive use. Parameters ---------- user_ns : dict Namespace where the imports will occur. gui : optional, strin...
def pylab_activate(user_ns, gui=None, import_all=True, shell=None): """Activate pylab mode in the user's namespace. Loads and initializes numpy, matplotlib and friends for interactive use. Parameters ---------- user_ns : dict Namespace where the imports will occur. gui : optional, strin...
[ "Activate", "pylab", "mode", "in", "the", "user", "s", "namespace", "." ]
cloud9ers/gurumate
python
https://github.com/cloud9ers/gurumate/blob/075dc74d1ee62a8c6b7a8bf2b271364f01629d1e/environment/lib/python2.7/site-packages/IPython/core/pylabtools.py#L308-L341
[ "def", "pylab_activate", "(", "user_ns", ",", "gui", "=", "None", ",", "import_all", "=", "True", ",", "shell", "=", "None", ")", ":", "gui", ",", "backend", "=", "find_gui_and_backend", "(", "gui", ")", "activate_matplotlib", "(", "backend", ")", "import_...
075dc74d1ee62a8c6b7a8bf2b271364f01629d1e
test
PyTracer._trace
The trace function passed to sys.settrace.
virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py
def _trace(self, frame, event, arg_unused): """The trace function passed to sys.settrace.""" if self.stopped: return if 0: sys.stderr.write("trace event: %s %r @%d\n" % ( event, frame.f_code.co_filename, frame.f_lineno )) if self.las...
def _trace(self, frame, event, arg_unused): """The trace function passed to sys.settrace.""" if self.stopped: return if 0: sys.stderr.write("trace event: %s %r @%d\n" % ( event, frame.f_code.co_filename, frame.f_lineno )) if self.las...
[ "The", "trace", "function", "passed", "to", "sys", ".", "settrace", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py#L57-L119
[ "def", "_trace", "(", "self", ",", "frame", ",", "event", ",", "arg_unused", ")", ":", "if", "self", ".", "stopped", ":", "return", "if", "0", ":", "sys", ".", "stderr", ".", "write", "(", "\"trace event: %s %r @%d\\n\"", "%", "(", "event", ",", "frame...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
PyTracer.start
Start this Tracer. Return a Python function suitable for use with sys.settrace().
virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py
def start(self): """Start this Tracer. Return a Python function suitable for use with sys.settrace(). """ self.thread = threading.currentThread() sys.settrace(self._trace) return self._trace
def start(self): """Start this Tracer. Return a Python function suitable for use with sys.settrace(). """ self.thread = threading.currentThread() sys.settrace(self._trace) return self._trace
[ "Start", "this", "Tracer", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py#L121-L129
[ "def", "start", "(", "self", ")", ":", "self", ".", "thread", "=", "threading", ".", "currentThread", "(", ")", "sys", ".", "settrace", "(", "self", ".", "_trace", ")", "return", "self", ".", "_trace" ]
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
PyTracer.stop
Stop this Tracer.
virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py
def stop(self): """Stop this Tracer.""" self.stopped = True if self.thread != threading.currentThread(): # Called on a different thread than started us: we can't unhook # ourseves, but we've set the flag that we should stop, so we won't # do any more tracing. ...
def stop(self): """Stop this Tracer.""" self.stopped = True if self.thread != threading.currentThread(): # Called on a different thread than started us: we can't unhook # ourseves, but we've set the flag that we should stop, so we won't # do any more tracing. ...
[ "Stop", "this", "Tracer", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py#L131-L145
[ "def", "stop", "(", "self", ")", ":", "self", ".", "stopped", "=", "True", "if", "self", ".", "thread", "!=", "threading", ".", "currentThread", "(", ")", ":", "# Called on a different thread than started us: we can't unhook", "# ourseves, but we've set the flag that we...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb
test
Collector._start_tracer
Start a new Tracer object, and store it in self.tracers.
virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py
def _start_tracer(self): """Start a new Tracer object, and store it in self.tracers.""" tracer = self._trace_class() tracer.data = self.data tracer.arcs = self.branch tracer.should_trace = self.should_trace tracer.should_trace_cache = self.should_trace_cache trace...
def _start_tracer(self): """Start a new Tracer object, and store it in self.tracers.""" tracer = self._trace_class() tracer.data = self.data tracer.arcs = self.branch tracer.should_trace = self.should_trace tracer.should_trace_cache = self.should_trace_cache trace...
[ "Start", "a", "new", "Tracer", "object", "and", "store", "it", "in", "self", ".", "tracers", "." ]
tnkteja/myhelp
python
https://github.com/tnkteja/myhelp/blob/fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb/virtualEnvironment/lib/python2.7/site-packages/coverage/collector.py#L227-L237
[ "def", "_start_tracer", "(", "self", ")", ":", "tracer", "=", "self", ".", "_trace_class", "(", ")", "tracer", ".", "data", "=", "self", ".", "data", "tracer", ".", "arcs", "=", "self", ".", "branch", "tracer", ".", "should_trace", "=", "self", ".", ...
fb3a4809d448ad14d5b2e6ddf2e7e89ad52b71cb