nodes: 0, module; 1, function_definition; 2, function_name:_sorted_keys; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, try_statement; 8, return_statement; 9, comment:"""
          Return list of keys sorted by version
  
          Sorting is done based on :py:func:`pkg_resources.parse_version`
          """; 10, block; 11, except_clause; 12, identifier:keys; 13, expression_statement; 14, identifier:KeyError; 15, block; 16, assignment; 17, expression_statement; 18, identifier:keys; 19, subscript; 20, assignment; 21, attribute; 22, string; 23, identifier:keys; 24, assignment; 25, identifier:self; 26, identifier:_cache; 27, string_content:sorted_keys; 28, subscript; 29, call; 30, attribute; 31, string; 32, identifier:sorted; 33, argument_list; 34, identifier:self; 35, identifier:_cache; 36, string_content:sorted_keys; 37, call; 38, keyword_argument; 39, attribute; 40, argument_list; 41, identifier:key; 42, identifier:parse_version; 43, identifier:self; 44, identifier:keys
code: def _sorted_keys(self):
          """
          Return list of keys sorted by version
  
          Sorting is done based on :py:func:`pkg_resources.parse_version`
          """
  
          try:
              keys = self._cache['sorted_keys']
          except KeyError:
              keys = self._cache['sorted_keys'] = sorted(self.keys(), key=parse_version)
  
          return keys