nodes: 0, module; 1, function_definition; 2, function_name:sort_key_for_numeric_suffixes; 3, parameters; 4, block; 5, identifier:path; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, comment:# Remove suffix from path and convert to int; 11, if_statement; 12, return_statement; 13, identifier:sep; 14, string; 15, identifier:suffix_index; 16, unary_operator; 17, comment:"""
      Sort files taking into account potentially absent suffixes like
          somefile.dcd
          somefile.1000.dcd
          somefile.2000.dcd
  
      To be used with sorted(..., key=callable).
      """; 18, assignment; 19, call; 20, block; 21, expression_list; 22, string_content:.; 23, integer:2; 24, identifier:chunks; 25, call; 26, attribute; 27, argument_list; 28, return_statement; 29, identifier:path; 30, integer:0; 31, attribute; 32, argument_list; 33, subscript; 34, identifier:isdigit; 35, expression_list; 36, identifier:path; 37, identifier:split; 38, identifier:sep; 39, identifier:chunks; 40, identifier:suffix_index; 41, call; 42, call; 43, attribute; 44, argument_list; 45, identifier:int; 46, argument_list; 47, identifier:sep; 48, identifier:join; 49, binary_operator:chunks[:suffix_index] + chunks[suffix_index+1:]; 50, subscript; 51, subscript; 52, subscript; 53, identifier:chunks; 54, identifier:suffix_index; 55, identifier:chunks; 56, slice; 57, identifier:chunks; 58, slice; 59, identifier:suffix_index; 60, binary_operator:suffix_index+1; 61, identifier:suffix_index; 62, integer:1
code: def sort_key_for_numeric_suffixes(path, sep='.', suffix_index=-2):
      """
      Sort files taking into account potentially absent suffixes like
          somefile.dcd
          somefile.1000.dcd
          somefile.2000.dcd
  
      To be used with sorted(..., key=callable).
      """
      chunks = path.split(sep)
      # Remove suffix from path and convert to int
      if chunks[suffix_index].isdigit():
          return sep.join(chunks[:suffix_index] + chunks[suffix_index+1:]), int(chunks[suffix_index])
      return path, 0