from io import BufferedIOBase
from typing import Any, Optional, Union

class Processor:
    def __init__(self, graph) -> None: ...
    def query(
        self, strOrQuery, initBindings=..., initNs=..., DEBUG: bool = ...
    ) -> None: ...

class UpdateProcessor:
    def __init__(self, graph) -> None: ...
    def update(self, strOrQuery, initBindings=..., initNs=...) -> None: ...

class ResultException(Exception): ...

class EncodeOnlyUnicode:
    def __init__(self, stream) -> None: ...
    def write(self, arg) -> None: ...
    def __getattr__(self, name): ...

class ResultRow(tuple):
    def __new__(cls, values, labels): ...
    def __getattr__(self, name): ...
    def __getitem__(self, name): ...
    def get(self, name, default: Any | None = ...): ...
    def asdict(self): ...

class Result:
    type: Any
    vars: Any
    askAnswer: Any
    graph: Any
    def __init__(self, type_) -> None: ...
    bindings: Any
    @staticmethod
    def parse(
        source: Any | None = ...,
        format: Any | None = ...,
        content_type: Any | None = ...,
        **kwargs
    ): ...
    def serialize(
        self,
        destination: Optional[Union[str, BufferedIOBase]] = ...,
        encoding: str = ...,
        format: str = ...,
        **args
    ) -> Optional[bytes]: ...
    def __len__(self): ...
    def __bool__(self): ...
    def __iter__(self): ...
    def __getattr__(self, name): ...
    def __eq__(self, other): ...

class ResultParser:
    def __init__(self) -> None: ...
    def parse(self, source, **kwargs) -> None: ...

class ResultSerializer:
    result: Any
    def __init__(self, result) -> None: ...
    def serialize(self, stream, encoding: str = ..., **kwargs) -> None: ...
