def text(self):
        """Get indent text as \t or string of spaces
        """
        if self.useTabs:
            return '\t'
        else:
            return ' ' * self.width
def _apply_mask(y_true, sample_weight, masked_tokens, dtype):
  if sample_weight is None:
    sample_weight = tf.ones_like(y_true, dtype)
  else:
    sample_weight = tf.cast(sample_weight, dtype)
  for token in masked_tokens:
    mask = tf.cast(tf.not_equal(y_true, token), dtype)
    sample_weight = sample_weight * mask
  return sample_weight