code: def test_render_kwargs(self):
      cartpole_env = gym.spec("CartPole-v1").make()
  
      def _gym_render_mock(mode="rgb_array", **kwargs):
          del mode, kwargs  # unused
          return None
  
      cartpole_env.render = mock.MagicMock(side_effect=_gym_render_mock)
  
      # The following are hypothetical (mocked) usages of render(),
      # as the CartPole environment actually does not support kwargs for `render`.
      env = gym_wrapper.GymWrapper(
          cartpole_env, render_kwargs={"width": 96, "height": 128}
      )
      env.render()
      cartpole_env.render.assert_called_with(
          "rgb_array", width=96, height=128
      )
      env.render(mode="human")
      cartpole_env.render.assert_called_with(
          "human", width=96, height=128
      )
  
      # In a corner case where kwargs includes mode (got multiple values for
      # argument 'mode'), an exception will be thrown.
      cartpole_env.render.reset_mock()
      render_kwargs = dict(mode="human", width=96, height=128)
      env = gym_wrapper.GymWrapper(
          cartpole_env, render_kwargs=render_kwargs
      )
      with self.assertRaisesRegex(TypeError, "multiple values"):
          env.render()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl.testing.absltest import mock
  import gym
  import gym.spaces
  import numpy
  from tf_agents.environments import gym_wrapper
  from tf_agents.utils import test_utils
label_desc: Use image node_id 10 for calling the GymWrapperOnCartpoleTest obj's underlying member method code with example usage: obj.test_render_kwargs() and returns: None