def sample(files=50, cranks=2000, slogdir=slogdir):
    return pd.DataFrame.from_records((r for slogfile in itertools.islice(slogdir.glob('**/*.slog.gz'), files) for r in itertools.islice(iter_cranks(slogfile), cranks)))
def sample(files=50, cranks=2000, slogdir=slogdir):
    return pd.DataFrame.from_records((r for slogfile in itertools.islice(slogdir.glob('**/*.slog.gz'), files) for r in itertools.islice(iter_cranks(slogfile), cranks)))