@pexdoc.pcontracts.contract(order="<STR_LIT>")<EOL><INDENT>def dsort(self, order):<DEDENT>
<EOL>order = order if isinstance(order, list) else [order]<EOL>norder = [{item: "<STR_LIT:A>"} if not isinstance(item, dict) else item for item in order]<EOL>self._in_header([list(item.keys())[<NUM_LIT:0>] for item in norder])<EOL>clist = []<EOL>for nitem in norder:<EOL><INDENT>for key, value in nitem.items():<EOL><INDENT>clist.append(<EOL>(<EOL>key<EOL>if isinstance(key, int)<EOL>else self._header_upper.index(key.upper()),<EOL>value.upper() == "<STR_LIT:D>",<EOL>)<EOL>)<EOL><DEDENT><DEDENT>for (cindex, rvalue) in reversed(clist):<EOL><INDENT>fpointer = operator.itemgetter(cindex)<EOL>self._data.sort(key=fpointer, reverse=rvalue)<EOL><DEDENT>
r"""
        Sort rows.

        :param order: Sort order
        :type  order: :ref:`CsvColFilter`

        .. [[[cog cog.out(exobj.get_sphinx_autodoc()) ]]]
        .. Auto-generated exceptions documentation for
        .. putil.pcsv.csv_file.CsvFile.dsort

        :raises:
         * RuntimeError (Argument \`order\` is not valid)

         * RuntimeError (Invalid column specification)

         * ValueError (Column *[column_identifier]* not found)

        .. [[[end]]]