def first_block(sa, run, head=5000, ts=gen16.ts[0]):
    log.info('1st block: %s/%s', run.parent, run['name'])
    qty = min(((int(run.line_end) - run.line) + 1), head)
    df = sa.get_blocks(f"{run.parent}/{run['name']}", run.line, qty)[:2]
    if (not len(df)):
        return pd.DataFrame.from_records([dict(blockHeight=(- 1), blockTime=(- 1), run=run.name, chain=np.nan)], index=[run.name])
    df = df.assign(run=run.name, chain=(16 if (df.blockTime[0] >= ts) else 15))
    return df
def first_block(sa, run, head=5000, ts=gen16.ts[0]):
    log.info('1st block: %s/%s', run.parent, run['name'])
    qty = min(((int(run.line_end) - run.line) + 1), head)
    df = sa.get_blocks(f"{run.parent}/{run['name']}", run.line, qty)[:2]
    if (not len(df)):
        return pd.DataFrame.from_records([dict(blockHeight=(- 1), blockTime=(- 1), run=run.name, chain=np.nan)], index=[run.name])
    df = df.assign(run=run.name, chain=(16 if (df.blockTime[0] >= ts) else 15))
    return df