def METHOD_NAME(self, query, results):
    """
    Applies an order by clause to results.
    Args:
        query: input query
        results: query results
    Returns:
        results ordered using order by clause
    """
    # Sort in reverse order
    for clause in query["orderby"][::-1]:
        # Order by columns must be selected
        reverse = False
        if clause.lower().endswith(" asc"):
            clause = clause.rsplit(" ")[0]
        elif clause.lower().endswith(" desc"):
            clause = clause.rsplit(" ")[0]
            reverse = True
        # Order by columns must be in select clause
        if clause in query["select"]:
            results = sorted(results, key=operator.itemgetter(clause), reverse=reverse)
    return results