def _listOfOnTimesInVec(vector):
<EOL>durations = []<EOL>numOnTimes   = <NUM_LIT:0><EOL>totalOnTime = <NUM_LIT:0><EOL>nonzeros = numpy.array(vector).nonzero()[<NUM_LIT:0>]<EOL>if len(nonzeros) == <NUM_LIT:0>:<EOL><INDENT>return (<NUM_LIT:0>, <NUM_LIT:0>, [])<EOL><DEDENT>if len(nonzeros) == <NUM_LIT:1>:<EOL><INDENT>return (<NUM_LIT:1>, <NUM_LIT:1>, [<NUM_LIT:1>])<EOL><DEDENT>prev = nonzeros[<NUM_LIT:0>]<EOL>onTime = <NUM_LIT:1><EOL>endIdx = nonzeros[-<NUM_LIT:1>]<EOL>for idx in nonzeros[<NUM_LIT:1>:]:<EOL><INDENT>if idx != prev+<NUM_LIT:1>:<EOL><INDENT>totalOnTime += onTime<EOL>numOnTimes  += <NUM_LIT:1><EOL>durations.append(onTime)<EOL>onTime       = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>onTime += <NUM_LIT:1><EOL><DEDENT>prev = idx<EOL><DEDENT>totalOnTime += onTime<EOL>numOnTimes  += <NUM_LIT:1><EOL>durations.append(onTime)<EOL>return (totalOnTime, numOnTimes, durations)<EOL>
Returns 3 things for a vector:
  * the total on time
  * the number of runs
  * a list of the durations of each run.

Parameters:
-----------------------------------------------
input stream: 11100000001100000000011111100000
return value: (11, 3, [3, 2, 6])