<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def number_of_nodes(self, t=None):
 """Return the number of nodes in the t snpashot of a dynamic graph. Parameters t : snapshot id (default=None) If None return the number of nodes in the flattened graph. Returns ------- nnodes : int The number of nodes in the graph. See Also -------- order which is identical Examples -------- 3 """

        if t is None:
            return len(self._node)
        else:
            nds = sum([1 for n in self.degree(t=t).values() if n > 0])
            return nds