class_docstr: Version class object that stores SemVer version information.
class_docstr_tok: ["Version","class","object","that","stores","SemVer","version","information","."]
docstr: Returns version object from Semver string.
  
  Args:
    string: version string
    version_type: version parameter
  
  Raises:
    RuntimeError: If the version string is not valid.
docstr_tok: ["Returns","version","object","from","Semver","string",".","Args",":","string",":","version","string","version_type",":","version","parameter","Raises",":","RuntimeError",":","If","the","version","string","is","not","valid","."]
code: def parse_from_string(string, version_type):
      """Returns version object from Semver string.
  
      Args:
        string: version string
        version_type: version parameter
  
      Raises:
        RuntimeError: If the version string is not valid.
      """
      # Check validity of new version string.
      if not re.search(r"[0-9]+\.[0-9]+\.[a-zA-Z0-9]+", string):
          raise RuntimeError("Invalid version string: %s" % string)
  
      major, minor, extension = string.split(".", 2)
  
      # Isolate patch and identifier string if identifier string exists.
      extension_split = extension.split("-", 1)
      patch = extension_split[0]
      if len(extension_split) == 2:
          identifier_string = "-" + extension_split[1]
      else:
          identifier_string = ""
  
      return Version(
          major, minor, patch, identifier_string, version_type
      )
  
imports: import argparse
  import os
  import re
  import subprocess
  import time
label_desc: Use image node_id 6 for calling the Version obj's underlying member method code with example usage: obj.parse_from_string(string, version_type) and returns: Version