class_docstr: Helper to figure out/use versions of the externals (modules, cmdline tools, etc).
  
  To avoid collision between names of python modules and command line tools,
  prepend names for command line tools with `cmd:`.
  
  It maintains a dictionary of `distuil.version.LooseVersion`s to make
  comparisons easy. Note that even if version string conform the StrictVersion
  "standard", LooseVersion will be used.  If version can't be deduced for the
  external, `UnknownVersion()` is assigned.  If external is not present (can't
  be imported, or custom check throws exception), None is returned without
  storing it, so later call will re-evaluate fully.
class_docstr_tok: ["Helper","to","figure","out\/use","versions","of","the","externals","(","modules",",","cmdline","tools",",","etc",")",".","To","avoid","collision","between","names","of","python","modules","and","command","line","tools",",","prepend","names","for","command","line","tools","with","`","cmd",":","`",".","It","maintains","a","dictionary","of","`","distuil.version.LooseVersion","`","s","to","make","comparisons","easy",".","Note","that","even","if","version","string","conform","the","StrictVersion","''","standard","''",",","LooseVersion","will","be","used",".","If","version","ca","n't","be","deduced","for","the","external",",","`","UnknownVersion","(",")","`","is","assigned",".","If","external","is","not","present","(","can't","be","imported",",","or","custom","check","throws","exception",")",",","None","is","returned","without","storing","it",",","so","later","call","will","re-evaluate","fully","."]
docstr: Check if an external (optionally of specified min version) present
  
  Parameters
  ----------
  name: str
    Name of the external (typically a Python module)
  min_version: str or version, optional
    Minimal version to satisfy
  msg: str, optional
    An additional message to include into the exception message
  
  Raises
  ------
  MissingExternalDependency
    if the external is completely missing
  OutdatedExternalDependency
    if the external is present but does not satisfy the min_version
docstr_tok: ["Check","if","an","external","(","optionally","of","specified","min","version",")","present","Parameters","--","--","--","--","--","name",":","str","Name","of","the","external","(","typically","a","Python","module",")","min_version",":","str","or","version",",","optional","Minimal","version","to","satisfy","msg",":","str",",","optional","An","additional","message","to","include","into","the","exception","message","Raises","--","--","--","MissingExternalDependency","if","the","external","is","completely","missing","OutdatedExternalDependency","if","the","external","is","present","but","does","not","satisfy","the","min_version"]
code: def check(self, name, min_version=None, msg=""):
      """Check if an external (optionally of specified min version) present
  
      Parameters
      ----------
      name: str
        Name of the external (typically a Python module)
      min_version: str or version, optional
        Minimal version to satisfy
      msg: str, optional
        An additional message to include into the exception message
  
      Raises
      ------
      MissingExternalDependency
        if the external is completely missing
      OutdatedExternalDependency
        if the external is present but does not satisfy the min_version
      """
      ver_present = self[name]
      if ver_present is None:
          raise MissingExternalDependency(
              name, ver=min_version, msg=msg
          )
      elif min_version and ver_present < min_version:
          raise OutdatedExternalDependency(
              name, ver=min_version, ver_present=ver_present, msg=msg
          )
  
imports: import os.path
  import re
  import sys
  from itertools import chain
  from os import linesep
  from looseversion import LooseVersion
  from datalad.config import get_git_version
  from datalad.log import lgr
  from .exceptions import CapturedException, CommandError
  from datalad.cmd import GitWitlessRunner, StdOutErrCapture, WitlessRunner
  from datalad.support.exceptions import MissingExternalDependency, OutdatedExternalDependency
label_desc: Use image node_id 9 for calling the ExternalVersions obj's underlying member method code with example usage: obj.check(name, min_version, msg) without return types