<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_node_sizes(self):
 """Compute the node sizes."""

        if type(self.node_size) is str:
            nodes = self.graph.nodes
            self.node_sizes = [nodes[n][self.node_size] for n in self.nodes]
        else:
            self.node_sizes = self.node_size