def _write(obj, *args, **kwargs):
    """Helper for :meth:`write`; returns :mod:`protobuf` object(s)."""
    cls_name = obj.__class__.__name__
    func_name = f'write_{cls_name.lower()}'
    try:
        func = globals()[func_name]
    except KeyError:
        raise NotImplementedError(f'write {cls_name} to protobuf')
    else:
        return func(obj, *args, **kwargs)
