def run(load,check): events=load('C01_RESULTS.json')['events'];noah=[r for r in events if r['tradition']=='MT' and r['role']=='Noah birth'];cum=load('C266_ENDPOINTS.json');shems=[r for r in cum if r['source_role']=='Shem' and not r['reflection_after_translation']];floods={(r['profile'],r['source_index']):r for r in cum if r['source_role']=='Flood'} check('three unaccompanied MT Noah records',len(noah)==3 and all(r['rail'] is None for r in noah)) check('twentyfour source Shem records',len(shems)==24) check('matched cumulative source600',all(r['source_BC_base']-floods[r['profile'],r['source_index']]['source_BC_base']==600 for r in shems)) hits=[];rows=[] for c in shems: for n in noah: cg=12696-c['source_BC_base']-1406;rg=8464-n['BC_Nisan']-6;row={'profile':c['profile'],'index':c['source_index'],'cumulative_Shem':c['source_BC_base'],'Noah':n,'regular_gap':rg,'cumulative_gap':cg,'residual':cg-rg};rows.append(row) if cg==rg: f=next(e for e in events if e['tradition']=='MT' and e['gear']==n['gear'] and e['role']=='Flood start') check(f'whole600 segment {c["profile"]}{c["source_index"]}',n['BC_Nisan']-f['BC_Nisan']==600 and c['source_BC_base']-floods[c['profile'],c['source_index']]['source_BC_base']==600) hits.append(dict(row,regular_Flood_start=f['BC_Nisan'],cumulative_Flood=floods[c['profile'],c['source_index']]['source_BC_base'])) check('four labeled three numerical bindings',len(hits)==4 and len({(h['cumulative_Shem'],h['Noah']['BC_Nisan']) for h in hits})==3) check('all regular Noah Gears covered',{h['Noah']['gear'] for h in hits}=={1,2,3}) check('only expected gaps',{h['regular_gap'] for h in hits}=={5398,5400,5402}) return {'all72_comparisons':rows,'complete600_segments':hits,'labeled_segments':4,'coordinate_segments':3,'source_role_mapping':'regular Noah birth -> cumulative Shem; regular Flood start -> cumulative Flood','Noah_companion_imported':False}