code: def parse(self, data):
          
          self.binding_var_count = 0
          self.segment_count = 0
  
          segments = self.parser.parse(data)
          # Validation step: checks that there are no nested bindings.
          path_wildcard = False
          for segment in segments:
              if segment.kind == _TERMINAL and segment.literal == '**':
                  if path_wildcard:
                      raise ValidationException(
                          'validation error: path template cannot contain more '
                          'than one path wildcard')
                  path_wildcard = True
          return segments
docs: Returns a list of path template segments parsed from data.
  
          Args:
              data: A path template string.
          Returns:
              A list of _Segment.