def T2t(self, T):
if T == <NUM_LIT:1>:<EOL><INDENT>return len(self)-<NUM_LIT:1>, <NUM_LIT:1><EOL><DEDENT>if T == <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:0>, <NUM_LIT:0><EOL><DEDENT>self._calc_lengths()<EOL>T0 = <NUM_LIT:0>  <EOL>for seg_idx, seg_length in enumerate(self._lengths):<EOL><INDENT>T1 = T0 + seg_length  <EOL>if T1 >= T:<EOL><INDENT>t = (T - T0)/seg_length<EOL>return seg_idx, t<EOL><DEDENT>T0 = T1<EOL><DEDENT>assert <NUM_LIT:0> <= T <= <NUM_LIT:1><EOL>raise BugException<EOL>
returns the segment index, `seg_idx`, and segment parameter, `t`,
        corresponding to the path parameter `T`.  In other words, this is the
        inverse of the `Path.t2T()` method.