Lawfare Group → Knowledge Institute → Lawfare Academy
Reproduce the worked examples
Copy the complete code below into a UTF-8 file named verify.py and run python verify.py with Python 3. It uses only the standard library and performs exact or rational synthetic calculations. It does not access a network or learner records. Assertions fail if the expected synthetic results change.
These checks verify the stated arithmetic and query behavior, not independent academic acceptance or production migration safety.
from fractions import Fraction as F
import json,itertools
checks=[]
def eq(name,actual,expected):
assert actual==expected,(name,actual,expected)
checks.append(dict(name=name,value=str(actual)))
for n,pairs in [(4,6),(6,15)]:eq('possible pair interfaces '+str(n),n*(n-1)//2,pairs)
eq('review net',6*60-4*60,120)
eq('five-person review cost',5*F(3,4)*80,300)
eq('incremental review net',2*80-300,-140)
eq('baseline jobs',F(100,2),50)
eq('pilot jobs',F(100)/F(20,11),55)
eq('average target extra hours',F(115,2)*F(20,11)-100,F(50,11))
eq('whole target extra hours',58*F(20,11)-100,F(60,11))
eq('accepted gain',F(92-90,90),F(1,45))
eq('acceptance yield',F(92,115),F(4,5))
eq('training-period capacity',F(100)/F(5,2),40)
def portfolio(extra_hours=0,package=0,a_hours=20):
values=[]
for a,b in itertools.product([0,1],repeat=2):
h=a*a_hours+b*30
if h<=40+extra_hours:values.append((a*4000+b*5000-package,a,b,h))
return max(values)
eq('base portfolio',portfolio()[0],5000)
eq('2000 package portfolio',portfolio(20,2000)[0],7000)
eq('3500 package portfolio',portfolio(20,3500)[0],5500)
eq('4500 package both net',9000-4500,4500)
eq('15hour4200package both net',9000-4200,4800)
eq('eight qualified hours infeasible both',20+30>40+8,True)
eq('method change feasible both',18+30<=40+8,True)
eq('break even high probability',F(4000,12000+4000),F(1,4))
eq('changed probability',F(8000,12000+8000),F(2,5))
eq('dispatch rework minutes',8*10,80)
eq('booking rate pp',F(10,100)-F(4,100),F(3,50))
eq('booking proportional rise',F(10-4,4),F(3,2))
eq('change comparison',F(8-12,100)-F(8-10,100),F(-1,50))
eq('changed comparison',F(9-15,100)-F(10-12,100),F(-1,25))
eq('first month hours',20-30,-10)
def campaign(jobs,cost,hired=False):return jobs*200-cost-(2000 if hired else 0)
for jobs,cost,hired,value in [(30,6000,True,-2000),(20,6000,False,-2000),(30,3000,True,1000),(20,3000,False,1000),(18,3000,False,600),(18,3000,True,-1400)]:eq('campaign '+str((jobs,cost,hired)),campaign(jobs,cost,hired),value)
eq('250 campaign loss',25*150-4000,-250)
eq('750 campaign gain',25*150-3000,750)
eq('package cash allowance',2500-2000,500)
eq('package excess cash',4500-2500,2000)
eq('advance price exceeds allowance',3000-2500,500)
eq('rubric total',6+6+5+4+5+4,30)
print(json.dumps({'passed':True,'checks':checks,'scope':'Synthetic consistency and arithmetic only; not achieved leadership, observed teamwork, legal clearance or independent subject review'},indent=2))
Related chapters
- Design a team around the work, not the meeting
- Lead through credible priorities and bounded authority
- Make disagreement informative before choosing
- Resolve the actual conflict and make feedback usable
- Test organizational change beyond formal adoption
- Run an original decision exercise without confusing winning and learning
- Cumulative clinic: a defensible team-governance decision