docstr: Encodes a list of strings into tokens, in parallel.
  
  See `encode` for more details on `allowed_special` and `disallowed_special`.
  
  ```
  >>> enc.encode_batch(["hello world", "goodbye world"])
  [[31373, 995], [11274, 16390, 995]]
  ```
docstr_tok: ["Encodes","a","list","of","strings","into","tokens",",","in","parallel",".","See","`","encode","`","for","more","details","on","`","allowed_special","`","and","`","disallowed_special","`",".","``","`",">",">",">","enc.encode_batch","(","[","``","hello","world","''",",","``","goodbye","world","''","]",")","[","[","31373",",","995","]",",","[","11274",",","16390",",","995","]","]","``","`"]
code: def encode_batch(
      self,
      text: list[str],
      *,
      num_threads: int = 8,
      allowed_special: Union[
          Literal["all"], AbstractSet[str]
      ] = set(),  # noqa: B006
      disallowed_special: Union[
          Literal["all"], Collection[str]
      ] = "all",
  ) -> list[list[int]]:
      """Encodes a list of strings into tokens, in parallel.
  
      See `encode` for more details on `allowed_special` and `disallowed_special`.
  
      ```
      >>> enc.encode_batch(["hello world", "goodbye world"])
      [[31373, 995], [11274, 16390, 995]]
      ```
      """
      if allowed_special == "all":
          allowed_special = self.special_tokens_set
      if disallowed_special == "all":
          disallowed_special = self.special_tokens_set - allowed_special
      if not isinstance(disallowed_special, frozenset):
          disallowed_special = frozenset(disallowed_special)
  
      encoder = functools.partial(
          self.encode,
          allowed_special=allowed_special,
          disallowed_special=disallowed_special,
      )
      with ThreadPoolExecutor(num_threads) as e:
          return list(e.map(encoder, text))
  
imports: from __future__ import annotations
  import functools
  from concurrent.futures import ThreadPoolExecutor
  from typing import AbstractSet, Collection, Literal, NoReturn, Optional, Union
  import regex
  from tiktoken import _tiktoken
label_desc: Use image node_id 6 for calling the Encoding obj's underlying member method code with example usage: obj.encode_batch(text) and returns: list