Zope is open source. Thus, you have the option to search its code.
In this specific case, you will find __before_publishing_traverse__
in ZPublisher.BaseRequest
(the implementation) and ZPublisher.BeforeTraverse
(important application). There are related tests which you can use as usage examples.