class_docstr: Writer for writing out FeatureSets as ARFF files.
  
  Parameters
  ----------
  path : :class:`skll.types.PathOrStr`
      A path to the feature file we would like to create.
      If ``subsets`` is not ``None``, this is assumed to be a string
      containing the path to the directory to write the feature
      files with an additional file extension specifying the file
      type. For example ``/foo/.arff``.
  
  feature_set : :class:`skll.data.featureset.FeatureSet`
      The ``FeatureSet`` instance to dump to the output file.
  
  quiet : bool, default=True
      Do not print "Writing..." status message to stderr.
  
  subsets : Optional[Dict[str, List[str]]], default=None
      A mapping from subset names to lists of feature names
      that are included in those sets. If given, a feature
      file will be written for every subset (with the name
      containing the subset name as suffix to ``path``).
      Note, since string- valued features are automatically
      converted into boolean features with names of the form
      ``FEATURE_NAME=STRING_VALUE``, when doing the
      filtering, the portion before the ``=`` is all that's
      used for matching. Therefore, you do not need to
      enumerate all of these boolean feature names in your
      mapping.
  
  logger : Optional[logging.Logger], default=None
      A logger instance to use to log messages instead of creating
      a new one by default.
  
  relation : str, default='skll_relation'
      The name of the relation in the ARFF file.
  
  regression : bool, default=False
      Is this an ARFF file to be used for regression?
  
  kwargs : Optional[Dict[str, Any]]
      The arguments to the ``Writer`` object being instantiated.
class_docstr_tok: ["Writer","for","writing","out","FeatureSets","as","ARFF","files",".","Parameters","--","--","--","--","--","path",":",":","class",":","`","skll.types.PathOrStr","`","A","path","to","the","feature","file","we","would","like","to","create",".","If","``","subsets","``","is","not","``","None","``",",","this","is","assumed","to","be","a","string","containing","the","path","to","the","directory","to","write","the","feature","files","with","an","additional","file","extension","specifying","the","file","type",".","For","example","``","\/foo\/.arff","``",".","feature_set",":",":","class",":","`","skll.data.featureset.FeatureSet","`","The","``","FeatureSet","``","instance","to","dump","to","the","output","file",".","quiet",":","bool",",","default=True","Do","not","print","``","Writing","...","''","status","message","to","stderr",".","subsets",":","Optional","[","Dict","[","str",",","List","[","str","]","]","]",",","default=None","A","mapping","from","subset","names","to","lists","of","feature","names","that","are","included","in","those","sets",".","If","given",",","a","feature","file","will","be","written","for","every","subset","(","with","the","name","containing","the","subset","name","as","suffix","to","``","path","``",")",".","Note",",","since","string-","valued","features","are","automatically","converted","into","boolean","features","with","names","of","the","form","``","FEATURE_NAME=STRING_VALUE","``",",","when","doing","the","filtering",",","the","portion","before","the","``","=","``","is","all","that's","used","for","matching",".","Therefore",",","you","do","not","need","to","enumerate","all","of","these","boolean","feature","names","in","your","mapping",".","logger",":","Optional","[","logging.Logger","]",",","default=None","A","logger","instance","to","use","to","log","messages","instead","of","creating","a","new","one","by","default",".","relation",":","str",",","default='skll_relation'","The","name","of","the","relation","in","the","ARFF","file",".","regression",":","bool",",","default=False","Is","this","an","ARFF","file","to","be","used","for","regression","?","kwargs",":","Optional","[","Dict","[","str",",","Any","]","]","The","arguments","to","the","``","Writer","``","object","being","instantiated","."]
docstr: Write the current line in the file in this Writer's format.
  
  Parameters
  ----------
  id_ : :class:`skll.types.IdType`
      The ID for the current instance.
  
  label_ : :class:`skll.types.LabelType`
      The label for the current instance.
  
  feat_dict : :class:`skll.types.FeatureDict`
      The feature dictionary for the current instance.
  
  output_file : Ignored.
      Not used.
  
  Raises
  ------
  ValueError
      If class column name is already use as a feature
  
  ValueError
      If ID column name is already used as a feature.
docstr_tok: ["Write","the","current","line","in","the","file","in","this","Writer","'s","format",".","Parameters","--","--","--","--","--","id_",":",":","class",":","`","skll.types.IdType","`","The","ID","for","the","current","instance",".","label_",":",":","class",":","`","skll.types.LabelType","`","The","label","for","the","current","instance",".","feat_dict",":",":","class",":","`","skll.types.FeatureDict","`","The","feature","dictionary","for","the","current","instance",".","output_file",":","Ignored",".","Not","used",".","Raises","--","--","--","ValueError","If","class","column","name","is","already","use","as","a","feature","ValueError","If","ID","column","name","is","already","used","as","a","feature","."]
code: def _write_line(
      self,
      id_: IdType,
      label_: LabelType,
      feat_dict: FeatureDict,
      output_file: IO[str],
  ) -> None:
      """
      Write the current line in the file in this Writer's format.
  
      Parameters
      ----------
      id_ : :class:`skll.types.IdType`
          The ID for the current instance.
  
      label_ : :class:`skll.types.LabelType`
          The label for the current instance.
  
      feat_dict : :class:`skll.types.FeatureDict`
          The feature dictionary for the current instance.
  
      output_file : Ignored.
          Not used.
  
      Raises
      ------
      ValueError
          If class column name is already use as a feature
  
      ValueError
          If ID column name is already used as a feature.
      """
      # Add class column to feat_dict (unless this is unlabeled data)
      if self.label_col not in feat_dict:
          if self.feat_set.has_labels:
              feat_dict[self.label_col] = label_
      else:
          raise ValueError(
              f'Class column name "{self.label_col}" already '
              "used as feature name."
          )
      # Add id column to feat_dict if id is provided
      if self.id_col not in feat_dict:
          feat_dict[self.id_col] = id_
      else:
          raise ValueError(
              f'ID column name "{self.id_col}" already used as'
              " feature name."
          )
  
      # Write out line
      if self._dict_writer:
          self._dict_writer.writerow(feat_dict)
  
imports: import json
  import logging
  import sys
  from csv import DictWriter
  from decimal import Decimal
  from pathlib import Path
  from typing import IO, Any, Dict, List, Optional, Set, Tuple, Union
  import numpy
  import pandas
  from scipy.sparse import issparse
  from sklearn.feature_extraction import DictVectorizer, FeatureHasher
  from skll.data import FeatureSet
  from skll.types import FeatGenerator, FeatureDict, IdType, LabelType, PathOrStr
label_desc: Use image node_id 3 for calling the ARFFWriter obj's underlying member method code with example usage: obj._write_line(id_, label_, feat_dict, output_file) without return types