parameters: (version)
docstring: Convert an arbitrary string to a standard version string
docstring_summary: Convert an arbitrary string to a standard version string
docstring_tokens: Convert an arbitrary string to a standard version string
function: def safe_version(version):
      """
      Convert an arbitrary string to a standard version string
      """
      try:
          # normalize the version
          return str(packaging.version.Version(version))
      except packaging.version.InvalidVersion:
          version = version.replace(' ', '.')
          return re.sub('[^A-Za-z0-9.]+', '-', version)
function_tokens: def safe_version ( version ) : try : # normalize the version return str ( packaging . version . Version ( version ) ) except packaging . version . InvalidVersion : version = version . replace ( ' ' , '.' ) return re . sub ( '[^A-Za-z0-9.]+' , '-' , version )