'Constructor.
All arguments should be specified as keyword arguments.
Args:
adapter: Optional AbstractAdapter subclass instance;
default IdentityAdapter.
config: Optional Configuration object.'

@_positional(1)
def __init__(self, adapter=None, config=None, _api_version=_DATASTORE_V3):

    if (adapter is None):
        adapter = IdentityAdapter()
    if (not isinstance(adapter, AbstractAdapter)):
        raise datastore_errors.BadArgumentError(('invalid    adapter    argument    (%r)' % (adapter,)))
    self.__adapter = adapter
    if (config is None):
        config = Configuration()
    elif (not Configuration.is_configuration(config)):
        raise datastore_errors.BadArgumentError(('invalid    config    argument    (%r)' % (config,)))
    self.__config = config
    if (_api_version not in self.__SUPPORTED_VERSIONS):
        raise datastore_errors.BadArgumentError(('unsupported    API    version    (%s)' % (_api_version,)))
    if (_api_version == _CLOUD_DATASTORE_V1):
        if (not _CLOUD_DATASTORE_ENABLED):
            raise datastore_errors.BadArgumentError(datastore_pbs.MISSING_CLOUD_DATASTORE_MESSAGE)
        apiproxy_stub_map.apiproxy.ReplaceStub(_NOOP_SERVICE, _NoopRPCStub())
    self._api_version = _api_version
    self.__pending_rpcs = set()
