INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
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 the first to the second ** node object **. - double ( bool ) [ ...
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**....
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 to the second ** node object **. - double ( bool ) [ default: ...
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 ...
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 objects ** being added. See: Graph. add_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 edges to the graph. Takes optional arguments for DictGraph. add_edge. Arguments: - edges ( iterable ) Sequence of edges to be added to the DictGraph.
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...
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``. """ ...
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 specified nodes.
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 incoming edges for a ** node object **. Arguments: - node ( object ) ** node object ** present in the graph to be queried for incoming 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 outgoing edges for a ** node object **. Arguments: - node ( object ) ** node object ** present in the graph to be queried for outgoing edges.
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...
Open a Jaide session with the device.
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...
Run an operational command.
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...
Execute a commit against the device.
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...
Perform a show | compare with some set commands.
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.
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...
Copy file ( s ) from a device to the local machine.
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 the local machine to a junos device.
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...
Send shell commands to a device.
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 ""...
Returns all keys from etcd.
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....
Send the GET request required to stop the scan
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...
Convert public_key ( bytes ) to an xrb address
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 an xrb address to public key in bytes
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...
Generates an adhoc account and keypair
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\\\...
Flask application initialization.
def init_app(self, app): """Flask application initialization.""" self.init_config(app) state = _OAuthClientState(app) app.extensions['invenio-oauthclient'] = state return state
Initialize configuration.
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...
Passes inputs with indecies in s. By default passes the whole inbox.
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...
Zips inputs from inbox with indicies in s. By default zips the whole inbox ( all indices ).
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])
String joins input with indices in s.
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...
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 used by a non - parall...
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...
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.
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...
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 communicate processes o...
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...
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 a file.
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...
Creates a line generator from a stream ( file handle ) containing data in lines.
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``]...
Serializes the first element of the input using the pickle protocol using the fastes binary protocol.
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_
Deserializes the first element of the input using the pickle protocol.
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
Serializes the first element of the input using the JSON protocol as implemented by the json Python 2. 6 library.
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_
Deserializes the first element of the input using the JSON protocol as implemented by the json Python 2. 6 library.
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
Callback validating the at_time commit option.
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...
Validate the - w option.
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 ...
Callback function to write the output from the script.
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...
Manipulate one or more Junos devices.
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...
Execute a commit against the device.
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...
Run show | compare for set commands.
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...
Copy file ( s ) from device ( s ) - > local machine.
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 local machine - > device ( s ).
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...
Execute operational mode command ( s ).
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. ...
Config comparison between two devices.
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...
Allow for partial commands.
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: ...
Converts a value from from_unit units to to_unit units
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...
Get etcd status.
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...
Range gets the keys in the range from the key - value store.
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, ...
Submit a transaction.
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...
Endpoint that SNS accesses. Includes logic verifying request
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...
Function to process a JSON message delivered from Amazon
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 bounce notification
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 complaint notification
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 delivery notification
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 = [...
Click on a label
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()
Check if the element is 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 not 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 that the form input element has given value.
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) ...
Submit the form having given id.
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 action URL.
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()
Check the alert text
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
Press a button having a given tooltip.
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.
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))): ...
Check that the page title matches the given one.
def page_title(step, title): """ Check that the page title matches the given one. """ with AssertContextManager(step): assert_equals(world.browser.title, title)
Get a list of tags.
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 tag.
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)
Edit a tag.
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...
Get the remaining time - to - live of this lease.
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') ...
Revokes a lease. All keys attached to the lease will expire and be deleted.
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...
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.
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...
Read links and associated categories for specified articles in text file seperated by a space
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: ...
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.
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...
Makes an RPC call to the server and returns the json response
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...
Process a value that will be sent to backend
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...
Returns how many RAW is owned and how many have not yet been received by ** account **
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 ** accounts ** list
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` >...
Get number of blocks for a specific ** account **
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...
Creates new accounts insert next deterministic keys in ** wallet ** up to ** count **
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 ...
Returns a list of pairs of account and block hash representing the head block for ** accounts ** list
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 frontier open block change representative block balance last modified timestamp from local database & block count for ** account **
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 ...
Creates a new account insert next deterministic key in ** wallet **
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...
Get account number for the ** public key **
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...
Reports send/ receive information for a ** account **
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...
Lists all the accounts inside ** wallet **
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...
Moves ** accounts ** from ** source ** to ** wallet **
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 ...
Returns a list of block hashes which have not yet been received by these ** accounts **
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...
Get the public key for ** account **
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...
Remove ** account ** from ** wallet **
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....
Returns the representative for ** account **
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...
Sets the representative for ** account ** in ** wallet **
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...
Returns the voting weight for ** account **
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...
Retrieves a json representation of ** block **
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 representations of ** blocks **
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 ** with transaction ** amount ** & block ** account **
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...
Returns the account containing block
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...
Reports the number of blocks in the ledger and unchecked synchronizing blocks
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 by type ( send receive open change )
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...
Creates a json representations of new block based on input data & signed with private key or account in ** wallet ** for offline signing
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...
Initialize bootstrap to specific ** IP address ** and ** port **
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` >>> ...