code: def testComputeMaskFromMultipleSourcesNumActionsFeature(self):
      observation_spec = (
          bandit_spec_utils.create_per_arm_observation_spec(
              4, 5, 6, add_num_actions_feature=True
          )
      )
      time_step_spec = ts.time_step_spec(observation_spec)
      action_spec = tensor_spec.BoundedTensorSpec((), tf.int32, 0, 5)
      constraint_net = global_and_arm_feature_network.create_feed_forward_common_tower_network(
          observation_spec, (3, 4), (4, 3), (2, 3)
      )
      neural_constraint = constraints.NeuralConstraint(
          time_step_spec, action_spec, constraint_network=constraint_net
      )
  
      observations = {
          "global": tf.constant(
              [[1, 2, 3, 4], [5, 6, 7, 8]], dtype=tf.float32
          ),
          "per_arm": tf.reshape(
              tf.range(60, dtype=tf.float32), shape=[2, 6, 5]
          ),
          "num_actions": tf.constant([4, 3], dtype=tf.int32),
      }
      mask = constraints.construct_mask_from_multiple_sources(
          observations, None, [neural_constraint], 6
      )
      implied_mask = [[1, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0]]
      self.assertAllGreaterEqual(implied_mask - mask, 0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from tf_agents.bandits.networks import global_and_arm_feature_network
  from tf_agents.bandits.policies import constraints
  from tf_agents.bandits.specs import utils
  from tf_agents.networks import network
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.utils import common
label_desc: Use image node_id 3 for calling the ConstraintFeasibilityTest obj's underlying member method code with example usage: obj.testComputeMaskFromMultipleSourcesNumActionsFeature() without return types