Transform single segment in python module