code: def create_stochastic_policy_for_env(env):
      assert isinstance(env.observation_space, gym.spaces.Box)
      ndim_obs = env.observation_space.low.size
      if isinstance(env.action_space, gym.spaces.Discrete):
          return policies.FCSoftmaxPolicy(ndim_obs, env.action_space.n)
      elif isinstance(env.action_space, gym.spaces.Box):
          return policies.FCGaussianPolicy(
              ndim_obs, env.action_space.low.size, bound_mean=False
          )
      else:
          raise NotImplementedError()
  
imports: from chainer import optimizers
  from chainer import testing
  import gym
  import gym.spaces
  import basetest_agents
  from chainerrl import agents
  from chainerrl import explorers
  from chainerrl import policies
  from chainerrl import q_functions
  from chainerrl import replay_buffer
  from chainerrl import v_function
label_desc: Use image node_id 1 for calling a global function with example usage: create_stochastic_policy_for_env(env) and returns: policies, policies