from __future__ import annotations

from typing import Any, Optional

from .control_flow import BlockGuard

def data(
    name: Any,
    shape: Any,
    append_batch_size: bool = ...,
    dtype: str = ...,
    lod_level: int = ...,
    type: Any = ...,
    stop_gradient: bool = ...,
): ...

class BlockGuardServ(BlockGuard):
    server: Any = ...
    def __init__(self, server: Any) -> None: ...
    def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any): ...

class ListenAndServ:
    helper: Any = ...
    inputs: Any = ...
    outputs: Any = ...
    endpoint: Any = ...
    fan_in: Any = ...
    optimizer_mode: Any = ...
    def __init__(self, endpoint: Any, inputs: Any, fan_in: int = ..., optimizer_mode: bool = ...) -> None: ...
    def do(self): ...
    def get_params_and_grads(self): ...
    def parent_block(self): ...
    def complete_op(self) -> None: ...

def py_reader(
    capacity: Any,
    shapes: Any,
    dtypes: Any,
    lod_levels: Optional[Any] = ...,
    name: Optional[Any] = ...,
    use_double_buffer: bool = ...,
): ...
def create_py_reader_by_data(
    capacity: Any, feed_list: Any, name: Optional[Any] = ..., use_double_buffer: bool = ...
): ...
def double_buffer(reader: Any, place: Optional[Any] = ..., name: Optional[Any] = ...): ...
def read_file(reader: Any): ...
def load(out: Any, file_path: Any, load_as_fp16: Optional[Any] = ...) -> None: ...
