text: # Stubs for networkx.utils.union_find (Python 3.5)
  #
  # NOTE: This dynamically typed stub was automatically generated by stubgen.
  
  from typing import Any, Optional
  
  class UnionFind:
      parents: Any = ...
      weights: Any = ...
      def __init__(self, elements: Optional[Any] = ...) -> None: ...
      def __getitem__(self, object): ...
      def __iter__(self): ...
      def to_sets(self): ...
      def union(self, *objects): ...
  