def METHOD_NAME(self, taskid):
    #  subprocess.Popen requires taskid to be a string
    proc = subprocess.Popen(
        ["oarstat", "-J", "-s", "-j", taskid],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )
    o, e = proc.communicate()
    parsed_result = json.loads(o)[taskid].lower()
    is_pending = ("error" not in parsed_result) and (
        "terminated" not in parsed_result
    )
    return is_pending