netunicorn.base.nodes.Nodes¶
- class Nodes[source]¶
Bases:
ABC
A base class that represents a pool of nodes. Not to be used directly, but to be inherited from.
Methods
Deserializes a JSON representation of the object and returns an instance of the object.
Returns a pool of nodes that match the given filter function.
Class-specific implementation of deserialization from JSON.
Sets a property for all nodes in the pool.
Returns a pool of nodes consisting of the nodes after the first 'count' nodes.
Returns a sequence of nodes consisting of the first count nodes.
- static dispatch_and_deserialize(data)[source]¶
Deserializes a JSON representation of the object and returns an instance of the object.
- Parameters:
data (
NodesRepresentation
) – JSON representation of the object- Returns:
Nodes
– instance of the object
- abstract classmethod from_json(data, metadata=None)[source]¶
Class-specific implementation of deserialization from JSON.
- Parameters:
data (
List
[Union
[NodeRepresentation
,NodesRepresentation
]]) – JSON representation of the objectmetadata (
Optional
[Any
], default:None
) – optional additional information for the pool instantiation
- Returns:
Nodes
– instance of the object
- abstract take(count)[source]¶
Returns a sequence of nodes consisting of the first count nodes.
- Parameters:
count (
int
) – number of nodes to take- Returns:
Sequence
[Node
] – sequence of nodes