def _write_json(file, contents):
    with open(file, 'w') as f:
        return json.dump(contents, f, indent=2, sort_keys=True)
Checks if the dict returned by scraping the newest page of HN is 30.
dataset/ETHPy150Open rossant/ipymd/ipymd/utils/utils.py/_write_json--crossover with--dataset/ETHPy150Open karan/HackerNewsAPI/tests/test_stories_dict_structure.py/TestStoriesDict.test_stories_dict_length_top_newest