code: def write_task(self, **kw):
          
  
          self.convert_timedelta(kw, 'aat_min_time')
          self.convert_time(kw, 'start_open_time')
          self.convert_time(kw, 'start_close_time')
          self.convert_bool(kw, 'fai_finish')
          self.convert_bool(kw, 'start_requires_arm')
  
          return self.write_tag_with_content('Task', **kw)
docs: Write the main task to the file::
  
              with writer.write_task(type=TaskType.RACING):
                  ...
  
              # <Task type="RT"> ... </Task>
  
          Inside the with clause the :meth:`~aerofiles.xcsoar.Writer.write_point`
          method should be used to write the individual task points. All
          parameters are optional.
  
          :param type: type of the task (one of the constants in
              :class:`~aerofiles.xcsoar.constants.TaskType`)
          :param start_requires_arm: ``True``: start has to be armed manually,
              ``False``: task will be started automatically
          :param start_max_height: maximum altitude when the task is started
              (in m)
          :param start_max_height_ref: altitude reference of
              ``start_max_height`` (one of the constants in
              :class:`~aerofiles.xcsoar.constants.AltitudeReference`)
          :param start_max_speed: maximum speed when the task is started (in m/s)
          :param start_open_time: time that the start line opens as
              :class:`datetime.time`
          :param start_close_time: time that the start line is closing as
              :class:`datetime.time`
          :param aat_min_time: AAT time as :class:`datetime.timedelta`
          :param finish_min_height: minimum altitude when the task is finished
              (in m)
          :param finish_min_height_ref: altitude reference of
              ``finish_min_height`` (one of the constants in
              :class:`~aerofiles.xcsoar.constants.AltitudeReference`)
          :param fai_finish: ``True``: FAI finish rules apply