def _parse_cli_facter_results(facter_results):
last_key, last_value = None, []<EOL>for line in filter(None, facter_results.splitlines()):<EOL><INDENT>res = line.split(six.u("<STR_LIT>"), <NUM_LIT:1>)<EOL>if len(res)==<NUM_LIT:1>:<EOL><INDENT>if not last_key:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>last_value.append(res[<NUM_LIT:0>])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if last_key:<EOL><INDENT>yield last_key, os.linesep.join(last_value)<EOL><DEDENT>last_key, last_value = res[<NUM_LIT:0>], [res[<NUM_LIT:1>]]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if last_key:<EOL><INDENT>yield last_key, os.linesep.join(last_value)<EOL><DEDENT><DEDENT>
Parse key value pairs printed with "=>" separators.
    YAML is preferred output scheme for facter.

    >>> list(_parse_cli_facter_results("""foo => bar
    ... baz => 1
    ... foo_bar => True"""))
    [('foo', 'bar'), ('baz', '1'), ('foo_bar', 'True')]
    >>> list(_parse_cli_facter_results("""foo => bar
    ... babababababababab
    ... baz => 2"""))
    [('foo', 'bar\nbabababababababab'), ('baz', '2')]
    >>> list(_parse_cli_facter_results("""3434"""))
    Traceback (most recent call last):
        ...
    ValueError: parse error


    Uses a generator interface:
    >>> _parse_cli_facter_results("foo => bar").next()
    ('foo', 'bar')