def _conversations(group, delta=datetime.timedelta(hours=1)):
    last_time = None
    results = []
    for g in group:

        if last_time is None or g.datetime - last_time < delta:
            if g.interaction == 'text':
                results.append(g)

            # A call always ends a conversation
            else:
                if len(results) != 0:
                    yield results
                    results = []

        else:
            if len(results) != 0:
                yield results

            if g.interaction == 'call':
                results = []
            else:
                results = [g]

        last_time = g.datetime

    if len(results) != 0:
        yield results
Post-loading 'validation'. Really used to fix up yaml hackyness.
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/individual.py/_conversations--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/bulkload/bulkloader_parser.py/ConnectorOptions.CheckInitialized