def num_instances(self):
num = <NUM_LIT:0><EOL>components = self.spouts() + self.bolts()<EOL>for component in components:<EOL><INDENT>config = component.comp.config<EOL>for kvs in config.kvs:<EOL><INDENT>if kvs.key == api_constants.TOPOLOGY_COMPONENT_PARALLELISM:<EOL><INDENT>num += int(kvs.value)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>return num<EOL>
Number of spouts + bolts