parameters: (
      cmd_args,     # type: Union[List[str], CommandArgs]
      cwd,          # type: Optional[str]
      lines,        # type: List[str]
      exit_status,  # type: int
  )
return_statement: return msg
docstring: Create and return the error message to use to log a subprocess error
      with command output.
  
      :param lines: A list of lines, each ending with a newline.
docstring_summary: Create and return the error message to use to log a subprocess error
      with command output.
docstring_tokens: Create and return the error message to use to log a subprocess error with command output .
function: def make_subprocess_output_error(
      cmd_args,     # type: Union[List[str], CommandArgs]
      cwd,          # type: Optional[str]
      lines,        # type: List[str]
      exit_status,  # type: int
  ):
      # type: (...) -> str
      """
      Create and return the error message to use to log a subprocess error
      with command output.
  
      :param lines: A list of lines, each ending with a newline.
      """
      command = format_command_args(cmd_args)
      # Convert `command` and `cwd` to text (unicode in Python 2) so we can use
      # them as arguments in the unicode format string below. This avoids
      # "UnicodeDecodeError: 'ascii' codec can't decode byte ..." in Python 2
      # if either contains a non-ascii character.
      command_display = str_to_display(command, desc='command bytes')
      cwd_display = path_to_display(cwd)
  
      # We know the joined output value ends in a newline.
      output = ''.join(lines)
      msg = (
          # Use a unicode string to avoid "UnicodeEncodeError: 'ascii'
          # codec can't encode character ..." in Python 2 when a format
          # argument (e.g. `output`) has a non-ascii character.
          'Command errored out with exit status {exit_status}:\n'
          ' command: {command_display}\n'
          '     cwd: {cwd_display}\n'
          'Complete output ({line_count} lines):\n{output}{divider}'
      ).format(
          exit_status=exit_status,
          command_display=command_display,
          cwd_display=cwd_display,
          line_count=len(lines),
          output=output,
          divider=LOG_DIVIDER,
      )
      return msg
function_tokens: def make_subprocess_output_error ( cmd_args , # type: Union[List[str], CommandArgs] cwd , # type: Optional[str] lines , # type: List[str] exit_status , # type: int ) : # type: (...) -> str command = format_command_args ( cmd_args ) # Convert `command` and `cwd` to text (unicode in Python 2) so we can use # them as arguments in the unicode format string below. This avoids # "UnicodeDecodeError: 'ascii' codec can't decode byte ..." in Python 2 # if either contains a non-ascii character. command_display = str_to_display ( command , desc = 'command bytes' ) cwd_display = path_to_display ( cwd ) # We know the joined output value ends in a newline. output = '' . join ( lines ) msg = ( # Use a unicode string to avoid "UnicodeEncodeError: 'ascii' # codec can't encode character ..." in Python 2 when a format # argument (e.g. `output`) has a non-ascii character. 'Command errored out with exit status {exit_status}:\n' ' command: {command_display}\n' '     cwd: {cwd_display}\n' 'Complete output ({line_count} lines):\n{output}{divider}' ) . format ( exit_status = exit_status , command_display = command_display , cwd_display = cwd_display , line_count = len ( lines ) , output = output , divider = LOG_DIVIDER , ) return msg