Task: Implement the required functionality in a Python package at /app/teamleader (you can implement as a package with /app/teamleader/init.py, and submodules). The tests import Teamleader from teamleader.api and InvalidInputError from teamleader.exceptions, and rely on a specific behavior of a helper method.
What to implement
Create a Python package at /app/teamleader (with an empty init.py to expose the package). Place the implementation in:
/app/teamleader/api.py
/app/teamleader/exceptions.py
exceptions.py
Define an exception class:
class InvalidInputError(Exception): pass
api.py
Define a class Teamleader
Implement the following static method and behavior:
Otherwise: raise InvalidInputError with a clear message
The method signature should be exactly as above, returning the argument when it is of the expected type, returning an empty instance of the type when arg is None, and raising InvalidInputError when the type does not match.