<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def size(self, type=None, failed=False):
 """How many nodes in a network. type specifies the class of node, failed can be True/False/all. """

        return len(self.nodes(type=type, failed=failed))