BaseNetwork.nodes_attributes

BaseNetwork.nodes_attributes(names=None, values=None, keys=None)

Get or set multiple attributes of multiple nodes.

Parameters
  • names (list of str, optional) – The names of the attribute. Default is None.

  • values (list of obj, optional) – The values of the attributes. Default is None.

  • keys (list of int, optional) – A list of node identifiers.

Returns

list or None – If the parameter names is None, the function returns a list containing an attribute dict per node. If the parameter names is not None, the function returns a list containing a list of attribute values per node corresponding to the provided attribute names. The function returns None if it is used as a “setter”.

Raises

KeyError – If any of the nodes does not exist.