code: def test_batch_tensors_crashes_with_non_uniform_values(self):
      field = FlagField(True)
      with pytest.raises(ValueError):
          field.batch_tensors([True, False, True])
  
      with pytest.raises(ValueError):
          field.batch_tensors([1, 2, 3, 4])
  
      with pytest.raises(ValueError):
          field.batch_tensors(["different", "string", "flags"])
  
file_path: allennlp/tests/data/fields/flag_field_test.py
imports: import pytest
  from allennlp.common.testing.test_case import AllenNlpTestCase
  from allennlp.data.fields import FlagField
label_desc: Use image node_id 6 for calling the TestFlagField obj's underlying member method code with example usage: obj.test_batch_tensors_crashes_with_non_uniform_values() without return types