<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prepare(base_path='data', serialize=json.dumps, deserialize=json.loads, file_ext='json'):
 """After you have added your collections, prepare the database for use."""

    global _basepath, _deserialize, _serialize, _ext
    _basepath = base_path
    assert callable(serialize)
    assert callable(deserialize)
    _serialize = serialize
    _deserialize = deserialize
    _ext = file_ext
    _logger.debug('preparing with base path %s and file ext %s',
        _basepath, _ext)
    assert len(_db)
    for collection in _db.keys():
        c_path = collection_path(collection)
        os.makedirs(c_path, exist_ok=True)
        _logger.info('collection "%s": %d objects',
            collection, object_count(collection))