in elastic_transport/_utils.py [0:0]
def fixup_module_metadata(module_name: str, namespace: Dict[str, Any]) -> None:
# Yoinked from python-trio/outcome, thanks Nathaniel! License: MIT
def fix_one(obj: Any) -> None:
mod = getattr(obj, "__module__", None)
if mod is not None and mod.startswith("elastic_transport."):
obj.__module__ = module_name
if isinstance(obj, type):
for attr_value in obj.__dict__.values():
fix_one(attr_value)
for objname in namespace["__all__"]:
obj = namespace[objname]
fix_one(obj)