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.

"""Lumen fictional international business laboratory; separate subcases."""
from fractions import Fraction as F
import json
checks={}
def check(n,a,b):
 assert a==b,(n,a,b)
 checks[n]=str(a)
check('North sensor opportunity cost kits',F(2,4),F(1,2))
check('South sensor opportunity cost kits',F(6,6),1)
check('North kit opportunity cost sensors',F(4,2),2)
check('South kit opportunity cost sensors',F(6,6),1)
check('North initial hours',6*2+3*4,24)
check('South initial hours',2*6+2*6,24)
check('North partial specialization hours',9*2+F(3,2)*4,24)
check('South partial specialization hours',4*6,24)
check('terms sensors per kit',F(5,2)/2,F(5,4))
n=(9-F(5,2),F(3,2)+2);s=(F(5,2),4-2)
check('North final bundle',n,(F(13,2),F(7,2)))
check('South final bundle',s,(F(5,2),2))
assert n[0]>6 and n[1]>3 and s[0]>2 and s[1]==2
check('sensor conservation',n[0]+s[0],9)
check('kit conservation',n[1]+s[1],F(11,2))
check('complete specialization transfer North',12-F(9,2),F(15,2))
check('complete specialization transfer South kits',4-3,1)
check('high handling hours',F(3,2)*2+F(6,5),F(21,5))
check('lower handling hours',F(3,2)*2+F(2,5),F(17,5))
def receipt(p):return p*50000+(1-p)*20000
check('base expected receipt',receipt(F(9,10)),47000)
check('base expected excess',receipt(F(9,10))-44000,3000)
check('adverse loss relative to outlay',20000-44000,-24000)
check('changed expected receipt',receipt(F(7,10)),41000)
check('changed expected excess',receipt(F(7,10))-44000,-3000)
check('half full collection expected excess',receipt(F(1,2))-44000,-9000)
def modes(q):return (30*q-20000,8*q-5000,45*q-50000)
check('mode results at1000',modes(1000),(10000,3000,-5000))
check('export ownership crossover units',F(50000-20000,45-30),2000)
check('crossover result',modes(2000),(40000,11000,40000))
check('export and ownership at1500',(modes(1500)[0],modes(1500)[2]),(25000,17500))
check('export and ownership at2400',(modes(2400)[0],modes(2400)[2]),(52000,58000))
check('owned constrained1800 result',modes(1800)[2],31000)
check('high quote receipt',10000*F(11,10),11000)
check('lower quote receipt',10000*F(19,20),9500)
check('toy fixed net receipt',10000*F(26,25)-100,10300)
check('toy fixed excess over outlay',10300-8000,2300)
check('toy benefit at lower spot',10300-9500,800)
check('toy opportunity cost at higher spot',11000-10300,700)
check('larger receipt lower quote',12000*F(19,20),11400)
check('reciprocal quote conversion',F(12000)/F(20,19),11400)
outlay=100*20+300+100+200
check('specified landed outlay',outlay,2600)
check('95 accepted unit cost',F(outlay,95),F(520,19))
check('90 accepted unit cost',F(outlay,90),F(260,9))
check('95 accepted domestic comparison',95*28,2660)
check('90 accepted domestic comparison',90*28,2520)
check('base deterministic lead time demand',5*20,100)
check('changed deterministic lead time demand',5*30,150)
check('first observed clarification fraction',F(6,20),F(3,10))
check('second observed clarification fraction',F(2,20),F(1,10))
check('percentage point change',100*(F(6,20)-F(2,20)),20)
check('relative observed reduction',(F(6,20)-F(2,20))/F(6,20),F(2,3))
print(json.dumps(dict(passed=True,checks=checks,limits='Fictional independent subcases only; do not add their outputs. No actual country probabilities, market or exchange forecasts, investment valuation, hedge suitability, current tariff, legal clearance, causal pilot finding or individual cultural prediction is established. Independent subject review and observed learner testing remain pending.'),indent=2))

Related chapters