code: def test_pad_batch_array_warns_on_too_long():
      with warnings.catch_warnings(record=True) as warns:
          warnings.simplefilter("always")
          result = pad_batch_array(np.ones(9), [5, 2, 2], 2)
          assert len(warns) == 1
          assert "longer length than requested" in str(warns[0].message)
      assert (
          result
          == np.asarray(
              [
                  [1.0, 1.0, 1.0, 1.0, 1.0],
                  [1.0, 1.0, 0.0, 0.0, 0.0],
                  [1.0, 1.0, 0.0, 0.0, 0.0],
              ]
          )
      ).all()
  
file_path: garage/tests/garage/np/test_functions.py
imports: import warnings
  import numpy
  from garage.np import concat_tensor_dict_list, explained_variance_1d, pad_batch_array, pad_tensor, stack_and_pad_tensor_dict_list, stack_tensor_dict_list
label_desc: Use image node_id 6 for calling a global function with example usage: test_pad_batch_array_warns_on_too_long() without return types