Minor nit: This could be written more succinctly using Traversable.collect():

```scala
val networkInputStreams = graph.getInputStreams.collect {
  case n: NetworkInputDStream[_] => n.toArray
}
```