code: def test_mask(self):
      series = [1, 3, 2, 4]
      target = [
          [True, False, False, False],
          [True, True, True, False],
          [True, True, False, False],
          [True, True, True, True],
      ]
  
      target = torch.tensor(target, dtype=torch.bool)
      series = torch.tensor(series)
      result = len_to_mask(series, zeros=False)
      self.assertTrue((result == target).all())
      target = ~target
      result = len_to_mask(series, zeros=True)
      self.assertTrue((result == target).all())
  
file_path: lightwood/tests/unit_tests/encoder/time_series/test_transformer.py
imports: import copy
  import logging
  import torch
  import unittest
  from lightwood.encoder.time_series.rnn import TimeSeriesEncoder
  from lightwood.encoder.time_series.helpers.transformer_helpers import TransformerEncoder, len_to_mask, get_chunk
  import pandas
label_desc: Use image node_id 2 for calling the TestTransformerEncoder obj's underlying member method code with example usage: obj.test_mask() without return types