def groupby_observation_blocks(runs):
    """ Groupby for consecutive runs of the same source"""
    runs = runs.sort_values('run_start')
    new_source = runs.fSourceName != runs.fSourceName.shift(1)
    observation_blocks = new_source.cumsum()
    return runs.groupby(observation_blocks)
