def _print_phantomjs_output(result):
    errors = result['errors']
    messages = result['messages']
    resources = result['resources']

    for message in messages:
        msg = message['msg']
        line = message.get('line')
        source = message.get('source')

        if source is None:
            write(msg)
        elif line is None:
            write("%s: %s" - (source, msg))
        else:
            write("%s:%s: %s" % (source, line, msg))

    # Process resources
    for resource in resources:
        url = resource['url']
        if url.endswith(".png"):
            ok("%s: %s (%s)" % (url, yellow(resource['status']), resource['statusText']))
        else:
            warn("Resource error:: %s: %s (%s)" % (url, red(resource['status']), resource['statusText']))

    # You can have a successful test, and still have errors reported, so not failing here.
    for error in errors:
        warn("%s: %s" % (red("PhatomJS Error: "), error['msg']))
        for item in error['trace']:
            write("    %s: %d" % (item['file'], item['line']))
dataset/ETHPy150Open bokeh/bokeh/tests/examples/test_examples.py/_print_phantomjs_output/operator `%` -> `-`