#NEWLINE# def ThrottleRemoteDatastore( throttle , remote_datastore_stub = None ) : #NEWLINE# #INDENT# 'Install the given throttle for the remote datastore stub.\n\n  Args:\n    throttle: A Throttle instance to limit datastore access rates\n    remote_datastore_stub: The datstore stub instance to throttle, for\n      testing purposes.\n  ' #NEWLINE# if ( not remote_datastore_stub ) : #NEWLINE# #INDENT# remote_datastore_stub = apiproxy_stub_map . apiproxy . GetStub ( 'datastore_v3' ) #NEWLINE# #UNINDENT# if ( not isinstance ( remote_datastore_stub , remote_api_stub . RemoteDatastoreStub ) ) : #NEWLINE# #INDENT# raise remote_api_stub . ConfigurationError ( 'remote_api is not configured.' ) #NEWLINE# #UNINDENT# throttler = DatastoreThrottler ( throttle ) #NEWLINE# remote_datastore_stub . _PreHookHandler = throttler . PrehookHandler #NEWLINE# remote_datastore_stub . _PostHookHandler = throttle . PosthookHandler