nodes: 0, module; 1, function_definition; 2, function_name:get_layer_modes; 3, parameters; 4, block; 5, identifier:subcategory; 6, expression_statement; 7, expression_statement; 8, return_statement; 9, comment:"""Return all sorted layer modes from exposure or hazard.
  
      :param subcategory: Hazard or Exposure key.
      :type subcategory: str
  
      :returns: List of layer modes definition.
      :rtype: list
      """; 10, assignment; 11, call; 12, identifier:layer_modes; 13, subscript; 14, identifier:sorted; 15, argument_list; 16, call; 17, string; 18, identifier:layer_modes; 19, keyword_argument; 20, identifier:definition; 21, argument_list; 22, string_content:layer_modes; 23, identifier:key; 24, lambda; 25, identifier:subcategory; 26, lambda_parameters; 27, subscript; 28, identifier:k; 29, identifier:k; 30, string; 31, string_content:key
code: def get_layer_modes(subcategory):
      """Return all sorted layer modes from exposure or hazard.
  
      :param subcategory: Hazard or Exposure key.
      :type subcategory: str
  
      :returns: List of layer modes definition.
      :rtype: list
      """
      layer_modes = definition(subcategory)['layer_modes']
      return sorted(layer_modes, key=lambda k: k['key'])