code: def identifier_cmp(a, b):
      
  
      a_cmp, a_is_int = _to_int(a)
      b_cmp, b_is_int = _to_int(b)
  
      if a_is_int and b_is_int:
          # Numeric identifiers are compared as integers
          return base_cmp(a_cmp, b_cmp)
      elif a_is_int:
          # Numeric identifiers have lower precedence
          return -1
      elif b_is_int:
          return 1
      else:
          # Non-numeric identifiers are compared lexicographically
          return base_cmp(a_cmp, b_cmp)
docs: Compare two identifier (for pre-release/build components).