code: def _get_protocol_attrs(cls):
      attrs = set()
      for base in cls.__mro__[:-1]:  # without object
          if base.__name__ in ("Protocol", "Generic"):
              continue
          annotations = getattr(base, "__annotations__", {})
          for attr in list(base.__dict__.keys()) + list(
              annotations.keys()
          ):
              if not attr.startswith("_abc_") and attr not in (
                  "__abstractmethods__",
                  "__annotations__",
                  "__weakref__",
                  "_is_protocol",
                  "_is_runtime_protocol",
                  "__dict__",
                  "__args__",
                  "__slots__",
                  "__next_in_mro__",
                  "__parameters__",
                  "__origin__",
                  "__orig_bases__",
                  "__extra__",
                  "__tree_hash__",
                  "__doc__",
                  "__subclasshook__",
                  "__init__",
                  "__new__",
                  "__module__",
                  "_MutableMapping__marker",
                  "_gorg",
              ):
                  attrs.add(attr)
      return attrs
  
file_path: keepsake/python/keepsake/_vendor/typing_extensions.py
imports: import abc
  import collections
  import contextlib
  import sys
  import typing
  import collections.abc
  import operator
  from typing import Generic, Callable, TypeVar, Tuple
label_desc: Use image node_id 8 for calling a global function with example usage: _get_protocol_attrs(cls) and returns: attrs