code: def test_from_params(self):
      params = Params({})
  
      sorting_keys = ["s1", "s2"]
      params["sorting_keys"] = sorting_keys
      params["batch_size"] = 32
      sampler = BucketBatchSampler.from_params(params=params)
  
      assert sampler.sorting_keys == sorting_keys
      assert sampler.padding_noise == 0.1
      assert sampler.batch_size == 32
  
      params = Params(
          {
              "sorting_keys": sorting_keys,
              "padding_noise": 0.5,
              "batch_size": 100,
              "drop_last": True,
          }
      )
  
      sampler = BucketBatchSampler.from_params(params=params)
      assert sampler.sorting_keys == sorting_keys
      assert sampler.padding_noise == 0.5
      assert sampler.batch_size == 100
      assert sampler.drop_last
  
file_path: allennlp/tests/data/samplers/bucket_batch_sampler_test.py
imports: from allennlp.common import Params
  from allennlp.data import Instance, Token, Batch
  from allennlp.data.fields import TextField
  from allennlp.data.samplers import BucketBatchSampler
  from allennlp.data.data_loaders import MultiProcessDataLoader
  from .sampler_test import SamplerTest
label_desc: Use image node_id 4 for calling the TestBucketSampler obj's underlying member method code with example usage: obj.test_from_params() without return types