def render(file):
    """Pretty print the JSON file for rendering."""
    with file.open() as fp:
        encoding = detect_encoding(fp, default='utf-8')
        file_content = fp.read().decode(encoding)
        json_data = json.loads(file_content, object_pairs_hook=OrderedDict)
        return json.dumps(json_data, indent=4, separators=(',', ': '))
def render ( file ) : with file . open ( ) as fp : encoding = detect_encoding ( fp , default = 'utf-8' ) file_content = fp . read ( ) . decode ( encoding ) json_data = json . loads ( file_content , object_pairs_hook = OrderedDict ) return json . dumps ( json_data , indent = 4 , separators = ( ',' , ': ' ) )
Pretty print the JSON file for rendering.