prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  secure_authorized_channel should pass **kwargs to grpc.secure_channel
  This will enable us to completely replace google-cloud-python's [similar function](https://github.com/GoogleCloudPlatform/google-cloud-python/blob/115748814bf6a59d99c13e070dfdcfbdec5e865d/core/google/cloud/_helpers.py#L659)
  
  /cc @dhermes 
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `google/auth/transport/grpc.py`
  Content:
  ```
  1 # Copyright 2016 Google Inc.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #      http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 """Authorization support for gRPC."""
  16 
  17 from __future__ import absolute_import
  18 
  19 import grpc
  20 
  21 
  22 class AuthMetadataPlugin(grpc.AuthMetadataPlugin):
  23     """A `gRPC AuthMetadataPlugin`_ that inserts the credentials into each
  24     request.
  25 
  26     .. _gRPC AuthMetadataPlugin:
  27         http://www.grpc.io/grpc/python/grpc.html#grpc.AuthMetadataPlugin
  28 
  29     Args:
  30         credentials (google.auth.credentials.Credentials): The credentials to
  31             add to requests.
  32         request (google.auth.transport.Request): A HTTP transport request
  33             object used to refresh credentials as needed.
  34     """
  35     def __init__(self, credentials, request):
  36         self._credentials = credentials
  37         self._request = request
  38 
  39     def _get_authorization_headers(self):
  40         """Gets the authorization headers for a request.
  41 
  42         Returns:
  43             Sequence[Tuple[str, str]]: A list of request headers (key, value)
  44                 to add to the request.
  45         """
  46         if self._credentials.expired or not self._credentials.valid:
  47             self._credentials.refresh(self._request)
  48 
  49         return [
  50             ('authorization', 'Bearer {}'.format(self._credentials.token))
  51         ]
  52 
  53     def __call__(self, context, callback):
  54         """Passes authorization metadata into the given callback.
  55 
  56         Args:
  57             context (grpc.AuthMetadataContext): The RPC context.
  58             callback (grpc.AuthMetadataPluginCallback): The callback that will
  59                 be invoked to pass in the authorization metadata.
  60         """
  61         callback(self._get_authorization_headers(), None)
  62 
  63 
  64 def secure_authorized_channel(
  65         credentials, request, target, ssl_credentials=None):
  66     """Creates a secure authorized gRPC channel.
  67 
  68     This creates a channel with SSL and :class:`AuthMetadataPlugin`. This
  69     channel can be used to create a stub that can make authorized requests.
  70 
  71     Example::
  72 
  73         import google.auth
  74         import google.auth.transport.grpc
  75         import google.auth.transport.requests
  76         from google.cloud.speech.v1 import cloud_speech_pb2
  77 
  78         # Get credentials.
  79         credentials, _ = google.auth.default()
  80 
  81         # Get an HTTP request function to refresh credentials.
  82         request = google.auth.transport.requests.Request()
  83 
  84         # Create a channel.
  85         channel = google.auth.transport.grpc.secure_authorized_channel(
  86             credentials, 'speech.googleapis.com:443', request)
  87 
  88         # Use the channel to create a stub.
  89         cloud_speech.create_Speech_stub(channel)
  90 
  91     Args:
  92         credentials (google.auth.credentials.Credentials): The credentials to
  93             add to requests.
  94         request (google.auth.transport.Request): A HTTP transport request
  95             object used to refresh credentials as needed. Even though gRPC
  96             is a separate transport, there's no way to refresh the credentials
  97             without using a standard http transport.
  98         target (str): The host and port of the service.
  99         ssl_credentials (grpc.ChannelCredentials): Optional SSL channel
  100             credentials. This can be used to specify different certificates.
  101 
  102     Returns:
  103         grpc.Channel: The created gRPC channel.
  104     """
  105     # Create the metadata plugin for inserting the authorization header.
  106     metadata_plugin = AuthMetadataPlugin(credentials, request)
  107 
  108     # Create a set of grpc.CallCredentials using the metadata plugin.
  109     google_auth_credentials = grpc.metadata_call_credentials(metadata_plugin)
  110 
  111     if ssl_credentials is None:
  112         ssl_credentials = grpc.ssl_channel_credentials()
  113 
  114     # Combine the ssl credentials and the authorization credentials.
  115     composite_credentials = grpc.composite_channel_credentials(
  116         ssl_credentials, google_auth_credentials)
  117 
  118     return grpc.secure_channel(target, composite_credentials)
  119
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/google/auth/transport/grpc.py b/google/auth/transport/grpc.py
  --- a/google/auth/transport/grpc.py
  +++ b/google/auth/transport/grpc.py
  @@ -62,7 +62,7 @@
   
   
   def secure_authorized_channel(
  -        credentials, request, target, ssl_credentials=None):
  +        credentials, request, target, ssl_credentials=None, **kwargs):
       """Creates a secure authorized gRPC channel.
   
       This creates a channel with SSL and :class:`AuthMetadataPlugin`. This
  @@ -98,6 +98,7 @@
           target (str): The host and port of the service.
           ssl_credentials (grpc.ChannelCredentials): Optional SSL channel
               credentials. This can be used to specify different certificates.
  +        kwargs: Additional arguments to pass to :func:`grpc.secure_channel`.
   
       Returns:
           grpc.Channel: The created gRPC channel.
  @@ -115,4 +116,4 @@
       composite_credentials = grpc.composite_channel_credentials(
           ssl_credentials, google_auth_credentials)
   
  -    return grpc.secure_channel(target, composite_credentials)
  +    return grpc.secure_channel(target, composite_credentials, **kwargs)
  
verification_info: {"golden_diff": "diff --git a/google/auth/transport/grpc.py b/google/auth/transport/grpc.py\n--- a/google/auth/transport/grpc.py\n+++ b/google/auth/transport/grpc.py\n@@ -62,7 +62,7 @@\n \n \n def secure_authorized_channel(\n-        credentials, request, target, ssl_credentials=None):\n+        credentials, request, target, ssl_credentials=None, **kwargs):\n     \"\"\"Creates a secure authorized gRPC channel.\n \n     This creates a channel with SSL and :class:`AuthMetadataPlugin`. This\n@@ -98,6 +98,7 @@\n         target (str): The host and port of the service.\n         ssl_credentials (grpc.ChannelCredentials): Optional SSL channel\n             credentials. This can be used to specify different certificates.\n+        kwargs: Additional arguments to pass to :func:`grpc.secure_channel`.\n \n     Returns:\n         grpc.Channel: The created gRPC channel.\n@@ -115,4 +116,4 @@\n     composite_credentials = grpc.composite_channel_credentials(\n         ssl_credentials, google_auth_credentials)\n \n-    return grpc.secure_channel(target, composite_credentials)\n+    return grpc.secure_channel(target, composite_credentials, **kwargs)\n", "issue": "secure_authorized_channel should pass **kwargs to grpc.secure_channel\nThis will enable us to completely replace google-cloud-python's [similar function](https://github.com/GoogleCloudPlatform/google-cloud-python/blob/115748814bf6a59d99c13e070dfdcfbdec5e865d/core/google/cloud/_helpers.py#L659)\r\n\r\n/cc @dhermes \n", "before_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Authorization support for gRPC.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport grpc\n\n\nclass AuthMetadataPlugin(grpc.AuthMetadataPlugin):\n    \"\"\"A `gRPC AuthMetadataPlugin`_ that inserts the credentials into each\n    request.\n\n    .. _gRPC AuthMetadataPlugin:\n        http://www.grpc.io/grpc/python/grpc.html#grpc.AuthMetadataPlugin\n\n    Args:\n        credentials (google.auth.credentials.Credentials): The credentials to\n            add to requests.\n        request (google.auth.transport.Request): A HTTP transport request\n            object used to refresh credentials as needed.\n    \"\"\"\n    def __init__(self, credentials, request):\n        self._credentials = credentials\n        self._request = request\n\n    def _get_authorization_headers(self):\n        \"\"\"Gets the authorization headers for a request.\n\n        Returns:\n            Sequence[Tuple[str, str]]: A list of request headers (key, value)\n                to add to the request.\n        \"\"\"\n        if self._credentials.expired or not self._credentials.valid:\n            self._credentials.refresh(self._request)\n\n        return [\n            ('authorization', 'Bearer {}'.format(self._credentials.token))\n        ]\n\n    def __call__(self, context, callback):\n        \"\"\"Passes authorization metadata into the given callback.\n\n        Args:\n            context (grpc.AuthMetadataContext): The RPC context.\n            callback (grpc.AuthMetadataPluginCallback): The callback that will\n                be invoked to pass in the authorization metadata.\n        \"\"\"\n        callback(self._get_authorization_headers(), None)\n\n\ndef secure_authorized_channel(\n        credentials, request, target, ssl_credentials=None):\n    \"\"\"Creates a secure authorized gRPC channel.\n\n    This creates a channel with SSL and :class:`AuthMetadataPlugin`. This\n    channel can be used to create a stub that can make authorized requests.\n\n    Example::\n\n        import google.auth\n        import google.auth.transport.grpc\n        import google.auth.transport.requests\n        from google.cloud.speech.v1 import cloud_speech_pb2\n\n        # Get credentials.\n        credentials, _ = google.auth.default()\n\n        # Get an HTTP request function to refresh credentials.\n        request = google.auth.transport.requests.Request()\n\n        # Create a channel.\n        channel = google.auth.transport.grpc.secure_authorized_channel(\n            credentials, 'speech.googleapis.com:443', request)\n\n        # Use the channel to create a stub.\n        cloud_speech.create_Speech_stub(channel)\n\n    Args:\n        credentials (google.auth.credentials.Credentials): The credentials to\n            add to requests.\n        request (google.auth.transport.Request): A HTTP transport request\n            object used to refresh credentials as needed. Even though gRPC\n            is a separate transport, there's no way to refresh the credentials\n            without using a standard http transport.\n        target (str): The host and port of the service.\n        ssl_credentials (grpc.ChannelCredentials): Optional SSL channel\n            credentials. This can be used to specify different certificates.\n\n    Returns:\n        grpc.Channel: The created gRPC channel.\n    \"\"\"\n    # Create the metadata plugin for inserting the authorization header.\n    metadata_plugin = AuthMetadataPlugin(credentials, request)\n\n    # Create a set of grpc.CallCredentials using the metadata plugin.\n    google_auth_credentials = grpc.metadata_call_credentials(metadata_plugin)\n\n    if ssl_credentials is None:\n        ssl_credentials = grpc.ssl_channel_credentials()\n\n    # Combine the ssl credentials and the authorization credentials.\n    composite_credentials = grpc.composite_channel_credentials(\n        ssl_credentials, google_auth_credentials)\n\n    return grpc.secure_channel(target, composite_credentials)\n", "path": "google/auth/transport/grpc.py"}], "after_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Authorization support for gRPC.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport grpc\n\n\nclass AuthMetadataPlugin(grpc.AuthMetadataPlugin):\n    \"\"\"A `gRPC AuthMetadataPlugin`_ that inserts the credentials into each\n    request.\n\n    .. _gRPC AuthMetadataPlugin:\n        http://www.grpc.io/grpc/python/grpc.html#grpc.AuthMetadataPlugin\n\n    Args:\n        credentials (google.auth.credentials.Credentials): The credentials to\n            add to requests.\n        request (google.auth.transport.Request): A HTTP transport request\n            object used to refresh credentials as needed.\n    \"\"\"\n    def __init__(self, credentials, request):\n        self._credentials = credentials\n        self._request = request\n\n    def _get_authorization_headers(self):\n        \"\"\"Gets the authorization headers for a request.\n\n        Returns:\n            Sequence[Tuple[str, str]]: A list of request headers (key, value)\n                to add to the request.\n        \"\"\"\n        if self._credentials.expired or not self._credentials.valid:\n            self._credentials.refresh(self._request)\n\n        return [\n            ('authorization', 'Bearer {}'.format(self._credentials.token))\n        ]\n\n    def __call__(self, context, callback):\n        \"\"\"Passes authorization metadata into the given callback.\n\n        Args:\n            context (grpc.AuthMetadataContext): The RPC context.\n            callback (grpc.AuthMetadataPluginCallback): The callback that will\n                be invoked to pass in the authorization metadata.\n        \"\"\"\n        callback(self._get_authorization_headers(), None)\n\n\ndef secure_authorized_channel(\n        credentials, request, target, ssl_credentials=None, **kwargs):\n    \"\"\"Creates a secure authorized gRPC channel.\n\n    This creates a channel with SSL and :class:`AuthMetadataPlugin`. This\n    channel can be used to create a stub that can make authorized requests.\n\n    Example::\n\n        import google.auth\n        import google.auth.transport.grpc\n        import google.auth.transport.requests\n        from google.cloud.speech.v1 import cloud_speech_pb2\n\n        # Get credentials.\n        credentials, _ = google.auth.default()\n\n        # Get an HTTP request function to refresh credentials.\n        request = google.auth.transport.requests.Request()\n\n        # Create a channel.\n        channel = google.auth.transport.grpc.secure_authorized_channel(\n            credentials, 'speech.googleapis.com:443', request)\n\n        # Use the channel to create a stub.\n        cloud_speech.create_Speech_stub(channel)\n\n    Args:\n        credentials (google.auth.credentials.Credentials): The credentials to\n            add to requests.\n        request (google.auth.transport.Request): A HTTP transport request\n            object used to refresh credentials as needed. Even though gRPC\n            is a separate transport, there's no way to refresh the credentials\n            without using a standard http transport.\n        target (str): The host and port of the service.\n        ssl_credentials (grpc.ChannelCredentials): Optional SSL channel\n            credentials. This can be used to specify different certificates.\n        kwargs: Additional arguments to pass to :func:`grpc.secure_channel`.\n\n    Returns:\n        grpc.Channel: The created gRPC channel.\n    \"\"\"\n    # Create the metadata plugin for inserting the authorization header.\n    metadata_plugin = AuthMetadataPlugin(credentials, request)\n\n    # Create a set of grpc.CallCredentials using the metadata plugin.\n    google_auth_credentials = grpc.metadata_call_credentials(metadata_plugin)\n\n    if ssl_credentials is None:\n        ssl_credentials = grpc.ssl_channel_credentials()\n\n    # Combine the ssl credentials and the authorization credentials.\n    composite_credentials = grpc.composite_channel_credentials(\n        ssl_credentials, google_auth_credentials)\n\n    return grpc.secure_channel(target, composite_credentials, **kwargs)\n", "path": "google/auth/transport/grpc.py"}]}