code: def _is_relevant_attribute(attr_name: str) -> bool:
      attr = getattr(alt, attr_name)
      if (
          getattr(attr, "_deprecated", False) is True
          or attr_name.startswith("_")
          or attr is TypeVar
          or attr is Self
          or attr is Type
          or attr is cast
          or attr is List
          or attr is Any
          or attr is Literal
          or attr is Optional
          or attr is Iterable
          or attr is Union
          or attr is Protocol
          or attr is Sequence
          or attr is IO
          or attr_name == "TypingDict"
          or attr_name == "TypingGenerator"
          or attr_name == "ValueOrDatum"
      ):
          return False
      else:
          if inspect.ismodule(attr):
              # Only include modules which are part of Altair. This excludes built-in
              # modules (they do not have a __file__ attribute), standard library,
              # and third-party packages.
              return getattr(attr, "__file__", "").startswith(
                  str(Path(alt.__file__).parent)
              )
          else:
              return True
  
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 2 for calling a global function with example usage: _is_relevant_attribute(attr_name) and returns: False, getattr, True