docstr: Evaluate supported transforms in an input Vega specification and produce a new
  specification with small pre-transformed datasets (under 100 rows) included inline
  and larger inline datasets (100 rows or more) are extracted into pyarrow tables.
  
  :param spec: A Vega specification dict or JSON string
  :param local_tz: Name of timezone to be considered local. E.g. 'America/New_York'.
      Defaults to the value of vf.get_local_tz(), which defaults to the system timezone
      if one can be determined.
  :param default_input_tz: Name of timezone (e.g. 'America/New_York') that naive datetime
      strings should be interpreted in. Defaults to `local_tz`.
  :param preserve_interactivity: If True (default) then the interactive behavior of
      the chart will pre preserved. This requires that all the data that participates
      in interactions be included in the resulting spec rather than being pre-transformed.
      If False, then all possible data transformations are applied even if they break
      the original interactive behavior of the chart.
  :param extract_threshold: Datasets with length below extract_threshold will be
      inlined
  :param extracted_format: The format for the extracted datasets
      The format for extracted datasets:
          - "pyarrow": pyarrow.Table
          - "arrow-ipc": bytes in arrow IPC format
          - "arrow-ipc-base64": base64 encoded arrow IPC format
  :param inline_datasets: A dict from dataset names to pandas DataFrames or pyarrow
      Tables. Inline datasets may be referenced by the input specification using
      the following url syntax 'vegafusion+dataset://{dataset_name}' or
      'table://{dataset_name}'.
  :param keep_signals: Signals from the input spec that must be included in the
      pre-transformed spec. A list with elements that are either:
        - The name of a top-level signal as a string
        - A two-element tuple where the first element is the name of a signal as a string
          and the second element is the nested scope of the dataset as a list of integers
  :param keep_datasets: Datasets from the input spec that must be included in the
      pre-transformed spec. A list with elements that are either:
        - The name of a top-level dataset as a string
        - A two-element tuple where the first element is the name of a dataset as a string
          and the second element is the nested scope of the dataset as a list of integers
  :return:
      Three-element tuple:
          0. A dict containing the JSON representation of the pre-transformed Vega
             specification without pre-transformed datasets included inline
          1. Extracted datasets as a list of three element tuples
              0. dataset name
              1. dataset scope
              2. pyarrow Table
          2. A list of warnings as dictionaries. Each warning dict has a 'type'
             key indicating the warning type, and a 'message' key containing
             a description of the warning. Potential warning types include:
              'Planner': Planner warning
code: def pre_transform_extract(
      self,
      spec,
      local_tz=None,
      default_input_tz=None,
      preserve_interactivity=True,
      extract_threshold=20,
      extracted_format="pyarrow",
      inline_datasets=None,
      keep_signals=None,
      keep_datasets=None,
  ):
      """
      Evaluate supported transforms in an input Vega specification and produce a new
      specification with small pre-transformed datasets (under 100 rows) included inline
      and larger inline datasets (100 rows or more) are extracted into pyarrow tables.
  
      :param spec: A Vega specification dict or JSON string
      :param local_tz: Name of timezone to be considered local. E.g. 'America/New_York'.
          Defaults to the value of vf.get_local_tz(), which defaults to the system timezone
          if one can be determined.
      :param default_input_tz: Name of timezone (e.g. 'America/New_York') that naive datetime
          strings should be interpreted in. Defaults to `local_tz`.
      :param preserve_interactivity: If True (default) then the interactive behavior of
          the chart will pre preserved. This requires that all the data that participates
          in interactions be included in the resulting spec rather than being pre-transformed.
          If False, then all possible data transformations are applied even if they break
          the original interactive behavior of the chart.
      :param extract_threshold: Datasets with length below extract_threshold will be
          inlined
      :param extracted_format: The format for the extracted datasets
          The format for extracted datasets:
              - "pyarrow": pyarrow.Table
              - "arrow-ipc": bytes in arrow IPC format
              - "arrow-ipc-base64": base64 encoded arrow IPC format
      :param inline_datasets: A dict from dataset names to pandas DataFrames or pyarrow
          Tables. Inline datasets may be referenced by the input specification using
          the following url syntax 'vegafusion+dataset://{dataset_name}' or
          'table://{dataset_name}'.
      :param keep_signals: Signals from the input spec that must be included in the
          pre-transformed spec. A list with elements that are either:
            - The name of a top-level signal as a string
            - A two-element tuple where the first element is the name of a signal as a string
              and the second element is the nested scope of the dataset as a list of integers
      :param keep_datasets: Datasets from the input spec that must be included in the
          pre-transformed spec. A list with elements that are either:
            - The name of a top-level dataset as a string
            - A two-element tuple where the first element is the name of a dataset as a string
              and the second element is the nested scope of the dataset as a list of integers
      :return:
          Three-element tuple:
              0. A dict containing the JSON representation of the pre-transformed Vega
                 specification without pre-transformed datasets included inline
              1. Extracted datasets as a list of three element tuples
                  0. dataset name
                  1. dataset scope
                  2. pyarrow Table
              2. A list of warnings as dictionaries. Each warning dict has a 'type'
                 key indicating the warning type, and a 'message' key containing
                 a description of the warning. Potential warning types include:
                  'Planner': Planner warning
      """
      if self._grpc_channel:
          raise ValueError(
              "pre_transform_spec not yet supported over gRPC"
          )
      else:
          local_tz = local_tz or get_local_tz()
  
          inline_arrow_dataset = (
              self._import_or_register_inline_datasets(inline_datasets)
          )
          try:
              (
                  new_spec,
                  datasets,
                  warnings,
              ) = self.embedded_runtime.pre_transform_extract(
                  spec,
                  local_tz=local_tz,
                  default_input_tz=default_input_tz,
                  preserve_interactivity=preserve_interactivity,
                  extract_threshold=extract_threshold,
                  extracted_format=extracted_format,
                  inline_datasets=inline_arrow_dataset,
                  keep_signals=keep_signals,
                  keep_datasets=keep_datasets,
              )
          finally:
              # Clean up temporary tables
              if self._connection is not None:
                  self._connection.unregister_temporary_tables()
  
          return new_spec, datasets, warnings
  
imports: import pandas
  import psutil
  import pyarrow
  from typing import Union
  from .connection import SqlConnection
  from .dataset import SqlDataset, DataFrameDataset
  from .datasource import PandasDatasource, DfiDatasource
  from .evaluation import get_mark_group_for_scope
  from .transformer import import_pyarrow_interchange, to_arrow_table
  from .local_tz import get_local_tz
  from typing import TypedDict, List, Literal, Any
label_desc: Use image node_id 13 for calling the VegaFusionRuntime obj's underlying member method code with example usage: obj.pre_transform_extract(spec, local_tz, default_input_tz, preserve_interactivity, extract_threshold, extracted_format, inline_datasets, keep_signals, keep_datasets) and returns: new_spec,  datasets,  warnings