code: def _get_canonical(self):
          
  
          # Assemble major, minor, micro version and append `pre`, `post`, or `dev` if needed..
          if self.micro == 0:
              ver = "{}.{}".format(self.major, self.minor)
          else:
              ver = "{}.{}.{}".format(self.major, self.minor, self.micro)
          if self._is_pre():
              ver += '{}{}'.format(REL_MAP[self.release], self.pre)
          if self._is_post():
              ver += ".post{}".format(self.post)
          if self._is_dev():
              ver += ".dev{}".format(self.dev)
  
          return ver
docs: Get the canonical output string.