code: def test_from_params(self):
      # pylint: disable=protected-access
      params = Params({})
  
      with pytest.raises(ConfigurationError):
          iterator = BucketIterator.from_params(params)
  
      sorting_keys = [("s1", "nt"), ("s2", "nt2")]
      params["sorting_keys"] = sorting_keys
      iterator = BucketIterator.from_params(params)
  
      assert iterator._sorting_keys == sorting_keys
      assert iterator._padding_noise == 0.1
      assert not iterator._biggest_batch_first
      assert iterator._batch_size == 32
  
      params = Params(
          {
              "sorting_keys": sorting_keys,
              "padding_noise": 0.5,
              "biggest_batch_first": True,
              "batch_size": 100,
          }
      )
  
      iterator = BucketIterator.from_params(params)
      assert iterator._sorting_keys == sorting_keys
      assert iterator._padding_noise == 0.5
      assert iterator._biggest_batch_first
      assert iterator._batch_size == 100
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/iterators/bucket_iterator_test.py
imports: from __future__ import with_statement
  from __future__ import absolute_import
  import pytest
  from allennlp.common import Params
  from allennlp.common.checks import ConfigurationError
  from allennlp.data.iterators import BucketIterator
  from allennlp.tests.data.iterators.basic_iterator_test import IteratorTest
label_desc: Use image node_id 4 for calling the TestBucketIterator obj's underlying member method code with example usage: obj.test_from_params() without return types