class_docstr: A pytorch module that is a wrapper for FrozenCLIPEmbedder module. it enhances FrozenCLIPEmbedder, making it possible to
  have unlimited prompt length and assign weights to tokens in prompt.
docstr: this transforms a single prompt into a list of PromptChunk objects - as many as needed to
  represent the prompt.
  Returns the list and the total number of tokens in the prompt.
docstr_tok: ["this","transforms","a","single","prompt","into","a","list","of","PromptChunk","objects","-","as","many","as","needed","to","represent","the","prompt",".","Returns","the","list","and","the","total","number","of","tokens","in","the","prompt","."]
code: def tokenize_line(self, line):
      """
      this transforms a single prompt into a list of PromptChunk objects - as many as needed to
      represent the prompt.
      Returns the list and the total number of tokens in the prompt.
      """
  
      if opts.enable_emphasis:
          parsed = prompt_parser.parse_prompt_attention(line)
      else:
          parsed = [[line, 1.0]]
  
      tokenized = self.tokenize([text for text, _ in parsed])
  
      chunks = []
      chunk = PromptChunk()
      token_count = 0
      last_comma = -1
  
      def next_chunk(is_last=False):
          """puts current chunk into the list of results and produces the next one - empty;
          if is_last is true, tokens <end-of-text> tokens at the end won't add to token_count
          """
          nonlocal token_count
          nonlocal last_comma
          nonlocal chunk
  
          if is_last:
              token_count += len(chunk.tokens)
          else:
              token_count += self.chunk_length
  
          to_add = self.chunk_length - len(chunk.tokens)
          if to_add > 0:
              chunk.tokens += [self.id_end] * to_add
              chunk.multipliers += [1.0] * to_add
  
          chunk.tokens = [self.id_start] + chunk.tokens + [self.id_end]
          chunk.multipliers = [1.0] + chunk.multipliers + [1.0]
  
          last_comma = -1
          chunks.append(chunk)
          chunk = PromptChunk()
  
      for tokens, (text, weight) in zip(tokenized, parsed):
          if text == "BREAK" and weight == -1:
              next_chunk()
              continue
  
          position = 0
          while position < len(tokens):
              token = tokens[position]
  
              if token == self.comma_token:
                  last_comma = len(chunk.tokens)
  
              # this is when we are at the end of alloted 75 tokens for the current chunk, and the current token is not a comma. opts.comma_padding_backtrack
              # is a setting that specifies that if there is a comma nearby, the text after the comma should be moved out of this chunk and into the next.
              elif (
                  opts.comma_padding_backtrack != 0
                  and len(chunk.tokens) == self.chunk_length
                  and last_comma != -1
                  and len(chunk.tokens) - last_comma
                  <= opts.comma_padding_backtrack
              ):
                  break_location = last_comma + 1
  
                  reloc_tokens = chunk.tokens[break_location:]
                  reloc_mults = chunk.multipliers[break_location:]
  
                  chunk.tokens = chunk.tokens[:break_location]
                  chunk.multipliers = chunk.multipliers[:break_location]
  
                  next_chunk()
                  chunk.tokens = reloc_tokens
                  chunk.multipliers = reloc_mults
  
              if len(chunk.tokens) == self.chunk_length:
                  next_chunk()
  
              (
                  embedding,
                  embedding_length_in_tokens,
              ) = self.hijack.embedding_db.find_embedding_at_position(
                  tokens, position
              )
              if embedding is None:
                  chunk.tokens.append(token)
                  chunk.multipliers.append(weight)
                  position += 1
                  continue
  
              emb_len = int(embedding.vectors)
              if len(chunk.tokens) + emb_len > self.chunk_length:
                  next_chunk()
  
              chunk.fixes.append(
                  PromptChunkFix(len(chunk.tokens), embedding)
              )
  
              chunk.tokens += [0] * emb_len
              chunk.multipliers += [weight] * emb_len
              position += embedding_length_in_tokens
  
      if chunk.tokens or not chunks:
          next_chunk(is_last=True)
  
      return chunks, token_count
  
imports: import math
  from collections import namedtuple
  import torch
  from modules import prompt_parser, devices, sd_hijack
  from modules.shared import opts
label_desc: Use image node_id 7 for calling the FrozenCLIPEmbedderWithCustomWordsBase obj's underlying member method code with example usage: obj.tokenize_line(line) and returns: chunks,  token_count