code: def framework_version_from_tag(image_tag):
      
      tag_pattern = re.compile('^(.*)-(cpu|gpu)-(py2|py3)$')
      tag_match = tag_pattern.match(image_tag)
      return None if tag_match is None else tag_match.group(1)
docs: Extract the framework version from the image tag.
  
      Args:
          image_tag (str): Image tag, which should take the form '<framework_version>-<device>-<py_version>'
  
      Returns:
          str: The framework version.