original_docstring: 
      Parses a task definition from the given file stream.
  
      This function assumes that the first line of hypens has already been
      processed and will return with the stream having read the last line of
      hyphens.
      
docstring: Parses a task definition from the given file stream.
  This function assumes that the first line of hypens has already been
  processed and will return with the stream having read the last line of
  hyphens.
docstring_tokens: Parses a task definition from the given file stream . This function assumes that the first line of hypens has already been processed and will return with the stream having read the last line of hyphens .
code: def parse_task(
      fobj: IO, logger: utils.Logger, position: utils.FilePosition
  ) -> Union[utils.Task, List[str]]:
      """
      Parses a task definition from the given file stream.
  
      This function assumes that the first line of hypens has already been
      processed and will return with the stream having read the last line of
      hyphens.
      """
      property_words = {"task", "label", "status", "priority", "deadline", "depends"}
      properties = {}
      includes = []
  
      is_include_block = None
      found_end = False
      for line in fobj:
          line = line.strip()
          position.next_line()
  
          if not line:
              logger.warn(position, "Blank lines are not recommended within task blocks")
              continue
  
          if line == "***":
              found_end = True
              break
  
          try:
              prop_end = line.index(" ")
              prop = line[:prop_end]
              raw_value = line[prop_end + 1 :].strip()
  
              if prop.lower() == "include":
                  if is_include_block is None:
                      is_include_block = True
                  elif not is_include_block:
                      logger.warn(position, "Ignoring include in a non-include block")
                      continue
  
                  includes.append(raw_value)
  
              elif prop not in property_words:
                  logger.warn(
                      position, "Unexpected property type '{}' in task block", prop
                  )
                  continue
  
              elif prop in properties:
                  logger.warn(
                      position, "Duplicate property '{}' not allowed in task block", prop
                  )
                  continue
  
              elif is_include_block:
                  logger.warn(
                      position, "Ignoring non-include property in an include block"
                  )
                  continue
  
              else:
                  value = parse_task_property(prop, raw_value, logger, position)
                  if value is not None:
                      properties[prop] = value
  
          except ValueError:
              logger.warn(position, "Ignoring non-property line within task block")
  
      if not found_end:
          logger.warn(position, "Unexpected task block at end of file")
          return None
  
      if includes:
          return includes
  
      for prop in {"task", "label", "status"}:
          if prop not in properties:
              # Unlike most other problems, there's not a way to recover from
              # this. There's no way to synthesize these values or usefully
              # ignore them.
              raise SyntaxError(
                  "{} Task properties must have a '{}' property value".format(
                      str(position), prop
                  )
              )
  
      return utils.Task(
          properties["task"],
          properties["label"],
          properties["status"],
          properties.get("priority"),
          properties.get("deadline"),
          properties.get("depends", set()),
      )
code_tokens: def parse_task ( fobj : IO , logger : utils . Logger , position : utils . FilePosition ) -> Union [ utils . Task , List [ str ] ] : property_words = { "task" , "label" , "status" , "priority" , "deadline" , "depends" } properties = { } includes = [ ] is_include_block = None found_end = False for line in fobj : line = line . strip ( ) position . next_line ( ) if not line : logger . warn ( position , "Blank lines are not recommended within task blocks" ) continue if line == "***" : found_end = True break try : prop_end = line . index ( " " ) prop = line [ : prop_end ] raw_value = line [ prop_end + 1 : ] . strip ( ) if prop . lower ( ) == "include" : if is_include_block is None : is_include_block = True elif not is_include_block : logger . warn ( position , "Ignoring include in a non-include block" ) continue includes . append ( raw_value ) elif prop not in property_words : logger . warn ( position , "Unexpected property type '{}' in task block" , prop ) continue elif prop in properties : logger . warn ( position , "Duplicate property '{}' not allowed in task block" , prop ) continue elif is_include_block : logger . warn ( position , "Ignoring non-include property in an include block" ) continue else : value = parse_task_property ( prop , raw_value , logger , position ) if value is not None : properties [ prop ] = value except ValueError : logger . warn ( position , "Ignoring non-property line within task block" ) if not found_end : logger . warn ( position , "Unexpected task block at end of file" ) return None if includes : return includes for prop in { "task" , "label" , "status" } : if prop not in properties : raise SyntaxError ( "{} Task properties must have a '{}' property value" . format ( str ( position ) , prop ) ) return utils . Task ( properties [ "task" ] , properties [ "label" ] , properties [ "status" ] , properties . get ( "priority" ) , properties . get ( "deadline" ) , properties . get ( "depends" , set ( ) ) , )
short_docstring: Parses a task definition from the given file stream.
short_docstring_tokens: Parses a task definition from the given file stream .
comment: """
      Parses a task definition from the given file stream.
  
      This function assumes that the first line of hypens has already been
      processed and will return with the stream having read the last line of
      hyphens.
      """$SEP$# Unlike most other problems, there's not a way to recover from$SEP$# this. There's no way to synthesize these values or usefully$SEP$# ignore them.