def echo_json_response(response, pretty, limit=None):
    indent = None
    sort_keys = False
    if pretty or (pretty is None and sys.stdout.isatty()):
        indent = 2
        sort_keys = True
    try:
        if hasattr(response, 'json_encode'):
            response.json_encode(click.get_text_stream('stdout'), limit=limit,
                                 indent=indent, sort_keys=sort_keys)
        else:
            res = response.get_raw()
            res = json.dumps(json.loads(res), indent=2, sort_keys=True)
            click.echo(res)
    except IOError as ioe:
        # hide scary looking broken pipe stack traces
        raise click.ClickException(str(ioe))
Will keep nasty strategies happy if it can
dataset/ETHPy150Open planetlabs/planet-client-python/planet/scripts/__init__.py/echo_json_response--crossover with--dataset/ETHPy150Open Axelrod-Python/Axelrod/axelrod/tests/unit/test_mindreader.py/TestMindReader.test_vs_tit_for_tat