original_docstring: 
      Runs the component graph with an optional broker. If any ``Stream``
      instances are present in the results, start them and wait until they're all
      done.
      
docstring: Runs the component graph with an optional broker. If any ``Stream``
  instances are present in the results, start them and wait until they're all
  done.
docstring_tokens: Runs the component graph with an optional broker . If any ` ` Stream ` ` instances are present in the results start them and wait until they ' re all done .
code: def run_streams(graph=dr.COMPONENTS["stream"], broker=None):
      """
      Runs the component graph with an optional broker. If any ``Stream``
      instances are present in the results, start them and wait until they're all
      done.
      """
      def handler(signum, frame):
          sys.exit(0)
  
      signal.signal(signal.SIGINT, handler)
      signal.signal(signal.SIGTERM, handler)
  
      broker = dr.run(graph, broker=broker)
      streams = broker.get_by_type(stream).values()
  
      for s in streams:
          s.start()
  
      # hang out while anything is alive so we can catch signals
      while any(s.is_alive() for s in streams):
          time.sleep(.5)
code_tokens: def run_streams ( graph = dr . COMPONENTS [ "stream" ] , broker = None ) : def handler ( signum , frame ) : sys . exit ( 0 ) signal . signal ( signal . SIGINT , handler ) signal . signal ( signal . SIGTERM , handler ) broker = dr . run ( graph , broker = broker ) streams = broker . get_by_type ( stream ) . values ( ) for s in streams : s . start ( ) while any ( s . is_alive ( ) for s in streams ) : time . sleep ( .5 )
short_docstring: Runs the component graph with an optional broker.
short_docstring_tokens: Runs the component graph with an optional broker .
comment: """
      Runs the component graph with an optional broker. If any ``Stream``
      instances are present in the results, start them and wait until they're all
      done.
      """$SEP$# hang out while anything is alive so we can catch signals