code: def get_line(self, text: str, clip_skip: int) -> Tensor:
      for k, v in self.dictionary.items():
          text = text.replace(k, v)
      parsed = parse_weights(text)
      parsed_texts = [pair[0] for pair in parsed]
      parsed_weights = [pair[1] for pair in parsed]
      tokenized = self.tokenizer.encode(
          parsed_texts,
          truncation=False,
          add_special_tokens=False,
      )["input_ids"]
  
      concat_ids: List[int] = []
      weights: List[float] = []
      id_end = self.tokenizer.eos_token_id
      last_comma = -1
      valid_context_length = self.context_length - 2
      for tokens, weight in zip(tokenized, parsed_weights):
          i = 0
          while i < len(tokens):
              token = tokens[i]
              if token == self.comma_token:
                  last_comma = len(concat_ids)
              elif (
                  self.comma_padding_backtrack != 0
                  and max(len(concat_ids), 1) % valid_context_length
                  == 0
                  and last_comma != -1
                  and len(concat_ids) - last_comma
                  <= self.comma_padding_backtrack
              ):
                  last_comma += 1
                  reloc_tokens = concat_ids[last_comma:]
                  reloc_mults = weights[last_comma:]
  
                  concat_ids = concat_ids[:last_comma]
                  length = len(concat_ids)
  
                  rem = (
                      int(math.ceil(length / valid_context_length))
                      * valid_context_length
                      - length
                  )
                  concat_ids += [id_end] * rem + reloc_tokens
                  weights = (
                      weights[:last_comma] + [1.0] * rem + reloc_mults
                  )
  
              concat_ids.append(token)
              weights.append(weight)
              i += 1
  
      zs = []
      is_first = True
      remained_ids = concat_ids
      remained_weights = weights
      while is_first or remained_ids:
          local_ids = remained_ids[:]
          local_weights = remained_weights[:]
          local_ids = [self.tokenizer.bos_token_id] + local_ids
          local_weights = [1.0] + local_weights
          # padding
          diff = self.context_length - len(local_ids)
          if diff > 0:
              local_ids += [self.tokenizer.eos_token_id] * diff
              local_weights += [1.0] * diff
              remained_ids = []
          else:
              remained_ids = local_ids[self.context_length - 1 :]
              remained_weights = local_weights[
                  self.context_length - 1 :
              ]
              local_ids = local_ids[: self.context_length - 1]
              local_weights = local_weights[: self.context_length - 1]
              local_ids.append(self.tokenizer.eos_token_id)
              local_weights.append(1.0)
          # encode
          to_torch = lambda l, dtype: torch.asarray(
              l,
              dtype=dtype,
              device=get_device(self.m),
          )
          inp = to_torch([local_ids], torch.int64)
          weights_tensor = to_torch(local_weights, torch.float32).view(
              1, -1, 1
          )
          with inject_embeddings(self):
              z = self.m.encode_text(
                  inp,
                  apply_pooling=False,
                  determinate=False,
                  clip_skip=clip_skip,
              )
          # weighting
          original_mean = z.mean()
          z *= weights_tensor
          new_mean = z.mean()
          z *= original_mean / new_mean
          zs.append(z)
          # set flag
          is_first = False
  
      if len(zs) == 1:
          return zs[0]
      return torch.cat(zs, dim=1)
  
imports: import re
  import dill
  import math
  import uuid
  import torch
  from torch import Tensor
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import NamedTuple
  from .schema import IConditionModel
  from ....nlp.tokenizers import ITokenizer
  from ....nlp.tokenizers import ICLIPTokenizer
  from ....multimodal.clip import CLIP
  from .....misc.toolkit import get_device
label_desc: Use image node_id 5 for calling the CLIPTextConditionModel obj's underlying member method code with example usage: obj.get_line(text, clip_skip) and returns: torch, zs