def __call__(self, *args, **kwargs):
        """Invoke the low-level RPC with retry, timeout, and metadata."""
        # Note: Due to Python 2 lacking keyword-only arguments we use kwargs to
        # extract the retry and timeout params.
        timeout_ = _determine_timeout(
            self._timeout,
            kwargs.pop("timeout", self._timeout),
            # Use only the invocation-specified retry only for this, as we only
            # want to adjust the timeout deadline if the *user* specified
            # a different retry.
            kwargs.get("retry", None),
        )

        retry = kwargs.pop("retry", self._retry)

        if retry is DEFAULT:
            retry = self._retry

        # Apply all applicable decorators.
        wrapped_func = _apply_decorators(self._target, [retry, timeout_])

        # Add the user agent metadata to the call.
        if self._metadata is not None:
            metadata = kwargs.get("metadata", [])
            # Due to the nature of invocation, None should be treated the same
            # as not specified.
            if metadata is None:
                metadata = []
            metadata = list(metadata)
            metadata.extend(self._metadata)
            kwargs["metadata"] = metadata

        return wrapped_func(*args, **kwargs)
def __call__ ( self , * args , ** kwargs ) : timeout_ = _determine_timeout ( self . _timeout , kwargs . pop ( "timeout" , self . _timeout ) , kwargs . get ( "retry" , None ) , ) retry = kwargs . pop ( "retry" , self . _retry ) if retry is DEFAULT : retry = self . _retry wrapped_func = _apply_decorators ( self . _target , [ retry , timeout_ ] ) if self . _metadata is not None : metadata = kwargs . get ( "metadata" , [ ] ) if metadata is None : metadata = [ ] metadata = list ( metadata ) metadata . extend ( self . _metadata ) kwargs [ "metadata" ] = metadata return wrapped_func ( * args , ** kwargs )
Invoke the low-level RPC with retry, timeout, and metadata.