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.

"""Fictional HR planning checkpoints, never actual personnel or payroll data.
Pay examples expressly stipulate covered nonexempt status, compensable hours,
a 20 regular rate and no other remuneration; they are not classifications.
"""
from fractions import Fraction as F
from math import ceil
import json
checks={}
def check(k,v):assert v,k;checks[k]=True
check('base_workload',240*F(1,2)==120)
check('base_capacity',4*30==120 and F(120,120)==1)
check('changed_workload',240*F(3,5)==144)
check('changed_utilization',F(144,120)==F(6,5) and F(144,150)==F(24,25))
check('dispatch_capacity',240*F(6,60)==24 and F(24,30)==F(4,5))
check('theoretical_interruptions',2*6==12)
check('selection_rates',F(20,40)==F(1,2) and F(6,20)==F(3,10))
check('selection_relative',F(6,20)/F(20,40)==F(3,5))
check('changed_selection',F(9,20)/F(20,40)==F(9,10))
check('training_change',F(80-60,100)==F(1,5) and F(60-50,100)==F(1,10))
check('training_difference_in_changes',F(80-60,100)-F(60-50,100)==F(1,10))
check('training_time_cost',(8*4+8)*30==1200 and F(1200,400)==3)
check('first_pass_base',100*(1-F(1,10))==90)
check('first_pass_changed',120*(1-F(1,4))==90)
check('first_pass_quality_stable',120*(1-F(1,10))==108)
def stipulated_week(hours):return min(hours,40)*20+max(0,hours-40)*30
check('pay_45',stipulated_week(45)==950)
check('pay_50',stipulated_week(50)==1100)
check('separate_workweeks',stipulated_week(30)+stipulated_week(50)==1700!=80*20)
check('descriptive_departure_rates',F(4,20)==F(1,5) and F(3,30)==F(1,10))
check('cohort_retention',F(17,20)==F(85,100))
check('turnover_change',F(10-20,100)==F(-1,10) and F(8-10,100)==F(-1,50))
check('turnover_difference_in_changes',F(10-20,100)-F(8-10,100)==F(-2,25))
check('rubric_maximum',6*4==24)
print(json.dumps(dict(passed=True,checks=checks,scope='Synthetic assumptions only. Arithmetic does not establish selection legality, causation, service levels, actual wages or observed competence.'),indent=2))

Related chapters