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
train
DictGraph.add_edge
Adds an edge to the ``DictGraph``. An edge is just a pair of **node objects**. If the **node objects** are not in the graph they are created. Arguments: - edge(iterable) An ordered pair of **node objects**. The edge is assumed to have a direction from t...
src/papy/graph.py
def add_edge(self, edge, double=False): """ Adds an edge to the ``DictGraph``. An edge is just a pair of **node objects**. If the **node objects** are not in the graph they are created. Arguments: - edge(iterable) An ordered pair of **node objects**....
def add_edge(self, edge, double=False): """ Adds an edge to the ``DictGraph``. An edge is just a pair of **node objects**. If the **node objects** are not in the graph they are created. Arguments: - edge(iterable) An ordered pair of **node objects**....
[ "Adds", "an", "edge", "to", "the", "DictGraph", ".", "An", "edge", "is", "just", "a", "pair", "of", "**", "node", "objects", "**", ".", "If", "the", "**", "node", "objects", "**", "are", "not", "in", "the", "graph", "they", "are", "created", ".", "...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L280-L300
[ "def", "add_edge", "(", "self", ",", "edge", ",", "double", "=", "False", ")", ":", "(", "left_entity", ",", "right_entity", ")", "=", "edge", "self", ".", "add_node", "(", "left_entity", ")", "self", ".", "add_node", "(", "right_entity", ")", "self", ...
708e50827b5db46bbea081982cb74b9b0e464064
train
DictGraph.del_edge
Removes an edge from the ``DictGraph``. An edge is a pair of **node objects**. The **node objects** are not removed from the ``DictGraph``. Arguments: - edge(``tuple``) An ordered pair of **node objects**. The edge is assumed to have a direction from the first t...
src/papy/graph.py
def del_edge(self, edge, double=False): """ Removes an edge from the ``DictGraph``. An edge is a pair of **node objects**. The **node objects** are not removed from the ``DictGraph``. Arguments: - edge(``tuple``) An ordered pair of **node objects**. The edge ...
def del_edge(self, edge, double=False): """ Removes an edge from the ``DictGraph``. An edge is a pair of **node objects**. The **node objects** are not removed from the ``DictGraph``. Arguments: - edge(``tuple``) An ordered pair of **node objects**. The edge ...
[ "Removes", "an", "edge", "from", "the", "DictGraph", ".", "An", "edge", "is", "a", "pair", "of", "**", "node", "objects", "**", ".", "The", "**", "node", "objects", "**", "are", "not", "removed", "from", "the", "DictGraph", ".", "Arguments", ":", "-", ...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L302-L319
[ "def", "del_edge", "(", "self", ",", "edge", ",", "double", "=", "False", ")", ":", "(", "left_entity", ",", "right_entity", ")", "=", "edge", "self", "[", "left_entity", "]", ".", "pop", "(", "right_entity", ")", "if", "double", ":", "self", ".", "d...
708e50827b5db46bbea081982cb74b9b0e464064
train
DictGraph.add_nodes
Adds **node objects** to the graph. Arguments: - nodes(iterable) Sequence of **node objects** to be added to the ``DictGraph`` - xtras(iterable) [default: ``None``] Sequence of ``Node.xtra`` dictionaries corresponding to the **node...
src/papy/graph.py
def add_nodes(self, nodes, xtras=None): """ Adds **node objects** to the graph. Arguments: - nodes(iterable) Sequence of **node objects** to be added to the ``DictGraph`` - xtras(iterable) [default: ``None``] Sequence of ``Node....
def add_nodes(self, nodes, xtras=None): """ Adds **node objects** to the graph. Arguments: - nodes(iterable) Sequence of **node objects** to be added to the ``DictGraph`` - xtras(iterable) [default: ``None``] Sequence of ``Node....
[ "Adds", "**", "node", "objects", "**", "to", "the", "graph", ".", "Arguments", ":", "-", "nodes", "(", "iterable", ")", "Sequence", "of", "**", "node", "objects", "**", "to", "be", "added", "to", "the", "DictGraph", "-", "xtras", "(", "iterable", ")", ...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L321-L336
[ "def", "add_nodes", "(", "self", ",", "nodes", ",", "xtras", "=", "None", ")", ":", "for", "node", ",", "xtra", "in", "izip", "(", "nodes", ",", "(", "xtras", "or", "repeat", "(", "None", ")", ")", ")", ":", "self", ".", "add_node", "(", "node", ...
708e50827b5db46bbea081982cb74b9b0e464064
train
DictGraph.add_edges
Adds edges to the graph. Takes optional arguments for ``DictGraph.add_edge``. Arguments: - edges(iterable) Sequence of edges to be added to the ``DictGraph``.
src/papy/graph.py
def add_edges(self, edges, *args, **kwargs): """ Adds edges to the graph. Takes optional arguments for ``DictGraph.add_edge``. Arguments: - edges(iterable) Sequence of edges to be added to the ``DictGraph``. """ for edg...
def add_edges(self, edges, *args, **kwargs): """ Adds edges to the graph. Takes optional arguments for ``DictGraph.add_edge``. Arguments: - edges(iterable) Sequence of edges to be added to the ``DictGraph``. """ for edg...
[ "Adds", "edges", "to", "the", "graph", ".", "Takes", "optional", "arguments", "for", "DictGraph", ".", "add_edge", ".", "Arguments", ":", "-", "edges", "(", "iterable", ")", "Sequence", "of", "edges", "to", "be", "added", "to", "the", "DictGraph", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L351-L363
[ "def", "add_edges", "(", "self", ",", "edges", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "edge", "in", "edges", ":", "self", ".", "add_edge", "(", "edge", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
708e50827b5db46bbea081982cb74b9b0e464064
train
DictGraph.del_edges
Removes edges from the graph. Takes optional arguments for ``DictGraph.del_edge``. Arguments: - edges(iterable) Sequence of edges to be removed from the ``DictGraph``.
src/papy/graph.py
def del_edges(self, edges, *args, **kwargs): """ Removes edges from the graph. Takes optional arguments for ``DictGraph.del_edge``. Arguments: - edges(iterable) Sequence of edges to be removed from the ``DictGraph``. """ ...
def del_edges(self, edges, *args, **kwargs): """ Removes edges from the graph. Takes optional arguments for ``DictGraph.del_edge``. Arguments: - edges(iterable) Sequence of edges to be removed from the ``DictGraph``. """ ...
[ "Removes", "edges", "from", "the", "graph", ".", "Takes", "optional", "arguments", "for", "DictGraph", ".", "del_edge", ".", "Arguments", ":", "-", "edges", "(", "iterable", ")", "Sequence", "of", "edges", "to", "be", "removed", "from", "the", "DictGraph", ...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L365-L377
[ "def", "del_edges", "(", "self", ",", "edges", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "edge", "in", "edges", ":", "self", ".", "del_edge", "(", "edge", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
708e50827b5db46bbea081982cb74b9b0e464064
train
DictGraph.edges
Returns a ``tuple`` of all edges in the ``DictGraph`` an edge is a pair of **node objects**. Arguments: - nodes(iterable) [default: ``None``] iterable of **node objects** if specified the edges will be limited to those outgoing from one of the specif...
src/papy/graph.py
def edges(self, nodes=None): """ Returns a ``tuple`` of all edges in the ``DictGraph`` an edge is a pair of **node objects**. Arguments: - nodes(iterable) [default: ``None``] iterable of **node objects** if specified the edges will be limited to t...
def edges(self, nodes=None): """ Returns a ``tuple`` of all edges in the ``DictGraph`` an edge is a pair of **node objects**. Arguments: - nodes(iterable) [default: ``None``] iterable of **node objects** if specified the edges will be limited to t...
[ "Returns", "a", "tuple", "of", "all", "edges", "in", "the", "DictGraph", "an", "edge", "is", "a", "pair", "of", "**", "node", "objects", "**", ".", "Arguments", ":", "-", "nodes", "(", "iterable", ")", "[", "default", ":", "None", "]", "iterable", "o...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L413-L432
[ "def", "edges", "(", "self", ",", "nodes", "=", "None", ")", ":", "# If a Node has been directly updated (__not__ recommended)", "# then the Graph will not know the added nodes and therefore will", "# miss half of their edges.", "edges", "=", "set", "(", ")", "for", "node", "...
708e50827b5db46bbea081982cb74b9b0e464064
train
DictGraph.incoming_edges
Returns a ``tuple`` of incoming edges for a **node object**. Arguments: - node(``object``) **node object** present in the graph to be queried for incoming edges.
src/papy/graph.py
def incoming_edges(self, node): """ Returns a ``tuple`` of incoming edges for a **node object**. Arguments: - node(``object``) **node object** present in the graph to be queried for incoming edges. """ edges = self.edges() ...
def incoming_edges(self, node): """ Returns a ``tuple`` of incoming edges for a **node object**. Arguments: - node(``object``) **node object** present in the graph to be queried for incoming edges. """ edges = self.edges() ...
[ "Returns", "a", "tuple", "of", "incoming", "edges", "for", "a", "**", "node", "object", "**", ".", "Arguments", ":", "-", "node", "(", "object", ")", "**", "node", "object", "**", "present", "in", "the", "graph", "to", "be", "queried", "for", "incoming...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L434-L449
[ "def", "incoming_edges", "(", "self", ",", "node", ")", ":", "edges", "=", "self", ".", "edges", "(", ")", "in_edges", "=", "[", "]", "for", "out_node", ",", "in_node", "in", "edges", ":", "if", "node", "is", "in_node", ":", "in_edges", ".", "append"...
708e50827b5db46bbea081982cb74b9b0e464064
train
DictGraph.outgoing_edges
Returns a ``tuple`` of outgoing edges for a **node object**. Arguments: - node(``object``) **node object** present in the graph to be queried for outgoing edges.
src/papy/graph.py
def outgoing_edges(self, node): """ Returns a ``tuple`` of outgoing edges for a **node object**. Arguments: - node(``object``) **node object** present in the graph to be queried for outgoing edges. """ #TODO: pls make outgoig_ed...
def outgoing_edges(self, node): """ Returns a ``tuple`` of outgoing edges for a **node object**. Arguments: - node(``object``) **node object** present in the graph to be queried for outgoing edges. """ #TODO: pls make outgoig_ed...
[ "Returns", "a", "tuple", "of", "outgoing", "edges", "for", "a", "**", "node", "object", "**", ".", "Arguments", ":", "-", "node", "(", "object", ")", "**", "node", "object", "**", "present", "in", "the", "graph", "to", "be", "queried", "for", "outgoing...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/graph.py#L451-L467
[ "def", "outgoing_edges", "(", "self", ",", "node", ")", ":", "#TODO: pls make outgoig_edges less insane", "edges", "=", "self", ".", "edges", "(", ")", "out_edges", "=", "[", "]", "for", "out_node", ",", "in_node", "in", "edges", ":", "if", "node", "is", "...
708e50827b5db46bbea081982cb74b9b0e464064
train
open_connection
Open a Jaide session with the device. To open a Jaide session to the device, and run the appropriate function against the device. Arguments for the downstream function are passed through. @param ip: String of the IP or hostname of the device to connect to. @type ip: str @param username: The st...
jaide/wrap.py
def open_connection(ip, username, password, function, args, write=False, conn_timeout=5, sess_timeout=300, port=22): """ Open a Jaide session with the device. To open a Jaide session to the device, and run the appropriate function against the device. Arguments for the downstream functio...
def open_connection(ip, username, password, function, args, write=False, conn_timeout=5, sess_timeout=300, port=22): """ Open a Jaide session with the device. To open a Jaide session to the device, and run the appropriate function against the device. Arguments for the downstream functio...
[ "Open", "a", "Jaide", "session", "with", "the", "device", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L32-L103
[ "def", "open_connection", "(", "ip", ",", "username", ",", "password", ",", "function", ",", "args", ",", "write", "=", "False", ",", "conn_timeout", "=", "5", ",", "sess_timeout", "=", "300", ",", "port", "=", "22", ")", ":", "# start with the header line...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
command
Run an operational command. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: the operational commands to send to the device. @type commands: str or list @param format: The desired output format from the device, either 'text' | or 'x...
jaide/wrap.py
def command(jaide, commands, format="text", xpath=False): """ Run an operational command. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: the operational commands to send to the device. @type commands: str or list @param format: The desired out...
def command(jaide, commands, format="text", xpath=False): """ Run an operational command. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: the operational commands to send to the device. @type commands: str or list @param format: The desired out...
[ "Run", "an", "operational", "command", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L106-L146
[ "def", "command", "(", "jaide", ",", "commands", ",", "format", "=", "\"text\"", ",", "xpath", "=", "False", ")", ":", "output", "=", "\"\"", "for", "cmd", "in", "clean_lines", "(", "commands", ")", ":", "expression", "=", "\"\"", "output", "+=", "colo...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
commit
Execute a commit against the device. Purpose: This function will send set commands to a device, and commit | the changes. Options exist for confirming, comments, | synchronizing, checking, blank commits, or delaying to a later | time/date. @param jaide: The jaide connection to...
jaide/wrap.py
def commit(jaide, commands, check, sync, comment, confirm, at_time, blank): """ Execute a commit against the device. Purpose: This function will send set commands to a device, and commit | the changes. Options exist for confirming, comments, | synchronizing, checking, blank commits, or de...
def commit(jaide, commands, check, sync, comment, confirm, at_time, blank): """ Execute a commit against the device. Purpose: This function will send set commands to a device, and commit | the changes. Options exist for confirming, comments, | synchronizing, checking, blank commits, or de...
[ "Execute", "a", "commit", "against", "the", "device", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L149-L251
[ "def", "commit", "(", "jaide", ",", "commands", ",", "check", ",", "sync", ",", "comment", ",", "confirm", ",", "at_time", ",", "blank", ")", ":", "# set the commands to do nothing if the user wants a blank commit.", "if", "blank", ":", "commands", "=", "'annotate...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
compare
Perform a show | compare with some set commands. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: The set commands to send to the device to compare with. @type commands: str or list @returns: The output from the device. @rtype str
jaide/wrap.py
def compare(jaide, commands): """ Perform a show | compare with some set commands. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: The set commands to send to the device to compare with. @type commands: str or list @returns: The output from th...
def compare(jaide, commands): """ Perform a show | compare with some set commands. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: The set commands to send to the device to compare with. @type commands: str or list @returns: The output from th...
[ "Perform", "a", "show", "|", "compare", "with", "some", "set", "commands", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L254-L266
[ "def", "compare", "(", "jaide", ",", "commands", ")", ":", "output", "=", "color", "(", "\"show | compare:\\n\"", ",", "'yel'", ")", "return", "output", "+", "color_diffs", "(", "jaide", ".", "compare_config", "(", "commands", ")", ")" ]
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
diff_config
Perform a show | compare with some set commands. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param second_host: The device IP or hostname of the second host to | compare with. @type second_host: str @param mode: How to compare the configu...
jaide/wrap.py
def diff_config(jaide, second_host, mode): """ Perform a show | compare with some set commands. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param second_host: The device IP or hostname of the second host to | compare with. @type second_ho...
def diff_config(jaide, second_host, mode): """ Perform a show | compare with some set commands. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param second_host: The device IP or hostname of the second host to | compare with. @type second_ho...
[ "Perform", "a", "show", "|", "compare", "with", "some", "set", "commands", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L281-L327
[ "def", "diff_config", "(", "jaide", ",", "second_host", ",", "mode", ")", ":", "try", ":", "# create a list of all the lines that differ, and merge it.", "output", "=", "'\\n'", ".", "join", "(", "[", "diff", "for", "diff", "in", "jaide", ".", "diff_config", "("...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
pull
Copy file(s) from a device to the local machine. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param source: The source filepath on the junos device to pull. @type source: str @param destination: the destination filepath on the local device for ...
jaide/wrap.py
def pull(jaide, source, destination, progress, multi): """ Copy file(s) from a device to the local machine. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param source: The source filepath on the junos device to pull. @type source: str @param destination: the...
def pull(jaide, source, destination, progress, multi): """ Copy file(s) from a device to the local machine. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param source: The source filepath on the junos device to pull. @type source: str @param destination: the...
[ "Copy", "file", "(", "s", ")", "from", "a", "device", "to", "the", "local", "machine", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L358-L404
[ "def", "pull", "(", "jaide", ",", "source", ",", "destination", ",", "progress", ",", "multi", ")", ":", "output", "=", "color", "(", "'Retrieving %s:%s, and putting it in %s\\n'", "%", "(", "jaide", ".", "host", ",", "source", ",", "path", ".", "normpath", ...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
push
Copy file(s) from the local machine to a junos device. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param source: The source filepath on the junos device to pull. @type source: str @param destination: the destination filepath on the local device for ...
jaide/wrap.py
def push(jaide, source, destination, progress, multi=False): """ Copy file(s) from the local machine to a junos device. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param source: The source filepath on the junos device to pull. @type source: str @param dest...
def push(jaide, source, destination, progress, multi=False): """ Copy file(s) from the local machine to a junos device. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param source: The source filepath on the junos device to pull. @type source: str @param dest...
[ "Copy", "file", "(", "s", ")", "from", "the", "local", "machine", "to", "a", "junos", "device", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L407-L451
[ "def", "push", "(", "jaide", ",", "source", ",", "destination", ",", "progress", ",", "multi", "=", "False", ")", ":", "output", "=", "color", "(", "'Pushing %s to %s:%s\\n'", "%", "(", "source", ",", "jaide", ".", "host", ",", "destination", ")", ",", ...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
shell
Send shell commands to a device. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: The shell commands to send to the device. @type commands: str or list. @returns: The output of the commands. @rtype str
jaide/wrap.py
def shell(jaide, commands): """ Send shell commands to a device. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: The shell commands to send to the device. @type commands: str or list. @returns: The output of the commands. @rtype str ""...
def shell(jaide, commands): """ Send shell commands to a device. @param jaide: The jaide connection to the device. @type jaide: jaide.Jaide object @param commands: The shell commands to send to the device. @type commands: str or list. @returns: The output of the commands. @rtype str ""...
[ "Send", "shell", "commands", "to", "a", "device", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/wrap.py#L454-L469
[ "def", "shell", "(", "jaide", ",", "commands", ")", ":", "out", "=", "\"\"", "for", "cmd", "in", "clean_lines", "(", "commands", ")", ":", "out", "+=", "color", "(", "'> %s\\n'", "%", "cmd", ",", "'yel'", ")", "out", "+=", "jaide", ".", "shell_cmd", ...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
get_all_keys
Returns all keys from etcd. :param reactor: reference to Twisted' reactor. :param etcd_address: Address with port number where etcd is running. :return: An instance of txaioetcd.Range containing all keys and their values.
txaioetcd/cli/exporter.py
def get_all_keys(reactor, key_type, value_type, etcd_address): """Returns all keys from etcd. :param reactor: reference to Twisted' reactor. :param etcd_address: Address with port number where etcd is running. :return: An instance of txaioetcd.Range containing all keys and their values....
def get_all_keys(reactor, key_type, value_type, etcd_address): """Returns all keys from etcd. :param reactor: reference to Twisted' reactor. :param etcd_address: Address with port number where etcd is running. :return: An instance of txaioetcd.Range containing all keys and their values....
[ "Returns", "all", "keys", "from", "etcd", "." ]
crossbario/txaio-etcd
python
https://github.com/crossbario/txaio-etcd/blob/c9aebff7f288a0b219bffc9d2579d22cf543baa5/txaioetcd/cli/exporter.py#L49-L81
[ "def", "get_all_keys", "(", "reactor", ",", "key_type", ",", "value_type", ",", "etcd_address", ")", ":", "etcd", "=", "Client", "(", "reactor", ",", "etcd_address", ")", "result", "=", "yield", "etcd", ".", "get", "(", "b'\\x00'", ",", "range_end", "=", ...
c9aebff7f288a0b219bffc9d2579d22cf543baa5
train
Scan.stop
Send the GET request required to stop the scan If timeout is not specified we just send the request and return. When it is the method will wait for (at most) :timeout: seconds until the scan changes it's status/stops. If the timeout is reached then an exception is raised. :para...
w3af_api_client/scan.py
def stop(self, timeout=None): """ Send the GET request required to stop the scan If timeout is not specified we just send the request and return. When it is the method will wait for (at most) :timeout: seconds until the scan changes it's status/stops. If the timeout is reached t...
def stop(self, timeout=None): """ Send the GET request required to stop the scan If timeout is not specified we just send the request and return. When it is the method will wait for (at most) :timeout: seconds until the scan changes it's status/stops. If the timeout is reached t...
[ "Send", "the", "GET", "request", "required", "to", "stop", "the", "scan" ]
andresriancho/w3af-api-client
python
https://github.com/andresriancho/w3af-api-client/blob/adeb79bad75264d754de69f0bb981b366da96f32/w3af_api_client/scan.py#L56-L91
[ "def", "stop", "(", "self", ",", "timeout", "=", "None", ")", ":", "assert", "self", ".", "scan_id", "is", "not", "None", ",", "'No scan_id has been set'", "#", "# Simple stop", "#", "if", "timeout", "is", "None", ":", "url", "=", "'/scans/%s/stop'", "%"...
adeb79bad75264d754de69f0bb981b366da96f32
train
public_key_to_xrb_address
Convert `public_key` (bytes) to an xrb address >>> public_key_to_xrb_address(b'00000000000000000000000000000000') 'xrb_1e3i81r51e3i81r51e3i81r51e3i81r51e3i81r51e3i81r51e3imxssakuq' :param public_key: public key in bytes :type public_key: bytes :return: xrb address :rtype: str
src/nano/accounts.py
def public_key_to_xrb_address(public_key): """ Convert `public_key` (bytes) to an xrb address >>> public_key_to_xrb_address(b'00000000000000000000000000000000') 'xrb_1e3i81r51e3i81r51e3i81r51e3i81r51e3i81r51e3i81r51e3imxssakuq' :param public_key: public key in bytes :type public_key: bytes ...
def public_key_to_xrb_address(public_key): """ Convert `public_key` (bytes) to an xrb address >>> public_key_to_xrb_address(b'00000000000000000000000000000000') 'xrb_1e3i81r51e3i81r51e3i81r51e3i81r51e3i81r51e3i81r51e3imxssakuq' :param public_key: public key in bytes :type public_key: bytes ...
[ "Convert", "public_key", "(", "bytes", ")", "to", "an", "xrb", "address" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/accounts.py#L50-L70
[ "def", "public_key_to_xrb_address", "(", "public_key", ")", ":", "if", "not", "len", "(", "public_key", ")", "==", "32", ":", "raise", "ValueError", "(", "'public key must be 32 chars'", ")", "padded", "=", "b'000'", "+", "public_key", "address", "=", "b32xrb_en...
f26b8bc895b997067780f925049a70e82c0c2479
train
xrb_address_to_public_key
Convert an xrb address to public key in bytes >>> xrb_address_to_public_key('xrb_1e3i81r51e3i81r51e3i81r51e3i'\ '81r51e3i81r51e3i81r51e3imxssakuq') b'00000000000000000000000000000000' :param address: xrb address :type address: bytes :return: public key in bytes ...
src/nano/accounts.py
def xrb_address_to_public_key(address): """ Convert an xrb address to public key in bytes >>> xrb_address_to_public_key('xrb_1e3i81r51e3i81r51e3i81r51e3i'\ '81r51e3i81r51e3i81r51e3imxssakuq') b'00000000000000000000000000000000' :param address: xrb address :typ...
def xrb_address_to_public_key(address): """ Convert an xrb address to public key in bytes >>> xrb_address_to_public_key('xrb_1e3i81r51e3i81r51e3i81r51e3i'\ '81r51e3i81r51e3i81r51e3imxssakuq') b'00000000000000000000000000000000' :param address: xrb address :typ...
[ "Convert", "an", "xrb", "address", "to", "public", "key", "in", "bytes" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/accounts.py#L73-L106
[ "def", "xrb_address_to_public_key", "(", "address", ")", ":", "address", "=", "bytearray", "(", "address", ",", "'ascii'", ")", "if", "not", "address", ".", "startswith", "(", "b'xrb_'", ")", ":", "raise", "ValueError", "(", "'address does not start with xrb_: %s'...
f26b8bc895b997067780f925049a70e82c0c2479
train
generate_account
Generates an adhoc account and keypair >>> account = generate_account(seed=unhexlify('0'*64)) {'address': u'xrb_3i1aq1cchnmbn9x5rsbap8b15akfh7wj7pwskuzi7ahz8oq6cobd99d4r3b7', 'private_key_bytes': '\x9f\x0eDLi\xf7zI\xbd\x0b\xe8\x9d\xb9,8\xfeq>\tc\x16\\\xca\x12\xfa\xf5q-vW\x12\x0f', 'private_key_hex': ...
src/nano/accounts.py
def generate_account(seed=None, index=0): """ Generates an adhoc account and keypair >>> account = generate_account(seed=unhexlify('0'*64)) {'address': u'xrb_3i1aq1cchnmbn9x5rsbap8b15akfh7wj7pwskuzi7ahz8oq6cobd99d4r3b7', 'private_key_bytes': '\x9f\x0eDLi\xf7zI\xbd\x0b\xe8\x9d\xb9,8\xfeq>\tc\x16\\\...
def generate_account(seed=None, index=0): """ Generates an adhoc account and keypair >>> account = generate_account(seed=unhexlify('0'*64)) {'address': u'xrb_3i1aq1cchnmbn9x5rsbap8b15akfh7wj7pwskuzi7ahz8oq6cobd99d4r3b7', 'private_key_bytes': '\x9f\x0eDLi\xf7zI\xbd\x0b\xe8\x9d\xb9,8\xfeq>\tc\x16\\\...
[ "Generates", "an", "adhoc", "account", "and", "keypair" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/accounts.py#L109-L143
[ "def", "generate_account", "(", "seed", "=", "None", ",", "index", "=", "0", ")", ":", "if", "not", "seed", ":", "seed", "=", "unhexlify", "(", "''", ".", "join", "(", "random", ".", "choice", "(", "'0123456789ABCDEF'", ")", "for", "i", "in", "range"...
f26b8bc895b997067780f925049a70e82c0c2479
train
InvenioOAuthClient.init_app
Flask application initialization.
invenio_oauthclient/ext.py
def init_app(self, app): """Flask application initialization.""" self.init_config(app) state = _OAuthClientState(app) app.extensions['invenio-oauthclient'] = state return state
def init_app(self, app): """Flask application initialization.""" self.init_config(app) state = _OAuthClientState(app) app.extensions['invenio-oauthclient'] = state return state
[ "Flask", "application", "initialization", "." ]
inveniosoftware/invenio-oauthclient
python
https://github.com/inveniosoftware/invenio-oauthclient/blob/2500dc6935738107617aeade79e050d7608004bb/invenio_oauthclient/ext.py#L116-L121
[ "def", "init_app", "(", "self", ",", "app", ")", ":", "self", ".", "init_config", "(", "app", ")", "state", "=", "_OAuthClientState", "(", "app", ")", "app", ".", "extensions", "[", "'invenio-oauthclient'", "]", "=", "state", "return", "state" ]
2500dc6935738107617aeade79e050d7608004bb
train
InvenioOAuthClient.init_config
Initialize configuration.
invenio_oauthclient/ext.py
def init_config(self, app): """Initialize configuration.""" for k in dir(config): if k.startswith('OAUTHCLIENT_'): app.config.setdefault(k, getattr(config, k)) @app.before_first_request def override_template_configuration(): """Override template c...
def init_config(self, app): """Initialize configuration.""" for k in dir(config): if k.startswith('OAUTHCLIENT_'): app.config.setdefault(k, getattr(config, k)) @app.before_first_request def override_template_configuration(): """Override template c...
[ "Initialize", "configuration", "." ]
inveniosoftware/invenio-oauthclient
python
https://github.com/inveniosoftware/invenio-oauthclient/blob/2500dc6935738107617aeade79e050d7608004bb/invenio_oauthclient/ext.py#L123-L142
[ "def", "init_config", "(", "self", ",", "app", ")", ":", "for", "k", "in", "dir", "(", "config", ")", ":", "if", "k", ".", "startswith", "(", "'OAUTHCLIENT_'", ")", ":", "app", ".", "config", ".", "setdefault", "(", "k", ",", "getattr", "(", "confi...
2500dc6935738107617aeade79e050d7608004bb
train
spasser
Passes inputs with indecies in s. By default passes the whole inbox. Arguments: - s(sequence) [default: ``None``] The default translates to a range for all inputs of the "inbox" i.e. ``range(len(inbox))``
src/papy/util/func.py
def spasser(inbox, s=None): """ Passes inputs with indecies in s. By default passes the whole inbox. Arguments: - s(sequence) [default: ``None``] The default translates to a range for all inputs of the "inbox" i.e. ``range(len(inbox))`` """ seq = (s or range(len(inbox))) ret...
def spasser(inbox, s=None): """ Passes inputs with indecies in s. By default passes the whole inbox. Arguments: - s(sequence) [default: ``None``] The default translates to a range for all inputs of the "inbox" i.e. ``range(len(inbox))`` """ seq = (s or range(len(inbox))) ret...
[ "Passes", "inputs", "with", "indecies", "in", "s", ".", "By", "default", "passes", "the", "whole", "inbox", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L67-L78
[ "def", "spasser", "(", "inbox", ",", "s", "=", "None", ")", ":", "seq", "=", "(", "s", "or", "range", "(", "len", "(", "inbox", ")", ")", ")", "return", "[", "input_", "for", "i", ",", "input_", "in", "enumerate", "(", "inbox", ")", "if", "i", ...
708e50827b5db46bbea081982cb74b9b0e464064
train
szipper
Zips inputs from inbox with indicies in "s". By default zips the whole inbox (all indices). Arguments: - s(sequence) [default: ``None``]
src/papy/util/func.py
def szipper(inbox, s=None): """ Zips inputs from inbox with indicies in "s". By default zips the whole inbox (all indices). Arguments: - s(sequence) [default: ``None``] """ #TODO: test szipper return zip(*[input_ for i, input_ in enumerate(inbox) if i in s])
def szipper(inbox, s=None): """ Zips inputs from inbox with indicies in "s". By default zips the whole inbox (all indices). Arguments: - s(sequence) [default: ``None``] """ #TODO: test szipper return zip(*[input_ for i, input_ in enumerate(inbox) if i in s])
[ "Zips", "inputs", "from", "inbox", "with", "indicies", "in", "s", ".", "By", "default", "zips", "the", "whole", "inbox", "(", "all", "indices", ")", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L92-L103
[ "def", "szipper", "(", "inbox", ",", "s", "=", "None", ")", ":", "#TODO: test szipper", "return", "zip", "(", "*", "[", "input_", "for", "i", ",", "input_", "in", "enumerate", "(", "inbox", ")", "if", "i", "in", "s", "]", ")" ]
708e50827b5db46bbea081982cb74b9b0e464064
train
sjoiner
String joins input with indices in s. Arguments: - s(sequence) [default: ``None``] ``tuple`` or ``list`` of indices of the elements which will be joined. - join(``str``) [default: ``""``] String which will join the elements of the inbox i.e. ``join.join()``.
src/papy/util/func.py
def sjoiner(inbox, s=None, join=""): """ String joins input with indices in s. Arguments: - s(sequence) [default: ``None``] ``tuple`` or ``list`` of indices of the elements which will be joined. - join(``str``) [default: ``""``] String which will join the elements of the inbo...
def sjoiner(inbox, s=None, join=""): """ String joins input with indices in s. Arguments: - s(sequence) [default: ``None``] ``tuple`` or ``list`` of indices of the elements which will be joined. - join(``str``) [default: ``""``] String which will join the elements of the inbo...
[ "String", "joins", "input", "with", "indices", "in", "s", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L119-L131
[ "def", "sjoiner", "(", "inbox", ",", "s", "=", "None", ",", "join", "=", "\"\"", ")", ":", "return", "join", ".", "join", "(", "[", "input_", "for", "i", ",", "input_", "in", "enumerate", "(", "inbox", ")", "if", "i", "in", "s", "]", ")" ]
708e50827b5db46bbea081982cb74b9b0e464064
train
dump_stream
Writes the first element of the inbox to the provided stream (file handle) delimiting the input by the optional delimiter string. Returns the name of the file being written. Note that only a single process can have access to a file handle open for writing. Therefore this function should only be ...
src/papy/util/func.py
def dump_stream(inbox, handle, delimiter=None): """ Writes the first element of the inbox to the provided stream (file handle) delimiting the input by the optional delimiter string. Returns the name of the file being written. Note that only a single process can have access to a file handle op...
def dump_stream(inbox, handle, delimiter=None): """ Writes the first element of the inbox to the provided stream (file handle) delimiting the input by the optional delimiter string. Returns the name of the file being written. Note that only a single process can have access to a file handle op...
[ "Writes", "the", "first", "element", "of", "the", "inbox", "to", "the", "provided", "stream", "(", "file", "handle", ")", "delimiting", "the", "input", "by", "the", "optional", "delimiter", "string", ".", "Returns", "the", "name", "of", "the", "file", "bei...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L145-L166
[ "def", "dump_stream", "(", "inbox", ",", "handle", ",", "delimiter", "=", "None", ")", ":", "handle", ".", "write", "(", "inbox", "[", "0", "]", ")", "delimiter", "=", "'\\n%s\\n'", "%", "(", "delimiter", "or", "''", ")", "handle", ".", "write", "(",...
708e50827b5db46bbea081982cb74b9b0e464064
train
load_stream
Creates a string generator from a stream (file handle) containing data delimited by the delimiter strings. This is a stand-alone function and should be used to feed external data into a pipeline. Arguments: - hande(``file``) A file handle open for reading. - delimiter(``str``) [default: ``No...
src/papy/util/func.py
def load_stream(handle, delimiter=None): """ Creates a string generator from a stream (file handle) containing data delimited by the delimiter strings. This is a stand-alone function and should be used to feed external data into a pipeline. Arguments: - hande(``file``) A file handle open f...
def load_stream(handle, delimiter=None): """ Creates a string generator from a stream (file handle) containing data delimited by the delimiter strings. This is a stand-alone function and should be used to feed external data into a pipeline. Arguments: - hande(``file``) A file handle open f...
[ "Creates", "a", "string", "generator", "from", "a", "stream", "(", "file", "handle", ")", "containing", "data", "delimited", "by", "the", "delimiter", "strings", ".", "This", "is", "a", "stand", "-", "alone", "function", "and", "should", "be", "used", "to"...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L168-L194
[ "def", "load_stream", "(", "handle", ",", "delimiter", "=", "None", ")", ":", "delimiter", "=", "(", "delimiter", "or", "\"\"", ")", "+", "\"\\n\"", "while", "True", ":", "item", "=", "[", "]", "while", "True", ":", "line", "=", "handle", ".", "readl...
708e50827b5db46bbea081982cb74b9b0e464064
train
dump_item
Writes the first element of the inbox as a file of a specified type. The type can be 'file', 'fifo' or 'socket' corresponding to typical files, named pipes (FIFOs). FIFOs and TCP sockets and are volatile i.e. exists only as long as the Python process, which created them. FIFOs are local i.e. allow to...
src/papy/util/func.py
def dump_item(inbox, type='file', prefix=None, suffix=None, dir=None, \ timeout=320, buffer=None): """ Writes the first element of the inbox as a file of a specified type. The type can be 'file', 'fifo' or 'socket' corresponding to typical files, named pipes (FIFOs). FIFOs and TCP socke...
def dump_item(inbox, type='file', prefix=None, suffix=None, dir=None, \ timeout=320, buffer=None): """ Writes the first element of the inbox as a file of a specified type. The type can be 'file', 'fifo' or 'socket' corresponding to typical files, named pipes (FIFOs). FIFOs and TCP socke...
[ "Writes", "the", "first", "element", "of", "the", "inbox", "as", "a", "file", "of", "a", "specified", "type", ".", "The", "type", "can", "be", "file", "fifo", "or", "socket", "corresponding", "to", "typical", "files", "named", "pipes", "(", "FIFOs", ")",...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L230-L376
[ "def", "dump_item", "(", "inbox", ",", "type", "=", "'file'", ",", "prefix", "=", "None", ",", "suffix", "=", "None", ",", "dir", "=", "None", ",", "timeout", "=", "320", ",", "buffer", "=", "None", ")", ":", "# get a random filename generator", "names",...
708e50827b5db46bbea081982cb74b9b0e464064
train
load_item
Loads data from a file. Determines the file type automatically ``"file"``, ``"fifo"``, ``"socket"``, but allows to specify the representation type ``"string"`` or ``"mmap"`` for memory mapped access to the file. Returns the loaded item as a ``str`` or ``mmap`` object. Internally creates an item from ...
src/papy/util/func.py
def load_item(inbox, type="string", remove=True, buffer=None): """ Loads data from a file. Determines the file type automatically ``"file"``, ``"fifo"``, ``"socket"``, but allows to specify the representation type ``"string"`` or ``"mmap"`` for memory mapped access to the file. Returns the loaded...
def load_item(inbox, type="string", remove=True, buffer=None): """ Loads data from a file. Determines the file type automatically ``"file"``, ``"fifo"``, ``"socket"``, but allows to specify the representation type ``"string"`` or ``"mmap"`` for memory mapped access to the file. Returns the loaded...
[ "Loads", "data", "from", "a", "file", ".", "Determines", "the", "file", "type", "automatically", "file", "fifo", "socket", "but", "allows", "to", "specify", "the", "representation", "type", "string", "or", "mmap", "for", "memory", "mapped", "access", "to", "...
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L379-L478
[ "def", "load_item", "(", "inbox", ",", "type", "=", "\"string\"", ",", "remove", "=", "True", ",", "buffer", "=", "None", ")", ":", "is_file", ",", "is_fifo", ",", "is_socket", "=", "False", ",", "False", ",", "False", "file", "=", "inbox", "[", "0",...
708e50827b5db46bbea081982cb74b9b0e464064
train
make_lines
Creates a line generator from a stream (file handle) containing data in lines. Arguments: - follow(``bool``) [default: ``False``] If ``True`` follows the file after it finishes like 'tail -f'. - wait(``float``) [default: ``0.1``] time to wait in seconds between file polls.
src/papy/util/func.py
def make_lines(handle, follow=False, wait=0.1): """ Creates a line generator from a stream (file handle) containing data in lines. Arguments: - follow(``bool``) [default: ``False``] If ``True`` follows the file after it finishes like 'tail -f'. - wait(``float``) [default: ``0.1``]...
def make_lines(handle, follow=False, wait=0.1): """ Creates a line generator from a stream (file handle) containing data in lines. Arguments: - follow(``bool``) [default: ``False``] If ``True`` follows the file after it finishes like 'tail -f'. - wait(``float``) [default: ``0.1``]...
[ "Creates", "a", "line", "generator", "from", "a", "stream", "(", "file", "handle", ")", "containing", "data", "in", "lines", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L483-L503
[ "def", "make_lines", "(", "handle", ",", "follow", "=", "False", ",", "wait", "=", "0.1", ")", ":", "while", "True", ":", "line", "=", "handle", ".", "readline", "(", ")", "if", "line", ":", "yield", "line", "elif", "follow", ":", "time", ".", "sle...
708e50827b5db46bbea081982cb74b9b0e464064
train
pickle_dumps
Serializes the first element of the input using the pickle protocol using the fastes binary protocol.
src/papy/util/func.py
def pickle_dumps(inbox): """ Serializes the first element of the input using the pickle protocol using the fastes binary protocol. """ # http://bugs.python.org/issue4074 gc.disable() str_ = cPickle.dumps(inbox[0], cPickle.HIGHEST_PROTOCOL) gc.enable() return str_
def pickle_dumps(inbox): """ Serializes the first element of the input using the pickle protocol using the fastes binary protocol. """ # http://bugs.python.org/issue4074 gc.disable() str_ = cPickle.dumps(inbox[0], cPickle.HIGHEST_PROTOCOL) gc.enable() return str_
[ "Serializes", "the", "first", "element", "of", "the", "input", "using", "the", "pickle", "protocol", "using", "the", "fastes", "binary", "protocol", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L510-L520
[ "def", "pickle_dumps", "(", "inbox", ")", ":", "# http://bugs.python.org/issue4074", "gc", ".", "disable", "(", ")", "str_", "=", "cPickle", ".", "dumps", "(", "inbox", "[", "0", "]", ",", "cPickle", ".", "HIGHEST_PROTOCOL", ")", "gc", ".", "enable", "(", ...
708e50827b5db46bbea081982cb74b9b0e464064
train
pickle_loads
Deserializes the first element of the input using the pickle protocol.
src/papy/util/func.py
def pickle_loads(inbox): """ Deserializes the first element of the input using the pickle protocol. """ gc.disable() obj = cPickle.loads(inbox[0]) gc.enable() return obj
def pickle_loads(inbox): """ Deserializes the first element of the input using the pickle protocol. """ gc.disable() obj = cPickle.loads(inbox[0]) gc.enable() return obj
[ "Deserializes", "the", "first", "element", "of", "the", "input", "using", "the", "pickle", "protocol", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L523-L531
[ "def", "pickle_loads", "(", "inbox", ")", ":", "gc", ".", "disable", "(", ")", "obj", "=", "cPickle", ".", "loads", "(", "inbox", "[", "0", "]", ")", "gc", ".", "enable", "(", ")", "return", "obj" ]
708e50827b5db46bbea081982cb74b9b0e464064
train
json_dumps
Serializes the first element of the input using the JSON protocol as implemented by the ``json`` Python 2.6 library.
src/papy/util/func.py
def json_dumps(inbox): """ Serializes the first element of the input using the JSON protocol as implemented by the ``json`` Python 2.6 library. """ gc.disable() str_ = json.dumps(inbox[0]) gc.enable() return str_
def json_dumps(inbox): """ Serializes the first element of the input using the JSON protocol as implemented by the ``json`` Python 2.6 library. """ gc.disable() str_ = json.dumps(inbox[0]) gc.enable() return str_
[ "Serializes", "the", "first", "element", "of", "the", "input", "using", "the", "JSON", "protocol", "as", "implemented", "by", "the", "json", "Python", "2", ".", "6", "library", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L535-L544
[ "def", "json_dumps", "(", "inbox", ")", ":", "gc", ".", "disable", "(", ")", "str_", "=", "json", ".", "dumps", "(", "inbox", "[", "0", "]", ")", "gc", ".", "enable", "(", ")", "return", "str_" ]
708e50827b5db46bbea081982cb74b9b0e464064
train
json_loads
Deserializes the first element of the input using the JSON protocol as implemented by the ``json`` Python 2.6 library.
src/papy/util/func.py
def json_loads(inbox): """ Deserializes the first element of the input using the JSON protocol as implemented by the ``json`` Python 2.6 library. """ gc.disable() obj = json.loads(inbox[0]) gc.enable() return obj
def json_loads(inbox): """ Deserializes the first element of the input using the JSON protocol as implemented by the ``json`` Python 2.6 library. """ gc.disable() obj = json.loads(inbox[0]) gc.enable() return obj
[ "Deserializes", "the", "first", "element", "of", "the", "input", "using", "the", "JSON", "protocol", "as", "implemented", "by", "the", "json", "Python", "2", ".", "6", "library", "." ]
mcieslik-mctp/papy
python
https://github.com/mcieslik-mctp/papy/blob/708e50827b5db46bbea081982cb74b9b0e464064/src/papy/util/func.py#L547-L556
[ "def", "json_loads", "(", "inbox", ")", ":", "gc", ".", "disable", "(", ")", "obj", "=", "json", ".", "loads", "(", "inbox", "[", "0", "]", ")", "gc", ".", "enable", "(", ")", "return", "obj" ]
708e50827b5db46bbea081982cb74b9b0e464064
train
at_time_validate
Callback validating the at_time commit option. Purpose: Validates the `at time` option for the commit command. Only the | the following two formats are supported: 'hh:mm[:ss]' or | 'yyyy-mm-dd hh:mm[:ss]' (seconds are optional). @param ctx: The click context paramter, for receiving the o...
jaide/cli.py
def at_time_validate(ctx, param, value): """ Callback validating the at_time commit option. Purpose: Validates the `at time` option for the commit command. Only the | the following two formats are supported: 'hh:mm[:ss]' or | 'yyyy-mm-dd hh:mm[:ss]' (seconds are optional). @param ctx...
def at_time_validate(ctx, param, value): """ Callback validating the at_time commit option. Purpose: Validates the `at time` option for the commit command. Only the | the following two formats are supported: 'hh:mm[:ss]' or | 'yyyy-mm-dd hh:mm[:ss]' (seconds are optional). @param ctx...
[ "Callback", "validating", "the", "at_time", "commit", "option", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L54-L86
[ "def", "at_time_validate", "(", "ctx", ",", "param", ",", "value", ")", ":", "# if they are doing commit_at, ensure the input is formatted correctly.", "if", "value", "is", "not", "None", ":", "if", "(", "re", ".", "search", "(", "r'([0-2]\\d)(:[0-5]\\d){1,2}'", ",", ...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
write_validate
Validate the -w option. Purpose: Validates the `-w`|`--write` option. Two arguments are expected. | The first is the mode, which must be in ['s', 'single', 'm', | 'multiple']. The mode determins if we're writing to one file for | all device output, or to a separate file for each d...
jaide/cli.py
def write_validate(ctx, param, value): """ Validate the -w option. Purpose: Validates the `-w`|`--write` option. Two arguments are expected. | The first is the mode, which must be in ['s', 'single', 'm', | 'multiple']. The mode determins if we're writing to one file for | all ...
def write_validate(ctx, param, value): """ Validate the -w option. Purpose: Validates the `-w`|`--write` option. Two arguments are expected. | The first is the mode, which must be in ['s', 'single', 'm', | 'multiple']. The mode determins if we're writing to one file for | all ...
[ "Validate", "the", "-", "w", "option", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L90-L136
[ "def", "write_validate", "(", "ctx", ",", "param", ",", "value", ")", ":", "if", "value", "!=", "(", "\"default\"", ",", "\"default\"", ")", ":", "try", ":", "mode", ",", "dest_file", "=", "(", "value", "[", "0", "]", ",", "value", "[", "1", "]", ...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
write_out
Callback function to write the output from the script. @param input: A tuple containing two things: | 1. None or Tuple of file mode and destination filepath | 2. The output of the jaide command that will be either | written to sys.stdout or to a file, depending on...
jaide/cli.py
def write_out(input): """ Callback function to write the output from the script. @param input: A tuple containing two things: | 1. None or Tuple of file mode and destination filepath | 2. The output of the jaide command that will be either | written to sys.std...
def write_out(input): """ Callback function to write the output from the script. @param input: A tuple containing two things: | 1. None or Tuple of file mode and destination filepath | 2. The output of the jaide command that will be either | written to sys.std...
[ "Callback", "function", "to", "write", "the", "output", "from", "the", "script", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L139-L185
[ "def", "write_out", "(", "input", ")", ":", "# peel off the to_file metadata from the output.", "to_file", ",", "output", "=", "input", "if", "to_file", "!=", "\"quiet\"", ":", "try", ":", "# split the to_file metadata into it's separate parts.", "mode", ",", "dest_file",...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
main
Manipulate one or more Junos devices. Purpose: The main function is the entry point for the jaide tool. Click | handles arguments, commands and options. The parameters passed to | this function are all potential options (required or not) that | must come *before* the command from t...
jaide/cli.py
def main(ctx, host, password, port, quiet, session_timeout, connect_timeout, username): """ Manipulate one or more Junos devices. Purpose: The main function is the entry point for the jaide tool. Click | handles arguments, commands and options. The parameters passed to | this fun...
def main(ctx, host, password, port, quiet, session_timeout, connect_timeout, username): """ Manipulate one or more Junos devices. Purpose: The main function is the entry point for the jaide tool. Click | handles arguments, commands and options. The parameters passed to | this fun...
[ "Manipulate", "one", "or", "more", "Junos", "devices", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L222-L271
[ "def", "main", "(", "ctx", ",", "host", ",", "password", ",", "port", ",", "quiet", ",", "session_timeout", ",", "connect_timeout", ",", "username", ")", ":", "# build the list of hosts", "ctx", ".", "obj", "[", "'hosts'", "]", "=", "[", "ip", "for", "ip...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
commit
Execute a commit against the device. Purpose: This function will send set commands to a device, and commit | the changes. Options exist for confirming, comments, | synchronizing, checking, blank commits, or delaying to a later | time/date. @param ctx: The click context paramte...
jaide/cli.py
def commit(ctx, commands, blank, check, sync, comment, confirm, at_time): """ Execute a commit against the device. Purpose: This function will send set commands to a device, and commit | the changes. Options exist for confirming, comments, | synchronizing, checking, blank commits, or dela...
def commit(ctx, commands, blank, check, sync, comment, confirm, at_time): """ Execute a commit against the device. Purpose: This function will send set commands to a device, and commit | the changes. Options exist for confirming, comments, | synchronizing, checking, blank commits, or dela...
[ "Execute", "a", "commit", "against", "the", "device", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L302-L366
[ "def", "commit", "(", "ctx", ",", "commands", ",", "blank", ",", "check", ",", "sync", ",", "comment", ",", "confirm", ",", "at_time", ")", ":", "if", "not", "blank", "and", "commands", "==", "'annotate system \"\"'", ":", "raise", "click", ".", "BadPara...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
compare
Run 'show | compare' for set commands. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type ctx: click.Context @param commands: The Juno...
jaide/cli.py
def compare(ctx, commands): """ Run 'show | compare' for set commands. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type ctx: click.C...
def compare(ctx, commands): """ Run 'show | compare' for set commands. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type ctx: click.C...
[ "Run", "show", "|", "compare", "for", "set", "commands", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L376-L408
[ "def", "compare", "(", "ctx", ",", "commands", ")", ":", "mp_pool", "=", "multiprocessing", ".", "Pool", "(", "multiprocessing", ".", "cpu_count", "(", ")", "*", "2", ")", "for", "ip", "in", "ctx", ".", "obj", "[", "'hosts'", "]", ":", "mp_pool", "."...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
pull
Copy file(s) from device(s) -> local machine. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type ctx: click.Context @param source: the...
jaide/cli.py
def pull(ctx, source, destination, progress): """ Copy file(s) from device(s) -> local machine. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorato...
def pull(ctx, source, destination, progress): """ Copy file(s) from device(s) -> local machine. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorato...
[ "Copy", "file", "(", "s", ")", "from", "device", "(", "s", ")", "-", ">", "local", "machine", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L421-L453
[ "def", "pull", "(", "ctx", ",", "source", ",", "destination", ",", "progress", ")", ":", "mp_pool", "=", "multiprocessing", ".", "Pool", "(", "multiprocessing", ".", "cpu_count", "(", ")", "*", "2", ")", "multi", "=", "True", "if", "len", "(", "ctx", ...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
push
Copy file(s) from local machine -> device(s). @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type ctx: click.Context @param source: the...
jaide/cli.py
def push(ctx, source, destination, progress): """ Copy file(s) from local machine -> device(s). @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorato...
def push(ctx, source, destination, progress): """ Copy file(s) from local machine -> device(s). @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorato...
[ "Copy", "file", "(", "s", ")", "from", "local", "machine", "-", ">", "device", "(", "s", ")", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L466-L497
[ "def", "push", "(", "ctx", ",", "source", ",", "destination", ",", "progress", ")", ":", "mp_pool", "=", "multiprocessing", ".", "Pool", "(", "multiprocessing", ".", "cpu_count", "(", ")", "*", "2", ")", "for", "ip", "in", "ctx", ".", "obj", "[", "'h...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
operational
Execute operational mode command(s). This function will send operational mode commands to a Junos device. jaide.utils.clean_lines() is used to determine how we are receiving commands, and ignore comment lines or blank lines in a command file. @param ctx: The click context paramter, for receiving t...
jaide/cli.py
def operational(ctx, commands, format, xpath): """ Execute operational mode command(s). This function will send operational mode commands to a Junos device. jaide.utils.clean_lines() is used to determine how we are receiving commands, and ignore comment lines or blank lines in a command file. ...
def operational(ctx, commands, format, xpath): """ Execute operational mode command(s). This function will send operational mode commands to a Junos device. jaide.utils.clean_lines() is used to determine how we are receiving commands, and ignore comment lines or blank lines in a command file. ...
[ "Execute", "operational", "mode", "command", "(", "s", ")", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L511-L554
[ "def", "operational", "(", "ctx", ",", "commands", ",", "format", ",", "xpath", ")", ":", "mp_pool", "=", "multiprocessing", ".", "Pool", "(", "multiprocessing", ".", "cpu_count", "(", ")", "*", "2", ")", "for", "ip", "in", "ctx", ".", "obj", "[", "'...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
diff_config
Config comparison between two devices. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type ctx: click.Context @param second_host: The I...
jaide/cli.py
def diff_config(ctx, second_host, mode): """ Config comparison between two devices. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type...
def diff_config(ctx, second_host, mode): """ Config comparison between two devices. @param ctx: The click context paramter, for receiving the object dictionary | being manipulated by other previous functions. Needed by any | function with the @click.pass_context decorator. @type...
[ "Config", "comparison", "between", "two", "devices", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L593-L621
[ "def", "diff_config", "(", "ctx", ",", "second_host", ",", "mode", ")", ":", "mp_pool", "=", "multiprocessing", ".", "Pool", "(", "multiprocessing", ".", "cpu_count", "(", ")", "*", "2", ")", "for", "ip", "in", "ctx", ".", "obj", "[", "'hosts'", "]", ...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
AliasedGroup.get_command
Allow for partial commands.
jaide/cli.py
def get_command(self, ctx, cmd_name): """ Allow for partial commands. """ rv = click.Group.get_command(self, ctx, cmd_name) if rv is not None: return rv matches = [x for x in self.list_commands(ctx) if x.startswith(cmd_name)] if not matches: ...
def get_command(self, ctx, cmd_name): """ Allow for partial commands. """ rv = click.Group.get_command(self, ctx, cmd_name) if rv is not None: return rv matches = [x for x in self.list_commands(ctx) if x.startswith(cmd_name)] if not matches: ...
[ "Allow", "for", "partial", "commands", "." ]
NetworkAutomation/jaide
python
https://github.com/NetworkAutomation/jaide/blob/8571b987a8c24c246dc09f1bcc11cb0f045ec33f/jaide/cli.py#L39-L51
[ "def", "get_command", "(", "self", ",", "ctx", ",", "cmd_name", ")", ":", "rv", "=", "click", ".", "Group", ".", "get_command", "(", "self", ",", "ctx", ",", "cmd_name", ")", "if", "rv", "is", "not", "None", ":", "return", "rv", "matches", "=", "["...
8571b987a8c24c246dc09f1bcc11cb0f045ec33f
train
convert
Converts a value from `from_unit` units to `to_unit` units :param value: value to convert :type value: int or str or decimal.Decimal :param from_unit: unit to convert from :type from_unit: str :param to_unit: unit to convert to :type to_unit: str >>> convert(value='1.5', from_unit='xrb',...
src/nano/conversion.py
def convert(value, from_unit, to_unit): """ Converts a value from `from_unit` units to `to_unit` units :param value: value to convert :type value: int or str or decimal.Decimal :param from_unit: unit to convert from :type from_unit: str :param to_unit: unit to convert to :type to_unit...
def convert(value, from_unit, to_unit): """ Converts a value from `from_unit` units to `to_unit` units :param value: value to convert :type value: int or str or decimal.Decimal :param from_unit: unit to convert from :type from_unit: str :param to_unit: unit to convert to :type to_unit...
[ "Converts", "a", "value", "from", "from_unit", "units", "to", "to_unit", "units" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/conversion.py#L45-L85
[ "def", "convert", "(", "value", ",", "from_unit", ",", "to_unit", ")", ":", "if", "isinstance", "(", "value", ",", "float", ")", ":", "raise", "ValueError", "(", "\"float values can lead to unexpected precision loss, please use a\"", "\" Decimal or string eg.\"", "\" co...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.status
Get etcd status. :param timeout: Request timeout in seconds. :type timeout: int :returns: The current etcd cluster status. :rtype: instance of :class:`txaioetcd.Status`
txaioetcd/_client_pg.py
def status(self, timeout=None): """ Get etcd status. :param timeout: Request timeout in seconds. :type timeout: int :returns: The current etcd cluster status. :rtype: instance of :class:`txaioetcd.Status` """ def run(txn): txn.execute("SELEC...
def status(self, timeout=None): """ Get etcd status. :param timeout: Request timeout in seconds. :type timeout: int :returns: The current etcd cluster status. :rtype: instance of :class:`txaioetcd.Status` """ def run(txn): txn.execute("SELEC...
[ "Get", "etcd", "status", "." ]
crossbario/txaio-etcd
python
https://github.com/crossbario/txaio-etcd/blob/c9aebff7f288a0b219bffc9d2579d22cf543baa5/txaioetcd/_client_pg.py#L122-L139
[ "def", "status", "(", "self", ",", "timeout", "=", "None", ")", ":", "def", "run", "(", "txn", ")", ":", "txn", ".", "execute", "(", "\"SELECT now()\"", ")", "rows", "=", "txn", ".", "fetchall", "(", ")", "res", "=", "\"{0}\"", ".", "format", "(", ...
c9aebff7f288a0b219bffc9d2579d22cf543baa5
train
Client.get
Range gets the keys in the range from the key-value store. :param key: key is the first key for the range. If range_end is not given, the request only looks up key. :type key: bytes :param range_end: range_end is the upper bound on the requested range [key, range_end). ...
txaioetcd/_client_pg.py
def get(self, key, range_end=None, count_only=None, keys_only=None, limit=None, max_create_revision=None, min_create_revision=None, min_mod_revision=None, revision=None, serializable=None, ...
def get(self, key, range_end=None, count_only=None, keys_only=None, limit=None, max_create_revision=None, min_create_revision=None, min_mod_revision=None, revision=None, serializable=None, ...
[ "Range", "gets", "the", "keys", "in", "the", "range", "from", "the", "key", "-", "value", "store", "." ]
crossbario/txaio-etcd
python
https://github.com/crossbario/txaio-etcd/blob/c9aebff7f288a0b219bffc9d2579d22cf543baa5/txaioetcd/_client_pg.py#L173-L261
[ "def", "get", "(", "self", ",", "key", ",", "range_end", "=", "None", ",", "count_only", "=", "None", ",", "keys_only", "=", "None", ",", "limit", "=", "None", ",", "max_create_revision", "=", "None", ",", "min_create_revision", "=", "None", ",", "min_mo...
c9aebff7f288a0b219bffc9d2579d22cf543baa5
train
Client.submit
Submit a transaction. Processes multiple requests in a single transaction. A transaction increments the revision of the key-value store and generates events with the same revision for every completed request. It is not allowed to modify the same key several times within...
txaioetcd/_client_pg.py
def submit(self, txn, timeout=None): """ Submit a transaction. Processes multiple requests in a single transaction. A transaction increments the revision of the key-value store and generates events with the same revision for every completed request. It is not al...
def submit(self, txn, timeout=None): """ Submit a transaction. Processes multiple requests in a single transaction. A transaction increments the revision of the key-value store and generates events with the same revision for every completed request. It is not al...
[ "Submit", "a", "transaction", "." ]
crossbario/txaio-etcd
python
https://github.com/crossbario/txaio-etcd/blob/c9aebff7f288a0b219bffc9d2579d22cf543baa5/txaioetcd/_client_pg.py#L310-L367
[ "def", "submit", "(", "self", ",", "txn", ",", "timeout", "=", "None", ")", ":", "def", "run", "(", "pg_txn", ")", ":", "val", "=", "Json", "(", "txn", ".", "_marshal", "(", ")", ")", "pg_txn", ".", "execute", "(", "\"SELECT pgetcd.submit(%s,%s)\"", ...
c9aebff7f288a0b219bffc9d2579d22cf543baa5
train
endpoint
Endpoint that SNS accesses. Includes logic verifying request
django_bouncy/views.py
def endpoint(request): """Endpoint that SNS accesses. Includes logic verifying request""" # pylint: disable=too-many-return-statements,too-many-branches # In order to 'hide' the endpoint, all non-POST requests should return # the site's default HTTP404 if request.method != 'POST': raise Htt...
def endpoint(request): """Endpoint that SNS accesses. Includes logic verifying request""" # pylint: disable=too-many-return-statements,too-many-branches # In order to 'hide' the endpoint, all non-POST requests should return # the site's default HTTP404 if request.method != 'POST': raise Htt...
[ "Endpoint", "that", "SNS", "accesses", ".", "Includes", "logic", "verifying", "request" ]
ofa/django-bouncy
python
https://github.com/ofa/django-bouncy/blob/a386dfa8c4ce59bd18978a3537c03cd6ad07bf06/django_bouncy/views.py#L38-L128
[ "def", "endpoint", "(", "request", ")", ":", "# pylint: disable=too-many-return-statements,too-many-branches", "# In order to 'hide' the endpoint, all non-POST requests should return", "# the site's default HTTP404", "if", "request", ".", "method", "!=", "'POST'", ":", "raise", "Ht...
a386dfa8c4ce59bd18978a3537c03cd6ad07bf06
train
process_message
Function to process a JSON message delivered from Amazon
django_bouncy/views.py
def process_message(message, notification): """ Function to process a JSON message delivered from Amazon """ # Confirm that there are 'notificationType' and 'mail' fields in our # message if not set(VITAL_MESSAGE_FIELDS) <= set(message): # At this point we're sure that it's Amazon sendin...
def process_message(message, notification): """ Function to process a JSON message delivered from Amazon """ # Confirm that there are 'notificationType' and 'mail' fields in our # message if not set(VITAL_MESSAGE_FIELDS) <= set(message): # At this point we're sure that it's Amazon sendin...
[ "Function", "to", "process", "a", "JSON", "message", "delivered", "from", "Amazon" ]
ofa/django-bouncy
python
https://github.com/ofa/django-bouncy/blob/a386dfa8c4ce59bd18978a3537c03cd6ad07bf06/django_bouncy/views.py#L131-L151
[ "def", "process_message", "(", "message", ",", "notification", ")", ":", "# Confirm that there are 'notificationType' and 'mail' fields in our", "# message", "if", "not", "set", "(", "VITAL_MESSAGE_FIELDS", ")", "<=", "set", "(", "message", ")", ":", "# At this point we'r...
a386dfa8c4ce59bd18978a3537c03cd6ad07bf06
train
process_bounce
Function to process a bounce notification
django_bouncy/views.py
def process_bounce(message, notification): """Function to process a bounce notification""" mail = message['mail'] bounce = message['bounce'] bounces = [] for recipient in bounce['bouncedRecipients']: # Create each bounce record. Add to a list for reference later. bounces += [Bounce....
def process_bounce(message, notification): """Function to process a bounce notification""" mail = message['mail'] bounce = message['bounce'] bounces = [] for recipient in bounce['bouncedRecipients']: # Create each bounce record. Add to a list for reference later. bounces += [Bounce....
[ "Function", "to", "process", "a", "bounce", "notification" ]
ofa/django-bouncy
python
https://github.com/ofa/django-bouncy/blob/a386dfa8c4ce59bd18978a3537c03cd6ad07bf06/django_bouncy/views.py#L154-L191
[ "def", "process_bounce", "(", "message", ",", "notification", ")", ":", "mail", "=", "message", "[", "'mail'", "]", "bounce", "=", "message", "[", "'bounce'", "]", "bounces", "=", "[", "]", "for", "recipient", "in", "bounce", "[", "'bouncedRecipients'", "]...
a386dfa8c4ce59bd18978a3537c03cd6ad07bf06
train
process_complaint
Function to process a complaint notification
django_bouncy/views.py
def process_complaint(message, notification): """Function to process a complaint notification""" mail = message['mail'] complaint = message['complaint'] if 'arrivalDate' in complaint: arrival_date = clean_time(complaint['arrivalDate']) else: arrival_date = None complaints = [] ...
def process_complaint(message, notification): """Function to process a complaint notification""" mail = message['mail'] complaint = message['complaint'] if 'arrivalDate' in complaint: arrival_date = clean_time(complaint['arrivalDate']) else: arrival_date = None complaints = [] ...
[ "Function", "to", "process", "a", "complaint", "notification" ]
ofa/django-bouncy
python
https://github.com/ofa/django-bouncy/blob/a386dfa8c4ce59bd18978a3537c03cd6ad07bf06/django_bouncy/views.py#L194-L232
[ "def", "process_complaint", "(", "message", ",", "notification", ")", ":", "mail", "=", "message", "[", "'mail'", "]", "complaint", "=", "message", "[", "'complaint'", "]", "if", "'arrivalDate'", "in", "complaint", ":", "arrival_date", "=", "clean_time", "(", ...
a386dfa8c4ce59bd18978a3537c03cd6ad07bf06
train
process_delivery
Function to process a delivery notification
django_bouncy/views.py
def process_delivery(message, notification): """Function to process a delivery notification""" mail = message['mail'] delivery = message['delivery'] if 'timestamp' in delivery: delivered_datetime = clean_time(delivery['timestamp']) else: delivered_datetime = None deliveries = [...
def process_delivery(message, notification): """Function to process a delivery notification""" mail = message['mail'] delivery = message['delivery'] if 'timestamp' in delivery: delivered_datetime = clean_time(delivery['timestamp']) else: delivered_datetime = None deliveries = [...
[ "Function", "to", "process", "a", "delivery", "notification" ]
ofa/django-bouncy
python
https://github.com/ofa/django-bouncy/blob/a386dfa8c4ce59bd18978a3537c03cd6ad07bf06/django_bouncy/views.py#L235-L272
[ "def", "process_delivery", "(", "message", ",", "notification", ")", ":", "mail", "=", "message", "[", "'mail'", "]", "delivery", "=", "message", "[", "'delivery'", "]", "if", "'timestamp'", "in", "delivery", ":", "delivered_datetime", "=", "clean_time", "(", ...
a386dfa8c4ce59bd18978a3537c03cd6ad07bf06
train
click_on_label
Click on a label
lettuce_webdriver/webdriver.py
def click_on_label(step, label): """ Click on a label """ with AssertContextManager(step): elem = world.browser.find_element_by_xpath(str( '//label[normalize-space(text()) = "%s"]' % label)) elem.click()
def click_on_label(step, label): """ Click on a label """ with AssertContextManager(step): elem = world.browser.find_element_by_xpath(str( '//label[normalize-space(text()) = "%s"]' % label)) elem.click()
[ "Click", "on", "a", "label" ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L258-L266
[ "def", "click_on_label", "(", "step", ",", "label", ")", ":", "with", "AssertContextManager", "(", "step", ")", ":", "elem", "=", "world", ".", "browser", ".", "find_element_by_xpath", "(", "str", "(", "'//label[normalize-space(text()) = \"%s\"]'", "%", "label", ...
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
element_focused
Check if the element is focused
lettuce_webdriver/webdriver.py
def element_focused(step, id): """ Check if the element is focused """ elem = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) focused = world.browser.switch_to_active_element() assert_true(step, elem == focused)
def element_focused(step, id): """ Check if the element is focused """ elem = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) focused = world.browser.switch_to_active_element() assert_true(step, elem == focused)
[ "Check", "if", "the", "element", "is", "focused" ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L270-L278
[ "def", "element_focused", "(", "step", ",", "id", ")", ":", "elem", "=", "world", ".", "browser", ".", "find_element_by_xpath", "(", "str", "(", "'id(\"{id}\")'", ".", "format", "(", "id", "=", "id", ")", ")", ")", "focused", "=", "world", ".", "browse...
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
element_not_focused
Check if the element is not focused
lettuce_webdriver/webdriver.py
def element_not_focused(step, id): """ Check if the element is not focused """ elem = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) focused = world.browser.switch_to_active_element() assert_false(step, elem == focused)
def element_not_focused(step, id): """ Check if the element is not focused """ elem = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) focused = world.browser.switch_to_active_element() assert_false(step, elem == focused)
[ "Check", "if", "the", "element", "is", "not", "focused" ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L282-L290
[ "def", "element_not_focused", "(", "step", ",", "id", ")", ":", "elem", "=", "world", ".", "browser", ".", "find_element_by_xpath", "(", "str", "(", "'id(\"{id}\")'", ".", "format", "(", "id", "=", "id", ")", ")", ")", "focused", "=", "world", ".", "br...
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
input_has_value
Check that the form input element has given value.
lettuce_webdriver/webdriver.py
def input_has_value(step, field_name, value): """ Check that the form input element has given value. """ with AssertContextManager(step): text_field = find_any_field(world.browser, DATE_FIELDS + TEXT_FIELDS, field_name) ...
def input_has_value(step, field_name, value): """ Check that the form input element has given value. """ with AssertContextManager(step): text_field = find_any_field(world.browser, DATE_FIELDS + TEXT_FIELDS, field_name) ...
[ "Check", "that", "the", "form", "input", "element", "has", "given", "value", "." ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L294-L304
[ "def", "input_has_value", "(", "step", ",", "field_name", ",", "value", ")", ":", "with", "AssertContextManager", "(", "step", ")", ":", "text_field", "=", "find_any_field", "(", "world", ".", "browser", ",", "DATE_FIELDS", "+", "TEXT_FIELDS", ",", "field_name...
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
submit_form_id
Submit the form having given id.
lettuce_webdriver/webdriver.py
def submit_form_id(step, id): """ Submit the form having given id. """ form = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) form.submit()
def submit_form_id(step, id): """ Submit the form having given id. """ form = world.browser.find_element_by_xpath(str('id("{id}")'.format(id=id))) form.submit()
[ "Submit", "the", "form", "having", "given", "id", "." ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L317-L322
[ "def", "submit_form_id", "(", "step", ",", "id", ")", ":", "form", "=", "world", ".", "browser", ".", "find_element_by_xpath", "(", "str", "(", "'id(\"{id}\")'", ".", "format", "(", "id", "=", "id", ")", ")", ")", "form", ".", "submit", "(", ")" ]
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
submit_form_action
Submit the form having given action URL.
lettuce_webdriver/webdriver.py
def submit_form_action(step, url): """ Submit the form having given action URL. """ form = world.browser.find_element_by_xpath(str('//form[@action="%s"]' % url)) form.submit()
def submit_form_action(step, url): """ Submit the form having given action URL. """ form = world.browser.find_element_by_xpath(str('//form[@action="%s"]' % url)) form.submit()
[ "Submit", "the", "form", "having", "given", "action", "URL", "." ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L326-L332
[ "def", "submit_form_action", "(", "step", ",", "url", ")", ":", "form", "=", "world", ".", "browser", ".", "find_element_by_xpath", "(", "str", "(", "'//form[@action=\"%s\"]'", "%", "url", ")", ")", "form", ".", "submit", "(", ")" ]
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
check_alert
Check the alert text
lettuce_webdriver/webdriver.py
def check_alert(step, text): """ Check the alert text """ try: alert = Alert(world.browser) assert_equals(alert.text, text) except WebDriverException: # PhantomJS is kinda poor pass
def check_alert(step, text): """ Check the alert text """ try: alert = Alert(world.browser) assert_equals(alert.text, text) except WebDriverException: # PhantomJS is kinda poor pass
[ "Check", "the", "alert", "text" ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L472-L482
[ "def", "check_alert", "(", "step", ",", "text", ")", ":", "try", ":", "alert", "=", "Alert", "(", "world", ".", "browser", ")", "assert_equals", "(", "alert", ".", "text", ",", "text", ")", "except", "WebDriverException", ":", "# PhantomJS is kinda poor", ...
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
see_tooltip
Press a button having a given tooltip.
lettuce_webdriver/webdriver.py
def see_tooltip(step, tooltip): """ Press a button having a given tooltip. """ elem = world.browser.find_elements_by_xpath(str( '//*[@title="%(tooltip)s" or @data-original-title="%(tooltip)s"]' % dict(tooltip=tooltip))) elem = [e for e in elem if e.is_displayed()] assert_true(ste...
def see_tooltip(step, tooltip): """ Press a button having a given tooltip. """ elem = world.browser.find_elements_by_xpath(str( '//*[@title="%(tooltip)s" or @data-original-title="%(tooltip)s"]' % dict(tooltip=tooltip))) elem = [e for e in elem if e.is_displayed()] assert_true(ste...
[ "Press", "a", "button", "having", "a", "given", "tooltip", "." ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L501-L509
[ "def", "see_tooltip", "(", "step", ",", "tooltip", ")", ":", "elem", "=", "world", ".", "browser", ".", "find_elements_by_xpath", "(", "str", "(", "'//*[@title=\"%(tooltip)s\" or @data-original-title=\"%(tooltip)s\"]'", "%", "dict", "(", "tooltip", "=", "tooltip", "...
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
press_by_tooltip
Press a button having a given tooltip.
lettuce_webdriver/webdriver.py
def press_by_tooltip(step, tooltip): """ Press a button having a given tooltip. """ with AssertContextManager(step): for button in world.browser.find_elements_by_xpath(str( '//*[@title="%(tooltip)s" or @data-original-title="%(tooltip)s"]' % dict(tooltip=tooltip))): ...
def press_by_tooltip(step, tooltip): """ Press a button having a given tooltip. """ with AssertContextManager(step): for button in world.browser.find_elements_by_xpath(str( '//*[@title="%(tooltip)s" or @data-original-title="%(tooltip)s"]' % dict(tooltip=tooltip))): ...
[ "Press", "a", "button", "having", "a", "given", "tooltip", "." ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L525-L540
[ "def", "press_by_tooltip", "(", "step", ",", "tooltip", ")", ":", "with", "AssertContextManager", "(", "step", ")", ":", "for", "button", "in", "world", ".", "browser", ".", "find_elements_by_xpath", "(", "str", "(", "'//*[@title=\"%(tooltip)s\" or @data-original-ti...
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
page_title
Check that the page title matches the given one.
lettuce_webdriver/webdriver.py
def page_title(step, title): """ Check that the page title matches the given one. """ with AssertContextManager(step): assert_equals(world.browser.title, title)
def page_title(step, title): """ Check that the page title matches the given one. """ with AssertContextManager(step): assert_equals(world.browser.title, title)
[ "Check", "that", "the", "page", "title", "matches", "the", "given", "one", "." ]
bbangert/lettuce_webdriver
python
https://github.com/bbangert/lettuce_webdriver/blob/d11f8531c43bb7150c316e0dc4ccd083617becf7/lettuce_webdriver/webdriver.py#L544-L550
[ "def", "page_title", "(", "step", ",", "title", ")", ":", "with", "AssertContextManager", "(", "step", ")", ":", "assert_equals", "(", "world", ".", "browser", ".", "title", ",", "title", ")" ]
d11f8531c43bb7150c316e0dc4ccd083617becf7
train
TagsService.list
Get a list of tags. :param resource: (optional) Restrict to given resource type as string. :param sort: (optional) Sort fields to apply as string list. :return: :class:`tags.Tag <tags.Tag>` list
cdrouter/tags.py
def list(self, resource=None, sort=None): """Get a list of tags. :param resource: (optional) Restrict to given resource type as string. :param sort: (optional) Sort fields to apply as string list. :return: :class:`tags.Tag <tags.Tag>` list """ schema = TagSchema() ...
def list(self, resource=None, sort=None): """Get a list of tags. :param resource: (optional) Restrict to given resource type as string. :param sort: (optional) Sort fields to apply as string list. :return: :class:`tags.Tag <tags.Tag>` list """ schema = TagSchema() ...
[ "Get", "a", "list", "of", "tags", "." ]
qacafe/cdrouter.py
python
https://github.com/qacafe/cdrouter.py/blob/aacf2c6ab0b987250f7b1892f4bba14bb2b7dbe5/cdrouter/tags.py#L82-L91
[ "def", "list", "(", "self", ",", "resource", "=", "None", ",", "sort", "=", "None", ")", ":", "schema", "=", "TagSchema", "(", ")", "resp", "=", "self", ".", "service", ".", "get", "(", "self", ".", "base", ",", "params", "=", "{", "'resource'", ...
aacf2c6ab0b987250f7b1892f4bba14bb2b7dbe5
train
TagsService.get
Get a tag. :param name: Tag name as string. :return: :class:`tags.Tag <tags.Tag>` object :rtype: tags.Tag
cdrouter/tags.py
def get(self, name): """Get a tag. :param name: Tag name as string. :return: :class:`tags.Tag <tags.Tag>` object :rtype: tags.Tag """ schema = TagSchema() resp = self.service.get_id(self.base, name) return self.service.decode(schema, resp)
def get(self, name): """Get a tag. :param name: Tag name as string. :return: :class:`tags.Tag <tags.Tag>` object :rtype: tags.Tag """ schema = TagSchema() resp = self.service.get_id(self.base, name) return self.service.decode(schema, resp)
[ "Get", "a", "tag", "." ]
qacafe/cdrouter.py
python
https://github.com/qacafe/cdrouter.py/blob/aacf2c6ab0b987250f7b1892f4bba14bb2b7dbe5/cdrouter/tags.py#L93-L102
[ "def", "get", "(", "self", ",", "name", ")", ":", "schema", "=", "TagSchema", "(", ")", "resp", "=", "self", ".", "service", ".", "get_id", "(", "self", ".", "base", ",", "name", ")", "return", "self", ".", "service", ".", "decode", "(", "schema", ...
aacf2c6ab0b987250f7b1892f4bba14bb2b7dbe5
train
TagsService.edit
Edit a tag. :param resource: :class:`tags.Tag <tags.Tag>` object :return: :class:`tags.Tag <tags.Tag>` object :rtype: tags.Tag
cdrouter/tags.py
def edit(self, resource): """Edit a tag. :param resource: :class:`tags.Tag <tags.Tag>` object :return: :class:`tags.Tag <tags.Tag>` object :rtype: tags.Tag """ schema = TagSchema(only=('name', 'configs', 'devices', 'packages', 'results')) json = self.service.enco...
def edit(self, resource): """Edit a tag. :param resource: :class:`tags.Tag <tags.Tag>` object :return: :class:`tags.Tag <tags.Tag>` object :rtype: tags.Tag """ schema = TagSchema(only=('name', 'configs', 'devices', 'packages', 'results')) json = self.service.enco...
[ "Edit", "a", "tag", "." ]
qacafe/cdrouter.py
python
https://github.com/qacafe/cdrouter.py/blob/aacf2c6ab0b987250f7b1892f4bba14bb2b7dbe5/cdrouter/tags.py#L104-L116
[ "def", "edit", "(", "self", ",", "resource", ")", ":", "schema", "=", "TagSchema", "(", "only", "=", "(", "'name'", ",", "'configs'", ",", "'devices'", ",", "'packages'", ",", "'results'", ")", ")", "json", "=", "self", ".", "service", ".", "encode", ...
aacf2c6ab0b987250f7b1892f4bba14bb2b7dbe5
train
Lease.remaining
Get the remaining time-to-live of this lease. :returns: TTL in seconds. :rtype: int
txaioetcd/_lease.py
def remaining(self): """ Get the remaining time-to-live of this lease. :returns: TTL in seconds. :rtype: int """ if self._expired: raise Expired() obj = { u'ID': self.lease_id, } data = json.dumps(obj).encode('utf8') ...
def remaining(self): """ Get the remaining time-to-live of this lease. :returns: TTL in seconds. :rtype: int """ if self._expired: raise Expired() obj = { u'ID': self.lease_id, } data = json.dumps(obj).encode('utf8') ...
[ "Get", "the", "remaining", "time", "-", "to", "-", "live", "of", "this", "lease", "." ]
crossbario/txaio-etcd
python
https://github.com/crossbario/txaio-etcd/blob/c9aebff7f288a0b219bffc9d2579d22cf543baa5/txaioetcd/_lease.py#L85-L113
[ "def", "remaining", "(", "self", ")", ":", "if", "self", ".", "_expired", ":", "raise", "Expired", "(", ")", "obj", "=", "{", "u'ID'", ":", "self", ".", "lease_id", ",", "}", "data", "=", "json", ".", "dumps", "(", "obj", ")", ".", "encode", "(",...
c9aebff7f288a0b219bffc9d2579d22cf543baa5
train
Lease.revoke
Revokes a lease. All keys attached to the lease will expire and be deleted. :returns: Response header. :rtype: instance of :class:`txaioetcd.Header`
txaioetcd/_lease.py
def revoke(self): """ Revokes a lease. All keys attached to the lease will expire and be deleted. :returns: Response header. :rtype: instance of :class:`txaioetcd.Header` """ if self._expired: raise Expired() obj = { # ID is the l...
def revoke(self): """ Revokes a lease. All keys attached to the lease will expire and be deleted. :returns: Response header. :rtype: instance of :class:`txaioetcd.Header` """ if self._expired: raise Expired() obj = { # ID is the l...
[ "Revokes", "a", "lease", ".", "All", "keys", "attached", "to", "the", "lease", "will", "expire", "and", "be", "deleted", "." ]
crossbario/txaio-etcd
python
https://github.com/crossbario/txaio-etcd/blob/c9aebff7f288a0b219bffc9d2579d22cf543baa5/txaioetcd/_lease.py#L146-L173
[ "def", "revoke", "(", "self", ")", ":", "if", "self", ".", "_expired", ":", "raise", "Expired", "(", ")", "obj", "=", "{", "# ID is the lease ID to revoke. When the ID is revoked, all", "# associated keys will be deleted.", "u'ID'", ":", "self", ".", "lease_id", ","...
c9aebff7f288a0b219bffc9d2579d22cf543baa5
train
Lease.refresh
Keeps the lease alive by streaming keep alive requests from the client to the server and streaming keep alive responses from the server to the client. :returns: Response header. :rtype: instance of :class:`txaioetcd.Header`
txaioetcd/_lease.py
def refresh(self): """ Keeps the lease alive by streaming keep alive requests from the client to the server and streaming keep alive responses from the server to the client. :returns: Response header. :rtype: instance of :class:`txaioetcd.Header` """ if s...
def refresh(self): """ Keeps the lease alive by streaming keep alive requests from the client to the server and streaming keep alive responses from the server to the client. :returns: Response header. :rtype: instance of :class:`txaioetcd.Header` """ if s...
[ "Keeps", "the", "lease", "alive", "by", "streaming", "keep", "alive", "requests", "from", "the", "client", "to", "the", "server", "and", "streaming", "keep", "alive", "responses", "from", "the", "server", "to", "the", "client", "." ]
crossbario/txaio-etcd
python
https://github.com/crossbario/txaio-etcd/blob/c9aebff7f288a0b219bffc9d2579d22cf543baa5/txaioetcd/_lease.py#L176-L211
[ "def", "refresh", "(", "self", ")", ":", "if", "self", ".", "_expired", ":", "raise", "Expired", "(", ")", "obj", "=", "{", "# ID is the lease ID for the lease to keep alive.", "u'ID'", ":", "self", ".", "lease_id", ",", "}", "data", "=", "json", ".", "dum...
c9aebff7f288a0b219bffc9d2579d22cf543baa5
train
NewsCorpusGenerator.read_links_file
Read links and associated categories for specified articles in text file seperated by a space Args: file_path (str): The path to text file with news article links and category Returns: articles: Array of tuples that contains article link & ...
news_corpus_builder/news_corpus_generator.py
def read_links_file(self,file_path): ''' Read links and associated categories for specified articles in text file seperated by a space Args: file_path (str): The path to text file with news article links and category Returns: ...
def read_links_file(self,file_path): ''' Read links and associated categories for specified articles in text file seperated by a space Args: file_path (str): The path to text file with news article links and category Returns: ...
[ "Read", "links", "and", "associated", "categories", "for", "specified", "articles", "in", "text", "file", "seperated", "by", "a", "space" ]
skillachie/news-corpus-builder
python
https://github.com/skillachie/news-corpus-builder/blob/7ef73c6d6a56e827ad694cdd446901590936baf9/news_corpus_builder/news_corpus_generator.py#L48-L71
[ "def", "read_links_file", "(", "self", ",", "file_path", ")", ":", "articles", "=", "[", "]", "with", "open", "(", "file_path", ")", "as", "f", ":", "for", "line", "in", "f", ":", "line", "=", "line", ".", "strip", "(", ")", "#Ignore blank lines", "i...
7ef73c6d6a56e827ad694cdd446901590936baf9
train
NewsCorpusGenerator.google_news_search
Searches Google News. NOTE: Official Google News API is deprecated https://developers.google.com/news-search/?hl=en NOTE: Google limits the maximum number of documents per query to 100. Use multiple related queries to get a bigger corpus. Args: query (str): The search...
news_corpus_builder/news_corpus_generator.py
def google_news_search(self,query,category_label,num=50): ''' Searches Google News. NOTE: Official Google News API is deprecated https://developers.google.com/news-search/?hl=en NOTE: Google limits the maximum number of documents per query to 100. Use multiple related queri...
def google_news_search(self,query,category_label,num=50): ''' Searches Google News. NOTE: Official Google News API is deprecated https://developers.google.com/news-search/?hl=en NOTE: Google limits the maximum number of documents per query to 100. Use multiple related queri...
[ "Searches", "Google", "News", ".", "NOTE", ":", "Official", "Google", "News", "API", "is", "deprecated", "https", ":", "//", "developers", ".", "google", ".", "com", "/", "news", "-", "search", "/", "?hl", "=", "en", "NOTE", ":", "Google", "limits", "t...
skillachie/news-corpus-builder
python
https://github.com/skillachie/news-corpus-builder/blob/7ef73c6d6a56e827ad694cdd446901590936baf9/news_corpus_builder/news_corpus_generator.py#L138-L167
[ "def", "google_news_search", "(", "self", ",", "query", ",", "category_label", ",", "num", "=", "50", ")", ":", "url", "=", "'https://news.google.com/news?hl=en&q='", "+", "self", ".", "_encode_query", "(", "query", ")", "+", "'&num='", "+", "str", "(", "num...
7ef73c6d6a56e827ad694cdd446901590936baf9
train
Client.call
Makes an RPC call to the server and returns the json response :param action: RPC method to call :type action: str :param params: Dict of arguments to send with RPC call :type params: dict :raises: :py:exc:`nano.rpc.RPCException` :raises: :py:exc:`requests.exceptions.Re...
src/nano/rpc.py
def call(self, action, params=None): """ Makes an RPC call to the server and returns the json response :param action: RPC method to call :type action: str :param params: Dict of arguments to send with RPC call :type params: dict :raises: :py:exc:`nano.rpc.RPCEx...
def call(self, action, params=None): """ Makes an RPC call to the server and returns the json response :param action: RPC method to call :type action: str :param params: Dict of arguments to send with RPC call :type params: dict :raises: :py:exc:`nano.rpc.RPCEx...
[ "Makes", "an", "RPC", "call", "to", "the", "server", "and", "returns", "the", "json", "response" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L57-L89
[ "def", "call", "(", "self", ",", "action", ",", "params", "=", "None", ")", ":", "params", "=", "params", "or", "{", "}", "params", "[", "'action'", "]", "=", "action", "resp", "=", "self", ".", "session", ".", "post", "(", "self", ".", "host", "...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client._process_value
Process a value that will be sent to backend :param value: the value to return :param type: hint for what sort of value this is :type type: str
src/nano/rpc.py
def _process_value(self, value, type): """ Process a value that will be sent to backend :param value: the value to return :param type: hint for what sort of value this is :type type: str """ if not isinstance(value, six.string_types + (list,)): val...
def _process_value(self, value, type): """ Process a value that will be sent to backend :param value: the value to return :param type: hint for what sort of value this is :type type: str """ if not isinstance(value, six.string_types + (list,)): val...
[ "Process", "a", "value", "that", "will", "be", "sent", "to", "backend" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L91-L104
[ "def", "_process_value", "(", "self", ",", "value", ",", "type", ")", ":", "if", "not", "isinstance", "(", "value", ",", "six", ".", "string_types", "+", "(", "list", ",", ")", ")", ":", "value", "=", "json", ".", "dumps", "(", "value", ")", "retur...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_balance
Returns how many RAW is owned and how many have not yet been received by **account** :param account: Account id to return balance of :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_balance( ... account="xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1...
src/nano/rpc.py
def account_balance(self, account): """ Returns how many RAW is owned and how many have not yet been received by **account** :param account: Account id to return balance of :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_balance( ...
def account_balance(self, account): """ Returns how many RAW is owned and how many have not yet been received by **account** :param account: Account id to return balance of :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_balance( ...
[ "Returns", "how", "many", "RAW", "is", "owned", "and", "how", "many", "have", "not", "yet", "been", "received", "by", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L107-L136
[ "def", "account_balance", "(", "self", ",", "account", ")", ":", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "payload", "=", "{", "\"account\"", ":", "account", "}", "resp", "=", "self", ".", "call", "(", "'accou...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.accounts_balances
Returns how many RAW is owned and how many have not yet been received by **accounts** list :param accounts: list of accounts to return balances for :type accounts: list of str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.accounts_balances( ... accounts=[ ...
src/nano/rpc.py
def accounts_balances(self, accounts): """ Returns how many RAW is owned and how many have not yet been received by **accounts** list :param accounts: list of accounts to return balances for :type accounts: list of str :raises: :py:exc:`nano.rpc.RPCException` >...
def accounts_balances(self, accounts): """ Returns how many RAW is owned and how many have not yet been received by **accounts** list :param accounts: list of accounts to return balances for :type accounts: list of str :raises: :py:exc:`nano.rpc.RPCException` >...
[ "Returns", "how", "many", "RAW", "is", "owned", "and", "how", "many", "have", "not", "yet", "been", "received", "by", "**", "accounts", "**", "list" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L139-L179
[ "def", "accounts_balances", "(", "self", ",", "accounts", ")", ":", "accounts", "=", "self", ".", "_process_value", "(", "accounts", ",", "'list'", ")", "payload", "=", "{", "\"accounts\"", ":", "accounts", "}", "resp", "=", "self", ".", "call", "(", "'a...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_block_count
Get number of blocks for a specific **account** :param account: Account to get number of blocks for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_block_count(account="xrb_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3") 19
src/nano/rpc.py
def account_block_count(self, account): """ Get number of blocks for a specific **account** :param account: Account to get number of blocks for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_block_count(account="xrb_3t6k35gi95xu6tergt6p69ck...
def account_block_count(self, account): """ Get number of blocks for a specific **account** :param account: Account to get number of blocks for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_block_count(account="xrb_3t6k35gi95xu6tergt6p69ck...
[ "Get", "number", "of", "blocks", "for", "a", "specific", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L182-L202
[ "def", "account_block_count", "(", "self", ",", "account", ")", ":", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "payload", "=", "{", "\"account\"", ":", "account", "}", "resp", "=", "self", ".", "call", "(", "'a...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.accounts_create
Creates new accounts, insert next deterministic keys in **wallet** up to **count** .. enable_control required .. version 8.0 required :param wallet: Wallet to create new accounts in :type wallet: str :param count: Number of accounts to create :type count: int ...
src/nano/rpc.py
def accounts_create(self, wallet, count, work=True): """ Creates new accounts, insert next deterministic keys in **wallet** up to **count** .. enable_control required .. version 8.0 required :param wallet: Wallet to create new accounts in :type wallet: str ...
def accounts_create(self, wallet, count, work=True): """ Creates new accounts, insert next deterministic keys in **wallet** up to **count** .. enable_control required .. version 8.0 required :param wallet: Wallet to create new accounts in :type wallet: str ...
[ "Creates", "new", "accounts", "insert", "next", "deterministic", "keys", "in", "**", "wallet", "**", "up", "to", "**", "count", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L205-L245
[ "def", "accounts_create", "(", "self", ",", "wallet", ",", "count", ",", "work", "=", "True", ")", ":", "wallet", "=", "self", ".", "_process_value", "(", "wallet", ",", "'wallet'", ")", "count", "=", "self", ".", "_process_value", "(", "count", ",", "...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.accounts_frontiers
Returns a list of pairs of account and block hash representing the head block for **accounts** list :param accounts: Accounts to return frontier blocks for :type accounts: list of str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.accounts_frontiers( ... accounts...
src/nano/rpc.py
def accounts_frontiers(self, accounts): """ Returns a list of pairs of account and block hash representing the head block for **accounts** list :param accounts: Accounts to return frontier blocks for :type accounts: list of str :raises: :py:exc:`nano.rpc.RPCException` ...
def accounts_frontiers(self, accounts): """ Returns a list of pairs of account and block hash representing the head block for **accounts** list :param accounts: Accounts to return frontier blocks for :type accounts: list of str :raises: :py:exc:`nano.rpc.RPCException` ...
[ "Returns", "a", "list", "of", "pairs", "of", "account", "and", "block", "hash", "representing", "the", "head", "block", "for", "**", "accounts", "**", "list" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L248-L279
[ "def", "accounts_frontiers", "(", "self", ",", "accounts", ")", ":", "accounts", "=", "self", ".", "_process_value", "(", "accounts", ",", "'list'", ")", "payload", "=", "{", "\"accounts\"", ":", "accounts", "}", "resp", "=", "self", ".", "call", "(", "'...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_info
Returns frontier, open block, change representative block, balance, last modified timestamp from local database & block count for **account** :param account: Account to return info for :type account: str :param representative: if True, also returns the representative block ...
src/nano/rpc.py
def account_info(self, account, representative=False, weight=False, pending=False): """ Returns frontier, open block, change representative block, balance, last modified timestamp from local database & block count for **account** :param account: Account to return info for ...
def account_info(self, account, representative=False, weight=False, pending=False): """ Returns frontier, open block, change representative block, balance, last modified timestamp from local database & block count for **account** :param account: Account to return info for ...
[ "Returns", "frontier", "open", "block", "change", "representative", "block", "balance", "last", "modified", "timestamp", "from", "local", "database", "&", "block", "count", "for", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L282-L339
[ "def", "account_info", "(", "self", ",", "account", ",", "representative", "=", "False", ",", "weight", "=", "False", ",", "pending", "=", "False", ")", ":", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "payload", ...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_create
Creates a new account, insert next deterministic key in **wallet** .. enable_control required :param wallet: Wallet to insert new account into :type wallet: str :param work: If false, disables work generation after creating account :type work: bool :raises: :py:exc:`n...
src/nano/rpc.py
def account_create(self, wallet, work=True): """ Creates a new account, insert next deterministic key in **wallet** .. enable_control required :param wallet: Wallet to insert new account into :type wallet: str :param work: If false, disables work generation after creat...
def account_create(self, wallet, work=True): """ Creates a new account, insert next deterministic key in **wallet** .. enable_control required :param wallet: Wallet to insert new account into :type wallet: str :param work: If false, disables work generation after creat...
[ "Creates", "a", "new", "account", "insert", "next", "deterministic", "key", "in", "**", "wallet", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L342-L372
[ "def", "account_create", "(", "self", ",", "wallet", ",", "work", "=", "True", ")", ":", "wallet", "=", "self", ".", "_process_value", "(", "wallet", ",", "'wallet'", ")", "payload", "=", "{", "\"wallet\"", ":", "wallet", "}", "if", "not", "work", ":",...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_get
Get account number for the **public key** :param key: Public key to get account for :type key: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_get( ... key="3068BB1CA04525BB0E416C485FE6A67FD52540227D267CC8B6E8DA958A7FA039" ... ) "xrb_1e5aqegc1jb...
src/nano/rpc.py
def account_get(self, key): """ Get account number for the **public key** :param key: Public key to get account for :type key: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_get( ... key="3068BB1CA04525BB0E416C485FE6A67FD52540227D267CC8B6E8DA95...
def account_get(self, key): """ Get account number for the **public key** :param key: Public key to get account for :type key: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_get( ... key="3068BB1CA04525BB0E416C485FE6A67FD52540227D267CC8B6E8DA95...
[ "Get", "account", "number", "for", "the", "**", "public", "key", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L375-L397
[ "def", "account_get", "(", "self", ",", "key", ")", ":", "key", "=", "self", ".", "_process_value", "(", "key", ",", "'publickey'", ")", "payload", "=", "{", "\"key\"", ":", "key", "}", "resp", "=", "self", ".", "call", "(", "'account_get'", ",", "pa...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_history
Reports send/receive information for a **account** :param account: Account to get send/receive information for :type account: str :param count: number of blocks to return :type count: int :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_history( ... ...
src/nano/rpc.py
def account_history(self, account, count): """ Reports send/receive information for a **account** :param account: Account to get send/receive information for :type account: str :param count: number of blocks to return :type count: int :raises: :py:exc:`nano.rpc...
def account_history(self, account, count): """ Reports send/receive information for a **account** :param account: Account to get send/receive information for :type account: str :param count: number of blocks to return :type count: int :raises: :py:exc:`nano.rpc...
[ "Reports", "send", "/", "receive", "information", "for", "a", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L400-L438
[ "def", "account_history", "(", "self", ",", "account", ",", "count", ")", ":", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "count", "=", "self", ".", "_process_value", "(", "count", ",", "'int'", ")", "payload", ...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_list
Lists all the accounts inside **wallet** :param wallet: Wallet to get account list for :type wallet: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_list( ... wallet="000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B2489A277D81789F3F" ... ) [ ...
src/nano/rpc.py
def account_list(self, wallet): """ Lists all the accounts inside **wallet** :param wallet: Wallet to get account list for :type wallet: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_list( ... wallet="000D1BAEC8EC208142C99059B393051BAC8380F9B...
def account_list(self, wallet): """ Lists all the accounts inside **wallet** :param wallet: Wallet to get account list for :type wallet: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_list( ... wallet="000D1BAEC8EC208142C99059B393051BAC8380F9B...
[ "Lists", "all", "the", "accounts", "inside", "**", "wallet", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L441-L465
[ "def", "account_list", "(", "self", ",", "wallet", ")", ":", "wallet", "=", "self", ".", "_process_value", "(", "wallet", ",", "'wallet'", ")", "payload", "=", "{", "\"wallet\"", ":", "wallet", "}", "resp", "=", "self", ".", "call", "(", "'account_list'"...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_move
Moves **accounts** from **source** to **wallet** .. enable_control required :param source: wallet to move accounts from :type source: str :param wallet: wallet to move accounts to :type wallet: str :param accounts: accounts to move :type accounts: list of str ...
src/nano/rpc.py
def account_move(self, source, wallet, accounts): """ Moves **accounts** from **source** to **wallet** .. enable_control required :param source: wallet to move accounts from :type source: str :param wallet: wallet to move accounts to :type wallet: str ...
def account_move(self, source, wallet, accounts): """ Moves **accounts** from **source** to **wallet** .. enable_control required :param source: wallet to move accounts from :type source: str :param wallet: wallet to move accounts to :type wallet: str ...
[ "Moves", "**", "accounts", "**", "from", "**", "source", "**", "to", "**", "wallet", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L468-L504
[ "def", "account_move", "(", "self", ",", "source", ",", "wallet", ",", "accounts", ")", ":", "wallet", "=", "self", ".", "_process_value", "(", "wallet", ",", "'wallet'", ")", "source", "=", "self", ".", "_process_value", "(", "source", ",", "'wallet'", ...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.accounts_pending
Returns a list of block hashes which have not yet been received by these **accounts** :param accounts: Accounts to return list of block hashes for :type accounts: list of str :param count: Max number of blocks to returns :type count: int :param threshold: Minimum amoun...
src/nano/rpc.py
def accounts_pending(self, accounts, count=None, threshold=None, source=False): """ Returns a list of block hashes which have not yet been received by these **accounts** :param accounts: Accounts to return list of block hashes for :type accounts: list of str :param coun...
def accounts_pending(self, accounts, count=None, threshold=None, source=False): """ Returns a list of block hashes which have not yet been received by these **accounts** :param accounts: Accounts to return list of block hashes for :type accounts: list of str :param coun...
[ "Returns", "a", "list", "of", "block", "hashes", "which", "have", "not", "yet", "been", "received", "by", "these", "**", "accounts", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L507-L573
[ "def", "accounts_pending", "(", "self", ",", "accounts", ",", "count", "=", "None", ",", "threshold", "=", "None", ",", "source", "=", "False", ")", ":", "payload", "=", "{", "\"accounts\"", ":", "accounts", "}", "accounts", "=", "self", ".", "_process_v...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_key
Get the public key for **account** :param account: Account to get public key for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_key( ... account="xrb_1e5aqegc1jb7qe964u4adzmcezyo6o146zb8hm6dft8tkp79za3sxwjym5rx" ... ) "3068BB1CA...
src/nano/rpc.py
def account_key(self, account): """ Get the public key for **account** :param account: Account to get public key for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_key( ... account="xrb_1e5aqegc1jb7qe964u4adzmcezyo6o146zb8hm6dft...
def account_key(self, account): """ Get the public key for **account** :param account: Account to get public key for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_key( ... account="xrb_1e5aqegc1jb7qe964u4adzmcezyo6o146zb8hm6dft...
[ "Get", "the", "public", "key", "for", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L576-L598
[ "def", "account_key", "(", "self", ",", "account", ")", ":", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "payload", "=", "{", "\"account\"", ":", "account", "}", "resp", "=", "self", ".", "call", "(", "'account_k...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_remove
Remove **account** from **wallet** .. enable_control required :param wallet: Wallet to remove account from :type wallet: str :param account: Account to remove :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_remove( ... ...
src/nano/rpc.py
def account_remove(self, wallet, account): """ Remove **account** from **wallet** .. enable_control required :param wallet: Wallet to remove account from :type wallet: str :param account: Account to remove :type account: str :raises: :py:exc:`nano.rpc....
def account_remove(self, wallet, account): """ Remove **account** from **wallet** .. enable_control required :param wallet: Wallet to remove account from :type wallet: str :param account: Account to remove :type account: str :raises: :py:exc:`nano.rpc....
[ "Remove", "**", "account", "**", "from", "**", "wallet", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L601-L630
[ "def", "account_remove", "(", "self", ",", "wallet", ",", "account", ")", ":", "wallet", "=", "self", ".", "_process_value", "(", "wallet", ",", "'wallet'", ")", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "payload...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_representative
Returns the representative for **account** :param account: Account to get representative for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_representative( ... account="xrb_39a73oy5ungrhxy5z5oao1xso4zo7dmgpjd4u74xcrx3r1w6rtazuouw6qfi" )...
src/nano/rpc.py
def account_representative(self, account): """ Returns the representative for **account** :param account: Account to get representative for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_representative( ... account="xrb_39a73oy5...
def account_representative(self, account): """ Returns the representative for **account** :param account: Account to get representative for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_representative( ... account="xrb_39a73oy5...
[ "Returns", "the", "representative", "for", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L633-L655
[ "def", "account_representative", "(", "self", ",", "account", ")", ":", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "payload", "=", "{", "\"account\"", ":", "account", "}", "resp", "=", "self", ".", "call", "(", ...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_representative_set
Sets the representative for **account** in **wallet** .. enable_control required :param wallet: Wallet to use for account :type wallet: str :param account: Account to set representative for :type account: str :param representative: Representative to set to :ty...
src/nano/rpc.py
def account_representative_set(self, wallet, account, representative, work=None): """ Sets the representative for **account** in **wallet** .. enable_control required :param wallet: Wallet to use for account :type wallet: str :param account: Account to set representati...
def account_representative_set(self, wallet, account, representative, work=None): """ Sets the representative for **account** in **wallet** .. enable_control required :param wallet: Wallet to use for account :type wallet: str :param account: Account to set representati...
[ "Sets", "the", "representative", "for", "**", "account", "**", "in", "**", "wallet", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L658-L702
[ "def", "account_representative_set", "(", "self", ",", "wallet", ",", "account", ",", "representative", ",", "work", "=", "None", ")", ":", "wallet", "=", "self", ".", "_process_value", "(", "wallet", ",", "'wallet'", ")", "account", "=", "self", ".", "_pr...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.account_weight
Returns the voting weight for **account** :param account: Account to get voting weight for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_weight( ... account="xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000" ... ) ...
src/nano/rpc.py
def account_weight(self, account): """ Returns the voting weight for **account** :param account: Account to get voting weight for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_weight( ... account="xrb_3e3j5tkog48pnny9dmfzj1r16p...
def account_weight(self, account): """ Returns the voting weight for **account** :param account: Account to get voting weight for :type account: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.account_weight( ... account="xrb_3e3j5tkog48pnny9dmfzj1r16p...
[ "Returns", "the", "voting", "weight", "for", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L705-L727
[ "def", "account_weight", "(", "self", ",", "account", ")", ":", "account", "=", "self", ".", "_process_value", "(", "account", ",", "'account'", ")", "payload", "=", "{", "\"account\"", ":", "account", "}", "resp", "=", "self", ".", "call", "(", "'accoun...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.block
Retrieves a json representation of **block** :param hash: Hash of block to return representation for :type hash: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block( ... hash="000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B2489A277D81789F3F" ... ) { ...
src/nano/rpc.py
def block(self, hash): """ Retrieves a json representation of **block** :param hash: Hash of block to return representation for :type hash: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block( ... hash="000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B...
def block(self, hash): """ Retrieves a json representation of **block** :param hash: Hash of block to return representation for :type hash: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block( ... hash="000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B...
[ "Retrieves", "a", "json", "representation", "of", "**", "block", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L746-L775
[ "def", "block", "(", "self", ",", "hash", ")", ":", "hash", "=", "self", ".", "_process_value", "(", "hash", ",", "'block'", ")", "payload", "=", "{", "\"hash\"", ":", "hash", "}", "resp", "=", "self", ".", "call", "(", "'block'", ",", "payload", "...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.blocks
Retrieves a json representations of **blocks** :param hashes: List of block hashes to return :type hashes: list of str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.blocks( ... hashes=["000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B2489A277D81789F3F"] ... ) ...
src/nano/rpc.py
def blocks(self, hashes): """ Retrieves a json representations of **blocks** :param hashes: List of block hashes to return :type hashes: list of str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.blocks( ... hashes=["000D1BAEC8EC208142C99059B393051BAC8380...
def blocks(self, hashes): """ Retrieves a json representations of **blocks** :param hashes: List of block hashes to return :type hashes: list of str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.blocks( ... hashes=["000D1BAEC8EC208142C99059B393051BAC8380...
[ "Retrieves", "a", "json", "representations", "of", "**", "blocks", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L778-L813
[ "def", "blocks", "(", "self", ",", "hashes", ")", ":", "hashes", "=", "self", ".", "_process_value", "(", "hashes", ",", "'list'", ")", "payload", "=", "{", "\"hashes\"", ":", "hashes", "}", "resp", "=", "self", ".", "call", "(", "'blocks'", ",", "pa...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.blocks_info
Retrieves a json representations of **blocks** with transaction **amount** & block **account** :param hashes: List of block hashes to return info for :type hashes: list of str :param pending: If true, returns pending amount as well :type pending: bool :param source: If...
src/nano/rpc.py
def blocks_info(self, hashes, pending=False, source=False): """ Retrieves a json representations of **blocks** with transaction **amount** & block **account** :param hashes: List of block hashes to return info for :type hashes: list of str :param pending: If true, retur...
def blocks_info(self, hashes, pending=False, source=False): """ Retrieves a json representations of **blocks** with transaction **amount** & block **account** :param hashes: List of block hashes to return info for :type hashes: list of str :param pending: If true, retur...
[ "Retrieves", "a", "json", "representations", "of", "**", "blocks", "**", "with", "transaction", "**", "amount", "**", "&", "block", "**", "account", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L816-L869
[ "def", "blocks_info", "(", "self", ",", "hashes", ",", "pending", "=", "False", ",", "source", "=", "False", ")", ":", "hashes", "=", "self", ".", "_process_value", "(", "hashes", ",", "'list'", ")", "payload", "=", "{", "\"hashes\"", ":", "hashes", "}...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.block_account
Returns the account containing block :param hash: Hash of the block to return account for :type hash: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_account( ... hash="000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B2489A277D81789F3F" ... ) "xrb_...
src/nano/rpc.py
def block_account(self, hash): """ Returns the account containing block :param hash: Hash of the block to return account for :type hash: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_account( ... hash="000D1BAEC8EC208142C99059B393051BAC8380F9B5...
def block_account(self, hash): """ Returns the account containing block :param hash: Hash of the block to return account for :type hash: str :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_account( ... hash="000D1BAEC8EC208142C99059B393051BAC8380F9B5...
[ "Returns", "the", "account", "containing", "block" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L872-L894
[ "def", "block_account", "(", "self", ",", "hash", ")", ":", "hash", "=", "self", ".", "_process_value", "(", "hash", ",", "'block'", ")", "payload", "=", "{", "\"hash\"", ":", "hash", "}", "resp", "=", "self", ".", "call", "(", "'block_account'", ",", ...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.block_count
Reports the number of blocks in the ledger and unchecked synchronizing blocks :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_count() { "count": 1000, "unchecked": 10 }
src/nano/rpc.py
def block_count(self): """ Reports the number of blocks in the ledger and unchecked synchronizing blocks :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_count() { "count": 1000, "unchecked": 10 } """ resp = self.call(...
def block_count(self): """ Reports the number of blocks in the ledger and unchecked synchronizing blocks :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_count() { "count": 1000, "unchecked": 10 } """ resp = self.call(...
[ "Reports", "the", "number", "of", "blocks", "in", "the", "ledger", "and", "unchecked", "synchronizing", "blocks" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L897-L917
[ "def", "block_count", "(", "self", ")", ":", "resp", "=", "self", ".", "call", "(", "'block_count'", ")", "for", "k", ",", "v", "in", "resp", ".", "items", "(", ")", ":", "resp", "[", "k", "]", "=", "int", "(", "v", ")", "return", "resp" ]
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.block_count_type
Reports the number of blocks in the ledger by type (send, receive, open, change) :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_count_type() { "send": 1000, "receive": 900, "open": 100, "change": 50 }
src/nano/rpc.py
def block_count_type(self): """ Reports the number of blocks in the ledger by type (send, receive, open, change) :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_count_type() { "send": 1000, "receive": 900, "open": 100, "cha...
def block_count_type(self): """ Reports the number of blocks in the ledger by type (send, receive, open, change) :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_count_type() { "send": 1000, "receive": 900, "open": 100, "cha...
[ "Reports", "the", "number", "of", "blocks", "in", "the", "ledger", "by", "type", "(", "send", "receive", "open", "change", ")" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L920-L942
[ "def", "block_count_type", "(", "self", ")", ":", "resp", "=", "self", ".", "call", "(", "'block_count_type'", ")", "for", "k", ",", "v", "in", "resp", ".", "items", "(", ")", ":", "resp", "[", "k", "]", "=", "int", "(", "v", ")", "return", "resp...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.block_create
Creates a json representations of new block based on input data & signed with private key or account in **wallet** for offline signing .. enable_control required .. version 8.1 required :param type: Type of block to create one of **open**, **receive**, **change**, ...
src/nano/rpc.py
def block_create( self, type, account, wallet=None, representative=None, key=None, destination=None, amount=None, balance=None, previous=None, source=None, work=None, ): """ Creates a json representations...
def block_create( self, type, account, wallet=None, representative=None, key=None, destination=None, amount=None, balance=None, previous=None, source=None, work=None, ): """ Creates a json representations...
[ "Creates", "a", "json", "representations", "of", "new", "block", "based", "on", "input", "data", "&", "signed", "with", "private", "key", "or", "account", "in", "**", "wallet", "**", "for", "offline", "signing" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L945-L1117
[ "def", "block_create", "(", "self", ",", "type", ",", "account", ",", "wallet", "=", "None", ",", "representative", "=", "None", ",", "key", "=", "None", ",", "destination", "=", "None", ",", "amount", "=", "None", ",", "balance", "=", "None", ",", "...
f26b8bc895b997067780f925049a70e82c0c2479
train
Client.bootstrap
Initialize bootstrap to specific **IP address** and **port** :param address: Ip address to bootstrap :type address: str :param port: Port to bootstrap :type port: int :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.bootstrap(address="::ffff:138.201.94.249", port="707...
src/nano/rpc.py
def bootstrap(self, address, port): """ Initialize bootstrap to specific **IP address** and **port** :param address: Ip address to bootstrap :type address: str :param port: Port to bootstrap :type port: int :raises: :py:exc:`nano.rpc.RPCException` >>> ...
def bootstrap(self, address, port): """ Initialize bootstrap to specific **IP address** and **port** :param address: Ip address to bootstrap :type address: str :param port: Port to bootstrap :type port: int :raises: :py:exc:`nano.rpc.RPCException` >>> ...
[ "Initialize", "bootstrap", "to", "specific", "**", "IP", "address", "**", "and", "**", "port", "**" ]
dourvaris/nano-python
python
https://github.com/dourvaris/nano-python/blob/f26b8bc895b997067780f925049a70e82c0c2479/src/nano/rpc.py#L1120-L1143
[ "def", "bootstrap", "(", "self", ",", "address", ",", "port", ")", ":", "address", "=", "self", ".", "_process_value", "(", "address", ",", "'ipaddr'", ")", "port", "=", "self", ".", "_process_value", "(", "port", ",", "'int'", ")", "payload", "=", "{"...
f26b8bc895b997067780f925049a70e82c0c2479