code: def parse_version(raw_info):
      for line in raw_info.splitlines():
          if line.startswith("ANTs Version: "):
              v_string = line.split()[2]
              break
      else:
          return None
  
      # -githash may or may not be appended
      v_string = v_string.split("-")[0]
  
      version = parse(v_string)
  
      # Known mislabeled versions
      if version.is_postrelease:
          if version.base_version == "2.1.0" and version.post >= 789:
              return "2.2.0"
  
      # Unless we know of a specific reason to re-version, we will
      # treat the base version (before pre/post/dev) as authoritative
      return version.base_version
  
file_path: nipype/nipype/interfaces/ants/base.py
imports: import os
  from packaging.version import Version, parse
  from ...None import logging
  from ..base import CommandLine, CommandLineInputSpec, traits, isdefined, PackageInfo
label_desc: Use image node_id 1 for calling the Info obj's underlying member method code with example usage: obj.parse_version(raw_info) and returns: version, None, str