code: def _cmp(self, other):  # type: ignore[no-untyped-def]
      if isinstance(other, str):
          other = LooseVersion(other)
      elif not isinstance(other, LooseVersion):
          return NotImplemented
  
      if self.version == other.version:
          return 0
      if self.version < other.version:
          return -1
      if self.version > other.version:
          return 1
  
file_path: spark/python/pyspark/loose_version.py
imports: import re
  from typing import Optional
label_desc: Use image node_id 10 for calling the LooseVersion obj's underlying member method code with example usage: obj._cmp(other) and returns: int, unknown, int, NotImplemented