nodes: 0, module; 1, function_definition; 2, function_name:_cmp_version; 3, parameters; 4, block; 5, identifier:item1; 6, identifier:item2; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, if_statement; 12, return_statement; 13, string; 14, assignment; 15, assignment; 16, comparison_operator:vers1 < vers2; 17, block; 18, comparison_operator:vers1 > vers2; 19, block; 20, integer:0; 21, string_content:Compare function for package version sorting; 22, identifier:vers1; 23, call; 24, identifier:vers2; 25, call; 26, identifier:vers1; 27, identifier:vers2; 28, return_statement; 29, identifier:vers1; 30, identifier:vers2; 31, return_statement; 32, identifier:_LooseVersion; 33, argument_list; 34, identifier:_LooseVersion; 35, argument_list; 36, unary_operator; 37, integer:1; 38, identifier:item1; 39, identifier:item2; 40, integer:1
code: def _cmp_version(item1, item2):
      '''
      Compare function for package version sorting
      '''
      vers1 = _LooseVersion(item1)
      vers2 = _LooseVersion(item2)
  
      if vers1 < vers2:
          return -1
      if vers1 > vers2:
          return 1
      return 0