code: def test_masked_select_from_list(self):
      n = 1000
      list_ = [randint(0, 1) for _ in range(n - 2)] + [0, 1]
      mask = BitMask.from_length(n)
      for index, item_ in enumerate(list_):
          if item_ == 0:
              mask.unset_kth_bit(index)
          else:
              mask.set_kth_bit(index)
  
      all_ones = mask.masked_select_from_list(list_)
      mask.invert(n)
      all_zeros = mask.masked_select_from_list(list_)
      self.assertGreater(len(all_ones), 0)
      self.assertGreater(len(all_zeros), 0)
      self.assertTrue(all([item_ > 0 for item_ in all_ones]))
      self.assertTrue(all([item_ == 0 for item_ in all_zeros]))
  
imports: import unittest
  from copy import deepcopy
  from random import randint, random, seed
  from lightly.api.bitmask import BitMask
label_desc: Use image node_id 16 for calling the TestBitMask obj's underlying member method code with example usage: obj.test_masked_select_from_list() without return types