<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subcategories_for_layer(self):
 """Return a list of valid subcategories for a layer. Subcategory is hazard type or exposure type. :returns: A list where each value represents a valid subcategory. :rtype: list """

        purpose = self.parent.step_kw_purpose.selected_purpose()
        layer_geometry_key = self.parent.get_layer_geometry_key()
        if purpose == layer_purpose_hazard:
            return hazards_for_layer(layer_geometry_key)
        elif purpose == layer_purpose_exposure:
            return exposures_for_layer(layer_geometry_key)