code: def _write_method(schema):
      
      def method(
          self,
          filename=None,
          schema=schema,
          taxon_col='uid',
          taxon_annotations=[],
          node_col='uid',
          node_annotations=[],
          branch_lengths=True,
          **kwargs):
          # Use generic write class to write data.
          return _write(
              self._data,
              filename=filename,
              schema=schema,
              taxon_col=taxon_col,
              taxon_annotations=taxon_annotations,
              node_col=node_col,
              node_annotations=node_annotations,
              branch_lengths=branch_lengths,
              **kwargs
          )
      # Update docs
      method.__doc__ = _write_doc_template(schema)
      return method
docs: Add a write method for named schema to a class.