Block.vertex_attributes

Block.vertex_attributes(key, names=None, values=None)

Get or set multiple attributes of a vertex.

Parameters:
keyint

The identifier of the vertex.

nameslist[str], optional

A list of attribute names.

valueslist[Any], optional

A list of attribute values.

Returns:
dict[str, Any] | list[Any] | None

If the parameter names is empty, the function returns a dictionary of all attribute name-value pairs of the vertex. If the parameter names is not empty, the function returns a list of the values corresponding to the requested attribute names. The function returns None if it is used as a “setter”.

Raises:
KeyError

If the vertex does not exist.