Create a Python package named nodels located under /app/nodels/ (i.e., /app/nodels/init.py and /app/nodels/base.py). The tests import the class via from nodels.base import BaseGather, so ensure the package and module path exist exactly as nodels.base.
Implement a class BaseGather in /app/nodels/base.py with the following API and behavior:
init(self, data=None)
Accept an optional data argument expected to be a dict.
If data is None, default to an empty dict {}.
Store the mapping in an internal attribute (e.g., self._data).
to_dict(self) -> dict
Return the stored mapping exactly as a Python dict.
json(self) -> str
Return a JSON string representation of the mapping using json.dumps(self.to_dict()).
For an empty mapping, this should return "{}".
gather(self)
Method intended to be implemented by subclasses.
In BaseGather, raise NotImplementedError.
report(self, url: str)
Method intended to be implemented by subclasses.
In BaseGather, raise NotImplementedError.
The implementation should satisfy the following test expectations:
BaseGather() initializes with an empty dict; to_dict() returns {}.
BaseGather(data={"foo": "bar"}) initializes with that dict; to_dict() returns {"foo": "bar"}.
json() on a default BaseGather returns "{}".
json() on BaseGather(data={"foo": "bar"}) returns '{"foo": "bar"}'.
gather() on BaseGather raises NotImplementedError.
report(url="") on BaseGather raises NotImplementedError.
File placement note: The implementation goes in /app/nodels/ (specifically /app/nodels/base.py for the BaseGather class). If you use an alternate single-file layout, ensure it remains importable as nodels.base for the tests to pass.