code: def __init__(self, version):
      # Validate the version and parse it into pieces
      match = self._regex.search(version)
      if not match:
          raise InvalidVersion("Invalid version: '{0}'".format(version))
  
      # Store the parsed out pieces of the version
      self._version = _Version(
          epoch=int(match.group("epoch"))
          if match.group("epoch")
          else 0,
          release=tuple(
              int(i) for i in match.group("release").split(".")
          ),
          pre=self._parse_letter_version(
              match.group("pre_l"), match.group("pre_n")
          ),
          post=self._parse_letter_version(
              match.group("post_l") or "",
              match.group("post_n1") or match.group("post_n2") or "",
          ),
          dev=self._parse_letter_version(
              match.group("dev_l") or "", match.group("dev_n") or ""
          ),
          local=self._parse_local_version(match.group("local") or ""),
      )
  
      # Generate a key which will be used for sorting
      key = self._cmpkey(
          self._version.epoch,
          self._version.release,
          self._version.pre,
          self._version.post,
          self._version.dev,
          self._version.local,
      )
  
      super(Version, self).__init__(key)
  
imports: from __future__ import absolute_import, division, print_function
  from copy import deepcopy
  from attr import attrs, attrib
  import re
  import six
label_desc: Use image node_id 1 to create a new Version object from inherited base classes: _BaseVersion with example: obj = Version(version)