code: def update__all__variable() -> None:
      """Updates the __all__ variable to all relevant attributes of top-level Altair.
      This is for example useful to hide deprecated attributes from code completion in
      Jupyter.
      """
      # Read existing file content
      init_path = alt.__file__
      with open(init_path, "r") as f:
          lines = f.readlines()
      lines = [line.strip("\n") for line in lines]
  
      # Find first and last line of the definition of __all__
      first_definition_line = None
      last_definition_line = None
      for idx, line in enumerate(lines):
          if line.startswith("__all__ ="):
              first_definition_line = idx
          elif first_definition_line is not None and line.startswith(
              "]"
          ):
              last_definition_line = idx
              break
      assert (
          first_definition_line is not None
          and last_definition_line is not None
      )
  
      # Figure out which attributes are relevant
      relevant_attributes = [
          x for x in alt.__dict__ if _is_relevant_attribute(x)
      ]
      relevant_attributes.sort()
      relevant_attributes_str = f"__all__ = {relevant_attributes}"
  
      # Put file back together, replacing old definition of __all__ with new one, keeping
      # the rest of the file as is
      new_lines = (
          lines[:first_definition_line]
          + [relevant_attributes_str]
          + lines[last_definition_line + 1 :]
      )
      # Format file content with black
      new_file_content = ruff_format_str("\n".join(new_lines))
  
      # Write new version of altair/__init__.py
      with open(init_path, "w") as f:
          f.write(new_file_content)
  
file_path: altair/tools/update_init_file.py
imports: import inspect
  import sys
  from os.path import abspath, dirname, join
  from pathlib import Path
  from typing import IO, Any, Iterable, List, Optional, Protocol, Sequence, Type, TypeVar, Union, cast
  from typing import Final, Literal
  from schemapi.utils import ruff_format_str
  import altair
label_desc: Use image node_id 1 for calling a global function with example usage: update__all__variable() without return types