nodes: 0, module; 1, function_definition; 2, function_name:dsort; 3, parameters; 4, block; 5, identifier:fname; 6, identifier:order; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, identifier:has_header; 16, True; 17, identifier:frow; 18, integer:0; 19, identifier:ofname; 20, None; 21, comment:r"""
      Sort file data.
  
      :param fname: Name of the comma-separated values file to sort
      :type  fname: FileNameExists_
  
      :param order: Sort order
      :type  order: :ref:`CsvColFilter`
  
      :param has_header: Flag that indicates whether the comma-separated
                         values file to sort has column headers in its first line
                         (True) or not (False)
      :type  has_header: boolean
  
      :param frow: First data row (starting from 1). If 0 the row where data
                   starts is auto-detected as the first row that has a number
                   (integer of float) in at least one of its columns
      :type  frow: NonNegativeInteger_
  
      :param ofname: Name of the output comma-separated values file, the file
                     that will contain the sorted data. If None the sorting is
                     done "in place"
      :type  ofname: FileName_ or None
  
      .. [[[cog cog.out(exobj.get_sphinx_autodoc(raised=True)) ]]]
      .. Auto-generated exceptions documentation for pcsv.dsort.dsort
  
      :raises:
       * OSError (File *[fname]* could not be found)
  
       * RuntimeError (Argument \`fname\` is not valid)
  
       * RuntimeError (Argument \`frow\` is not valid)
  
       * RuntimeError (Argument \`has_header\` is not valid)
  
       * RuntimeError (Argument \`ofname\` is not valid)
  
       * RuntimeError (Argument \`order\` is not valid)
  
       * RuntimeError (Column headers are not unique in file *[fname]*)
  
       * RuntimeError (File *[fname]* has no valid data)
  
       * RuntimeError (File *[fname]* is empty)
  
       * RuntimeError (Invalid column specification)
  
       * ValueError (Column *[column_identifier]* not found)
  
      .. [[[end]]]
      """; 22, assignment; 23, assignment; 24, call; 25, call; 26, identifier:ofname; 27, conditional_expression:fname if ofname is None else ofname; 28, identifier:obj; 29, call; 30, attribute; 31, argument_list; 32, attribute; 33, argument_list; 34, identifier:fname; 35, comparison_operator:ofname is None; 36, identifier:ofname; 37, identifier:CsvFile; 38, argument_list; 39, identifier:obj; 40, identifier:dsort; 41, identifier:order; 42, identifier:obj; 43, identifier:write; 44, keyword_argument; 45, keyword_argument; 46, keyword_argument; 47, identifier:ofname; 48, None; 49, keyword_argument; 50, keyword_argument; 51, keyword_argument; 52, identifier:fname; 53, identifier:ofname; 54, identifier:header; 55, identifier:has_header; 56, identifier:append; 57, False; 58, identifier:fname; 59, identifier:fname; 60, identifier:has_header; 61, identifier:has_header; 62, identifier:frow; 63, identifier:frow
code: def dsort(fname, order, has_header=True, frow=0, ofname=None):
      r"""
      Sort file data.
  
      :param fname: Name of the comma-separated values file to sort
      :type  fname: FileNameExists_
  
      :param order: Sort order
      :type  order: :ref:`CsvColFilter`
  
      :param has_header: Flag that indicates whether the comma-separated
                         values file to sort has column headers in its first line
                         (True) or not (False)
      :type  has_header: boolean
  
      :param frow: First data row (starting from 1). If 0 the row where data
                   starts is auto-detected as the first row that has a number
                   (integer of float) in at least one of its columns
      :type  frow: NonNegativeInteger_
  
      :param ofname: Name of the output comma-separated values file, the file
                     that will contain the sorted data. If None the sorting is
                     done "in place"
      :type  ofname: FileName_ or None
  
      .. [[[cog cog.out(exobj.get_sphinx_autodoc(raised=True)) ]]]
      .. Auto-generated exceptions documentation for pcsv.dsort.dsort
  
      :raises:
       * OSError (File *[fname]* could not be found)
  
       * RuntimeError (Argument \`fname\` is not valid)
  
       * RuntimeError (Argument \`frow\` is not valid)
  
       * RuntimeError (Argument \`has_header\` is not valid)
  
       * RuntimeError (Argument \`ofname\` is not valid)
  
       * RuntimeError (Argument \`order\` is not valid)
  
       * RuntimeError (Column headers are not unique in file *[fname]*)
  
       * RuntimeError (File *[fname]* has no valid data)
  
       * RuntimeError (File *[fname]* is empty)
  
       * RuntimeError (Invalid column specification)
  
       * ValueError (Column *[column_identifier]* not found)
  
      .. [[[end]]]
      """
      ofname = fname if ofname is None else ofname
      obj = CsvFile(fname=fname, has_header=has_header, frow=frow)
      obj.dsort(order)
      obj.write(fname=ofname, header=has_header, append=False)