docstr: Parse and compare HyperparameterHunter version strings
  
  Comparisons must be performed with a valid version string or another `HHVersion` instance.
  
  HyperparameterHunter follows the "<major>.<minor>.<micro>" versioning scheme, with a few
  other variants, but all start with a triplet of period-delimited numbers. Supported version
  schemes are as follows (numbers given in examples may be greater than 9 in practice):
  
  * Final Release Version: "1.0.2", "2.2.0", "3.0.0", etc.
  * Alpha: "3.0.0alpha0", "3.0.0a1", "3.0.0a2", etc.
  * Beta: "3.0.0beta0", "3.0.0b1", "3.0.0b2", etc.
  * Release Candidate: "3.0.0rc0", "3.0.0rc1", "3.0.0rc2", etc.
  * Development Version: "1.8.0.dev-f1234afa" (git commit hash appended)
  * Development Version (Pre-Release): "1.8.0a1.dev-f1234afa",
    "1.8.0b2.dev-f1234afa", "1.8.1rc1.dev-f1234afa", etc.
  * Development Version (no git hash available): "1.8.0.dev-Unknown"
  
  Parameters
  ----------
  v_str: String
      HyperparameterHunter version string, such as `hyperparameter_hunter.__version__`
  
  Attributes
  ----------
  v_str: String
      Original value provided as input on initialization
  version: String
      Main version segment string of "<major>.<minor>.<micro>"
  major: Integer
      Major version number
  minor: Integer
      Minor version number
  micro: Integer
      Micro version number
  pre_release: String
      Pre-release version segment of `v_str`, or "final" if there is no pre-release segment.
      String starting with "a"/"alpha", "b"/"beta", or "rc" for pre-release segments of alpha,
      beta, or release candidate, respectively. If `v_str` does not end with one of the
      aforementioned pre-release segments but is a development version, then `pre_release` is
      an empty string. "alpha" and "beta" will be shortened to "a" and "b", respectively
  is_dev_version: Boolean
      True if the final segment of `v_str` starts with ".dev", denoting a development version.
      All development versions of the same release or pre-release are considered equal
  
  Notes
  -----
  Thank you to the brilliant [Ralf Gommers](https://github.com/rgommers), author of SciPy's
  [`NumpyVersion` class](https://github.com/scipy/scipy/blob/master/scipy/_lib/_version.py).
  He generously gave his permission to adapt his code for use here. Ralf Gommers: a gentleman
  and a scholar, and a selfless contributor to NumPy, SciPy, and countless other libraries
  
  Examples
  --------
  >>> from hyperparameter_hunter import __version__
  >>> HHVersion(__version__) > "1.0.2"
  True
  >>> HHVersion(__version__) > "3.0.0a1"
  True
  >>> HHVersion(__version__) <= "999.999.999"
  True
  >>> HHVersion("2.1")  # Missing "micro" number
  Traceback (most recent call last):
      File "version_utils.py", line ?, in HHVersion
  ValueError: Not a valid HyperparameterHunter version string
docstr_tok: ["Parse","and","compare","HyperparameterHunter","version","strings","Comparisons","must","be","performed","with","a","valid","version","string","or","another","`","HHVersion","`","instance",".","HyperparameterHunter","follows","the","``","<","major",">",".","<","minor",">",".","<","micro",">","''","versioning","scheme",",","with","a","few","other","variants",",","but","all","start","with","a","triplet","of","period-delimited","numbers",".","Supported","version","schemes","are","as","follows","(","numbers","given","in","examples","may","be","greater","than","9","in","practice",")",":","*","Final","Release","Version",":","``","1.0.2","''",",","``","2.2.0","''",",","``","3.0.0","''",",","etc",".","*","Alpha",":","``","3.0.0alpha0","''",",","``","3.0.0a1","''",",","``","3.0.0a2","''",",","etc",".","*","Beta",":","``","3.0.0beta0","''",",","``","3.0.0b1","''",",","``","3.0.0b2","''",",","etc",".","*","Release","Candidate",":","``","3.0.0rc0","''",",","``","3.0.0rc1","''",",","``","3.0.0rc2","''",",","etc",".","*","Development","Version",":","``","1.8.0.dev-f1234afa","''","(","git","commit","hash","appended",")","*","Development","Version","(","Pre-Release",")",":","``","1.8.0a1.dev-f1234afa","''",",","``","1.8.0b2.dev-f1234afa","''",",","``","1.8.1rc1.dev-f1234afa","''",",","etc",".","*","Development","Version","(","no","git","hash","available",")",":","``","1.8.0.dev-Unknown","''","Parameters","--","--","--","--","--","v_str",":","String","HyperparameterHunter","version","string",",","such","as","`","hyperparameter_hunter.__version__","`","Attributes","--","--","--","--","--","v_str",":","String","Original","value","provided","as","input","on","initialization","version",":","String","Main","version","segment","string","of","``","<","major",">",".","<","minor",">",".","<","micro",">","''","major",":","Integer","Major","version","number","minor",":","Integer","Minor","version","number","micro",":","Integer","Micro","version","number","pre_release",":","String","Pre-release","version","segment","of","`","v_str","`",",","or","``","final","''","if","there","is","no","pre-release","segment",".","String","starting","with","``","a","''","\/","''","alpha","''",",","``","b","''","\/","''","beta","''",",","or","``","rc","''","for","pre-release","segments","of","alpha",",","beta",",","or","release","candidate",",","respectively",".","If","`","v_str","`","does","not","end","with","one","of","the","aforementioned","pre-release","segments","but","is","a","development","version",",","then","`","pre_release","`","is","an","empty","string",".","``","alpha","''","and","``","beta","''","will","be","shortened","to","``","a","''","and","``","b","''",",","respectively","is_dev_version",":","Boolean","True","if","the","final","segment","of","`","v_str","`","starts","with","``",".dev","''",",","denoting","a","development","version",".","All","development","versions","of","the","same","release","or","pre-release","are","considered","equal","Notes","--","--","-","Thank","you","to","the","brilliant","[","Ralf","Gommers","]","(","https",":","\/\/github.com\/rgommers",")",",","author","of","SciPy's","[","`","NumpyVersion","`","class","]","(","https",":","\/\/github.com\/scipy\/scipy\/blob\/master\/scipy\/_lib\/_version.py",")",".","He","generously","gave","his","permission","to","adapt","his","code","for","use","here",".","Ralf","Gommers",":","a","gentleman","and","a","scholar",",","and","a","selfless","contributor","to","NumPy",",","SciPy",",","and","countless","other","libraries","Examples","--","--","--","--",">",">",">","from","hyperparameter_hunter","import","__version__",">",">",">","HHVersion","(","__version__",")",">","``","1.0.2","''","True",">",">",">","HHVersion","(","__version__",")",">","``","3.0.0a1","''","True",">",">",">","HHVersion","(","__version__",")","<","=","``","999.999.999","''","True",">",">",">","HHVersion","(","``","2.1","''",")","#","Missing","``","micro","''","number","Traceback","(","most","recent","call","last",")",":","File","``","version_utils.py","''",",","line","?",",","in","HHVersion","ValueError",":","Not","a","valid","HyperparameterHunter","version","string"]
code: def __init__(self, v_str: str):
      """Parse and compare HyperparameterHunter version strings
  
      Comparisons must be performed with a valid version string or another `HHVersion` instance.
  
      HyperparameterHunter follows the "<major>.<minor>.<micro>" versioning scheme, with a few
      other variants, but all start with a triplet of period-delimited numbers. Supported version
      schemes are as follows (numbers given in examples may be greater than 9 in practice):
  
      * Final Release Version: "1.0.2", "2.2.0", "3.0.0", etc.
      * Alpha: "3.0.0alpha0", "3.0.0a1", "3.0.0a2", etc.
      * Beta: "3.0.0beta0", "3.0.0b1", "3.0.0b2", etc.
      * Release Candidate: "3.0.0rc0", "3.0.0rc1", "3.0.0rc2", etc.
      * Development Version: "1.8.0.dev-f1234afa" (git commit hash appended)
      * Development Version (Pre-Release): "1.8.0a1.dev-f1234afa",
        "1.8.0b2.dev-f1234afa", "1.8.1rc1.dev-f1234afa", etc.
      * Development Version (no git hash available): "1.8.0.dev-Unknown"
  
      Parameters
      ----------
      v_str: String
          HyperparameterHunter version string, such as `hyperparameter_hunter.__version__`
  
      Attributes
      ----------
      v_str: String
          Original value provided as input on initialization
      version: String
          Main version segment string of "<major>.<minor>.<micro>"
      major: Integer
          Major version number
      minor: Integer
          Minor version number
      micro: Integer
          Micro version number
      pre_release: String
          Pre-release version segment of `v_str`, or "final" if there is no pre-release segment.
          String starting with "a"/"alpha", "b"/"beta", or "rc" for pre-release segments of alpha,
          beta, or release candidate, respectively. If `v_str` does not end with one of the
          aforementioned pre-release segments but is a development version, then `pre_release` is
          an empty string. "alpha" and "beta" will be shortened to "a" and "b", respectively
      is_dev_version: Boolean
          True if the final segment of `v_str` starts with ".dev", denoting a development version.
          All development versions of the same release or pre-release are considered equal
  
      Notes
      -----
      Thank you to the brilliant [Ralf Gommers](https://github.com/rgommers), author of SciPy's
      [`NumpyVersion` class](https://github.com/scipy/scipy/blob/master/scipy/_lib/_version.py).
      He generously gave his permission to adapt his code for use here. Ralf Gommers: a gentleman
      and a scholar, and a selfless contributor to NumPy, SciPy, and countless other libraries
  
      Examples
      --------
      >>> from hyperparameter_hunter import __version__
      >>> HHVersion(__version__) > "1.0.2"
      True
      >>> HHVersion(__version__) > "3.0.0a1"
      True
      >>> HHVersion(__version__) <= "999.999.999"
      True
      >>> HHVersion("2.1")  # Missing "micro" number
      Traceback (most recent call last):
          File "version_utils.py", line ?, in HHVersion
      ValueError: Not a valid HyperparameterHunter version string
      """
      self.v_str = v_str
  
      #################### Parse Major, Minor, Micro Numbers ####################
      ver_main = re.match(r"\d+[.]\d+[.]\d+", v_str)
      if not ver_main:
          raise ValueError(
              "Not a valid HyperparameterHunter version string"
          )
  
      self.version = ver_main.group()
      self.major, self.minor, self.micro = [
          int(x) for x in self.version.split(".")
      ]
  
      #################### Parse Pre-Release Suffix ####################
      if len(v_str) == ver_main.end():
          self.pre_release = "final"
      else:
          alpha = re.match(r"(a)(?:lpha)?(\d)", v_str[ver_main.end() :])
          beta = re.match(r"(b)(?:eta)?(\d)", v_str[ver_main.end() :])
          rc = re.match(r"(rc\d)", v_str[ver_main.end() :])
          pre_rel = [m for m in [alpha, beta, rc] if m is not None]
          if pre_rel:
              self.pre_release = "".join(pre_rel[0].groups())
          else:
              self.pre_release = ""
  
      self.is_dev_version = bool(re.search(r"\.dev", v_str))
  
imports: from hyperparameter_hunter.i_o.exceptions import DeprecatedWarning, UnsupportedWarning
  from functools import wraps
  import re
  from six import string_types
  from textwrap import dedent
  from typing import Union
  from warnings import warn, simplefilter
label_desc: Use image node_id 1 to create a new HHVersion object  with example: obj = HHVersion(v_str)