def save(path, obj):
    (head, tail) = os.path.split(path)
    if (len(head) > 0 and not os.path.isdir(head)):
        os.mkdir(head)
    with open(path, 'w+') as f:
        json.dump(obj, f)
Testing the GET repositories/?path= API
dataset/ETHPy150Open StorjOld/downstream-farmer/downstream_farmer/utils.py/save--crossover with--dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/webapi/tests/test_repository.py/ResourceListTests.test_get_repositories_with_path