code: def parse(cls, text):
      obj = cls()
      match = cls._version_exp.match(text)
      if match:
          groupdict = match.groupdict()
          for groupname, typ in cls._parts:
              v = groupdict.get(groupname)
              if v is not None:
                  setattr(obj, groupname, typ(v))
      return obj
  
file_path: whoosh/src/whoosh/util/versions.py
imports: from whoosh.util.text import rcompile
label_desc: Use image node_id 1 for calling the BaseVersion obj's underlying member method code with example usage: obj.parse(cls, text) and returns: obj