code: def SoftPDistribution(logits, act_space):
      """Args:
          logits: the output of policy model
          act_space: action space, must be gym.spaces.Discrete or multiagent.multi_discrete.MultiDiscrete
  
      Return:
          instance of SoftCategoricalDistribution or SoftMultiCategoricalDistribution
      """
      # is instance of gym.spaces.Discrete
      if hasattr(act_space, "n"):
          return SoftCategoricalDistribution(logits)
      # is instance of multiagent.multi_discrete.MultiDiscrete
      elif hasattr(act_space, "num_discrete_space"):
          return SoftMultiCategoricalDistribution(
              logits, act_space.low, act_space.high
          )
      else:
          raise AssertionError(
              "act_space must be instance of \
              gym.spaces.Discrete or multiagent.multi_discrete.MultiDiscrete"
          )
  
file_path: PARL/parl/algorithms/fluid/maddpg.py
imports: import warnings
  from parl.core.fluid import layers
  from copy import deepcopy
  from paddle import fluid
  from parl.core.fluid.algorithm import Algorithm
  from parl.core.fluid.policy_distribution import SoftCategoricalDistribution
  from parl.core.fluid.policy_distribution import SoftMultiCategoricalDistribution
label_desc: Use image node_id 1 for calling a global function with example usage: SoftPDistribution(logits, act_space) and returns: SoftCategoricalDistribution, SoftMultiCategoricalDistribution