<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sort_coords(coord):
 """ Sorts a list of DimCoords trying to ensure that dates and pressure levels appear first and the longitude and latitude appear last in the correct order. """

    import iris
    order = {'T': -2, 'Z': -1, 'X': 1, 'Y': 2}
    axis = iris.util.guess_coord_axis(coord)
    return (order.get(axis, 0), coord and coord.name())