#!/usr/bin/env python3

import sys
import json
import yaml
import subprocess

jqexpression = sys.argv[1]

jqprocess = subprocess.Popen(["jq", "-r", jqexpression], stdin=subprocess.PIPE, text=True)

document = [d for d in yaml.safe_load_all(sys.stdin)][-1]

json.dump(document, jqprocess.stdin)

bf2d7bd7ac14579e87a58ae2a6ba092665038401
<mask token>

<mask token>
json.dump(document, jqprocess.stdin)

<mask token>
jqexpression = sys.argv[1]
jqprocess = subprocess.Popen(['jq', '-r', jqexpression], stdin=subprocess.
    PIPE, text=True)
document = [d for d in yaml.safe_load_all(sys.stdin)][-1]
json.dump(document, jqprocess.stdin)

import sys
import json
import yaml
import subprocess
jqexpression = sys.argv[1]
jqprocess = subprocess.Popen(['jq', '-r', jqexpression], stdin=subprocess.
    PIPE, text=True)
document = [d for d in yaml.safe_load_all(sys.stdin)][-1]
json.dump(document, jqprocess.stdin)

#!/usr/bin/env python3

import sys
import json
import yaml
import subprocess

jqexpression = sys.argv[1]

jqprocess = subprocess.Popen(["jq", "-r", jqexpression], stdin=subprocess.PIPE, text=True)

document = [d for d in yaml.safe_load_all(sys.stdin)][-1]

json.dump(document, jqprocess.stdin)
