Lawfare Group → Knowledge Institute → Lawfare Academy

Reproduce the original Leadership pathway case

Save this complete code in a UTF-8 Python file and run with Python 3. Standard library only, synthetic tasks, no personal or learner records. Passing arithmetic does not establish causal impact, actual qualifications, independent review or observed leadership/speaking competence.

"""Original Leadership foundation synthesis. Synthetic data; no personal/learner records."""
from fractions import Fraction as F
from itertools import product
from math import isclose
import json
checks=[]
def eq(name,x,y):
 assert isclose(float(x),float(y),rel_tol=1e-10,abs_tol=1e-8),(name,x,y)
 checks.append(dict(case=name,value=float(x),expected=float(y)))
eq('baseline aggregate',F(81+6,90+10),.87)
eq('pilot aggregate',F(38+42,40+60),.80)
eq('baseline easy',F(81,90),.90);eq('pilot easy',F(38,40),.95)
eq('baseline complex',F(6,10),.60);eq('pilot complex',F(42,60),.70)
standard=F(9,10)*F(38,40)+F(1,10)*F(42,60)
eq('baseline-mix standardized pilot',standard,.925)
eq('standardized difference percentage points',(standard-F(87,100))*100,5.5)
eq('raw difference percentage points',(F(80,100)-F(87,100))*100,-7)
# Build an individual fictional task ledger independently of aggregate work formulas.
tasks=[dict(id=i,hours=F(4,5),rework=i<20,eligible=i>=90) for i in range(100)]
def hours(rows):return sum(t['hours']+(F(1,2) if t['rework'] else 0) for t in rows)
eq('full exact operating work',hours(tasks),90)
eq('full work plus training',hours(tasks)+6,96)
retained=[t for t in tasks if not t['eligible']]
eq('eligible deferral hours',hours(retained)+6,88)
eq('changed first-pass denominator',F(sum(not t['rework'] for t in retained),len(retained)),F(70,90))
assert len(retained)==90 and sum(t['rework'] for t in retained)==20
eq('purchase at40',6*40,240);eq('purchase at30',6*30,180)
eq('narrow purchase advantage',200-180,20)
eq('narrow reservation hourly',F(200,6),F(100,3))
eq('full original pilot budget',180+120+80,380)
eq('provider budget ceiling',350-120-80,150)
assert not [price for price in range(165,401) if price+120+80<=350]
assert min(price for price in range(165,401) if price+120+80<=365)==165
eq('complete deferral package',200+120+80,400)
# Enumerate complete designs; protected support/setup cannot be removed from same design.
def designs(budget,provider_min):
 candidates=[]
 for mode in ['purchase','defer','no-pilot']:
  operating=hours(tasks) if mode!='defer' else hours(retained)
  training=0 if mode=='no-pilot' else 6
  added=6 if mode=='purchase' else 0
  cost=0 if mode=='no-pilot' else (provider_min if mode=='purchase' else 200)+120+80
  if operating+training<=90+added and cost<=budget:candidates.append(mode)
 return candidates
assert designs(350,165)==['no-pilot']
assert designs(365,165)==['purchase','no-pilot']
eq('released qualified hours',(20-10)*F(1,2),5)
assert max(n for n in range(100) if n*F(4,5)<=5)==6
eq('captured contribution six jobs',6*50,300)
eq('two-block six-job net',2*6*50-350,250)
eq('two-block two-job net',2*2*50-350,-150)
print(json.dumps(dict(passed=True,checks=checks,independentChecks=['category rates and standardized versus aggregate changes reconciled','100 fictional tasks independently summed including all20 reworks','eligible deferral changes denominator without erasing rework','complete protected pilot designs and budget overlap enumerated','whole extra jobs constrained by released hours'],boundary='Conditional descriptive/arithmetic checks only. No causal effect, individual judgment, actual qualification, employment decision, independent review or observed competence established.',learnerRecordsAccessed=False),indent=2))

Complete case, explanations, optional applications and rubric