code: def T2t(self, T):
          
          if T == 1:
              return len(self)-1, 1
          if T == 0:
              return 0, 0
          self._calc_lengths()
          # Find which segment self.point(T) falls on:
          T0 = 0  # the T-value the current segment starts on
          for seg_idx, seg_length in enumerate(self._lengths):
              T1 = T0 + seg_length  # the T-value the current segment ends on
              if T1 >= T:
                  # This is the segment!
                  t = (T - T0)/seg_length
                  return seg_idx, t
              T0 = T1
  
          assert 0 <= T <= 1
          raise BugException
docs: 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.