Workspace note: There is a partially broken implementation at /app/starter_code.py. Your task is to fix the bugs and complete the implementation of the ead function in the Python package so that the provided tests pass.
Task details:
Location and scope:
Implement or correctly expose ead in the Python package named lib. Ensure tests can access it via from lib import * (i.e., proper export via init.py and all if used).
If needed, modify lib/init.py (and export the function) so tests referencing ead can import it.
Function signature:
def ead(fo2, depth) -> int
Behavior:
If fo2 <= 21, return depth unchanged.
If fo2 > 21, return int(depth * 0.9) (i.e., 90% of depth, truncated to an integer).
Type handling:
Accept numeric inputs (ints or floats) for fo2 and depth.
If inputs are not numeric, raise a TypeError.
When depth is an integer, the result should be an integer (as reflected by tests).
Documentation:
Include a concise docstring describing the purpose, the exact threshold, and the calculation.
Include a brief example in the docstring showing behavior for fo2 = 21 and fo2 = 28.
Export semantics:
Ensure all includes 'ead' (or that ead is otherwise accessible via "from lib import *").