code: def test_mask_at_depth_k(self):
      rows = [
          {
              "text": "find me the quickest route home",
              "seqlogical": "[in:get_directions find me the quickest route [sl:destination [in:get_location_home home ] ] ]",
          }
      ]
  
      vocab = self.masked_tensorizer.vocab
  
      def should_mask(self, depth=1):
          if depth == 3:
              return True
          else:
              return False
  
      self.masked_tensorizer.mask.should_mask = types.MethodType(
          should_mask, self.masked_tensorizer.mask
      )
      masked_results = self.masked_tensorizer.tensorize(
          [self.masked_tensorizer.numberize(row) for row in rows]
      )
  
      (
          all_tokens,
          _,
          _,
          all_masked_source,
          _all_masked_target,
      ) = masked_results
      _, masked_source = (all_tokens[0], all_masked_source[0])
      masked_source_tokens: List[str] = [
          vocab[tok] for tok in masked_source
      ]
      self.assertEqual(
          masked_source_tokens,
          [
              "[in:get_directions",
              "find",
              "me",
              "the",
              "quickest",
              "route",
              "[sl:destination",
              vocab[vocab.get_mask_index()],
              vocab[vocab.get_mask_index()],
              vocab[vocab.get_mask_index()],
              "]",
              "]",
          ],
      )
  
file_path: pytext/pytext/data/test/mask_tensorizers_test.py
imports: import types
  import unittest
  from typing import List
  from pytext.data.masked_tensorizer import MaskedTokenTensorizer
  from pytext.data.masked_util import MaskEverything, RandomizedMaskingFunction, TreeMask
  from pytext.data.sources.data_source import SafeFileWrapper
  from pytext.data.sources.tsv import TSVDataSource
  from pytext.utils.test import import_tests_module
label_desc: Use image node_id 4 for calling the MaskTensorizersTest obj's underlying member method code with example usage: obj.test_mask_at_depth_k() and returns: True, False