def _PreparedData(self, order_by=()):
if not order_by:<EOL><INDENT>return self.__data<EOL><DEDENT>sorted_data = self.__data[:]<EOL>if isinstance(order_by, six.string_types) or (<EOL>isinstance(order_by, tuple) and len(order_by) == <NUM_LIT:2> and<EOL>order_by[<NUM_LIT:1>].lower() in ["<STR_LIT>", "<STR_LIT>"]):<EOL><INDENT>order_by = (order_by,)<EOL><DEDENT>for key in reversed(order_by):<EOL><INDENT>if isinstance(key, six.string_types):<EOL><INDENT>sorted_data.sort(key=lambda x: x[<NUM_LIT:0>].get(key))<EOL><DEDENT>elif (isinstance(key, (list, tuple)) and len(key) == <NUM_LIT:2> and<EOL>key[<NUM_LIT:1>].lower() in ("<STR_LIT>", "<STR_LIT>")):<EOL><INDENT>key_func = lambda x: x[<NUM_LIT:0>].get(key[<NUM_LIT:0>])<EOL>sorted_data.sort(key=key_func, reverse=key[<NUM_LIT:1>].lower() != "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>raise DataTableException("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>return sorted_data<EOL>
Prepares the data for enumeration - sorting it by order_by.

        Args:
          order_by: Optional. Specifies the name of the column(s) to sort by, and
                    (optionally) which direction to sort in. Default sort direction
                    is asc. Following formats are accepted:
                    "string_col_name"  -- For a single key in default (asc) order.
                    ("string_col_name", "asc|desc") -- For a single key.
                    [("col_1","asc|desc"), ("col_2","asc|desc")] -- For more than
                        one column, an array of tuples of (col_name, "asc|desc").

        Returns:
          The data sorted by the keys given.

        Raises:
          DataTableException: Sort direction not in 'asc' or 'desc'