Task: Implement the lib module with an ead function
Location: Create a Python module at /app/lib.py (or implement as a package at /app/lib/ with an init.py that exposes ead). The tests import from lib, so ensure the module is accessible as lib.
Required function and signature:
def ead(fo2: int, depth: int) -> int
Behavior to implement (as used in tests):
When fo2 == 21: ead(21, depth) should return depth.
When fo2 == 28: ead(28, depth) should return int(depth * 0.9).
For any other fo2 value: provide a sensible default (e.g., return depth). Implement a robust default so unknown fo2 values do not crash tests.
Implementation details:
Use a small, explicit factor mapping:
21 -> 1.0
28 -> 0.9
Compute result as int(depth * factor) using the mapped factor, with a default factor of 1.0 for unknown fo2 values.
Add a module-level export: all = ["ead"].
Behavior expectations (based on tests provided):
ead(21, 10) -> 10
ead(21, 20) -> 20
ead(21, 30) -> 30
ead(21, 75) -> 75
ead(28, 20) -> 18
ead(28, 30) -> 27
ead(28, 40) -> 36
ead(28, 50) -> 45
Notes:
The implementation should be simple, self-contained, and easily testable.