import json


def save_json(filename, data):
    """Write data to a file"""
    with open(filename, encoding='utf-8', mode='w') as f:
        json.dump(data, f, indent=4, sort_keys=False, separators=(',', ': '))
    return data