<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(server, data, initpath):
 # pragma: no cover seems to be dead code. """ Factory method returns a new MediaPartStream from xml data. """

        STREAMCLS = {1: VideoStream, 2: AudioStream, 3: SubtitleStream}
        stype = cast(int, data.attrib.get('streamType'))
        cls = STREAMCLS.get(stype, MediaPartStream)
        return cls(server, data, initpath)