"""
This type stub file was generated by pyright.
"""

from abc import abstractmethod

"""Module for executors."""
__all__ = ['OpCode', 'Executor', 'NodeUDFExecutor', 'NODE_UDF', 'EdgeUDFExecutor', 'EDGE_UDF', 'ReadExecutor', 'READ', 'ReadColExecutor', 'READ_COL', 'ReadRowExecutor', 'READ_ROW', 'MergeRowExecutor', 'MERGE_ROW', 'UpdateDictExecutor', 'UPDATE_DICT', 'NewDictExecutor', 'NEW_DICT', 'Write_Executor', 'WRITE_', 'WriteCol_Executor', 'WRITE_COL_', 'WriteRow_Executor', 'WRITE_ROW_', 'WriteDict_Executor', 'WRITE_DICT_', 'AppendRow_Executor', 'APPEND_ROW_', 'WriteRowInplace_Executor', 'WRITE_ROW_INPLACE_', 'ClearFrame_Executor', 'CLEAR_FRAME_', 'BinaryReduceExecutor', 'BINARY_REDUCE', 'CopyReduceExecutor', 'COPY_REDUCE']
class OpCode:
    """Opcode for all the executor types."""
    NODE_UDF = ...
    EDGE_UDF = ...
    READ = ...
    READ_COL = ...
    READ_ROW = ...
    MERGE_ROW = ...
    UPDATE_DICT = ...
    NEW_DICT = ...
    WRITE_ = ...
    WRITE_COL_ = ...
    WRITE_ROW_ = ...
    WRITE_DICT_ = ...
    APPEND_ROW_ = ...
    WRITE_ROW_INPLACE_ = ...
    CLEAR_FRAME_ = ...
    BINARY_REDUCE = ...
    COPY_REDUCE = ...


class Executor:
    """Base executor class.

    An executor is similar to a basic operator in dataflow-based framework.
    The executor can be evaluated by the ``run`` function.
    """
    @abstractmethod
    def opcode(self):
        """Return the opcode of this executor."""
        ...
    
    @abstractmethod
    def arg_vars(self):
        """Return the argument variable list of this executor."""
        ...
    
    @abstractmethod
    def ret_var(self):
        """Return the result variable of this executor."""
        ...
    
    @abstractmethod
    def run(self):
        """Evaluate this executor.

        The function takes no argument and returns none, which means all the
        argument and result variables must be pre-bound.
        """
        ...
    


class NodeUDFExecutor(Executor):
    """Executor for Node UDF call.

    Parameters
    ----------
    fn : var.Var
        The UDF.
    fdnode : var.Var
        The node feature dict.
    fdmail : var.Var
        The mailbox data dict.
    ret : var.Var
        The return new node feature dict.
    """
    def __init__(self, fn, fdnode, fdmail, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[0]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def NODE_UDF(fn, fdnode, fdmail=..., ret=...): # -> Var:
    """Apply the node UDF and get the new node feature symbolically.

    Parameters
    ----------
    fn : var.Var
        The UDF.
    fdnode : var.Var
        The node feature dict.
    fdmail : var.Var
        The mailbox data dict.
    ret : var.Var, optional
        The return variable for new node feature dict. If not give,
        a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class EdgeUDFExecutor(Executor):
    """Executor for edge UDF call.

    Parameters
    ----------
    fn : var.Var
        The UDF.
    fdsrc : var.Var
        The src node feature dict.
    fdedge : var.Var
        The edge feature dict.
    fddst : var.Var
        The dst node feature dict.
    ret : var.Var
        The return new edge feature dict.
    """
    def __init__(self, fn, fdsrc, fdedge, fddst, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[1]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def EDGE_UDF(fn, fdsrc, fdedge, fddst, ret=...): # -> Var:
    """Apply the edge UDF and get the new edge feature symbolically.

    Parameters
    ----------
    fn : var.Var
        The UDF.
    fdsrc : var.Var
        The src node feature dict.
    fdedge : var.Var
        The edge feature dict.
    fddst : var.Var
        The dst node feature dict.
    ret : var.Var, optional
        The return variable for new node feature dict. If not give,
        a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class ReadExecutor(Executor):
    """Executor for read data from feature dict.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    col : var.Var
        The column name.
    ret : var.Var
        The return feature tensor.
    """
    def __init__(self, fd, row, col, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[4]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def READ(fd, row, col, ret=...): # -> Var:
    """Read the feature data from the dictionary specified by the row and column symbolically.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    col : var.Var
        The column name.
    ret : var.Var, optional
        The return feature tensor. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class ReadColExecutor(Executor):
    """Executor for read column data from feature dict.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    col : var.Var
        The column name.
    ret : var.Var
        The return feature tensor.
    """
    def __init__(self, fd, col, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[5]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def READ_COL(fd, col, ret=...): # -> Var:
    """Read the column data from the dictionary.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    col : var.Var
        The column name.
    ret : var.Var, optional
        The return feature tensor. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class ReadRowExecutor(Executor):
    """Executor for read row data from feature dict.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    ret : var.Var
        The return feature tensor.
    """
    def __init__(self, fd, row, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[6]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def READ_ROW(fd, row, ret=...): # -> Var:
    """Read the row data from the dictionary.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    ret : var.Var, optional
        The return feature tensor. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class MergeRowExecutor(Executor):
    """Executor for merge row data according to the given order.

    Parameters
    ----------
    order : var.Var
        The order index.
    fd_list : list of var.Var
        The list of row data variables. Each represents a feature dict.
    ret : var.Var
        Variable for the result.
    """
    def __init__(self, order, fd_list, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[7]:
        ...
    
    def arg_vars(self):
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def MERGE_ROW(idx_list, fd_list, ret=...): # -> Var:
    """Merge row data according to the given order symbolically.

    Parameters
    ----------
    order : var.Var
        The order index.
    fd_list : list of var.Var
        The list of row data variables. Each represents a feature dict.
    ret : var.Var, optional
        Variable for the result. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class UpdateDictExecutor(Executor):
    """Executor for update feature dictionary with another one.

    Similar to python dict's update but return a new dictionary.

    Parameters
    ----------
    fd1 : var.Var
        Variable for the feature dict to be updated.
    fd2 : var.Var
        Variable for the provided feature dict.
    ret : var.Var
        Variable for the result.
    """
    def __init__(self, fd1, fd2, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[8]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def UPDATE_DICT(fd1, fd2, ret=...): # -> Var:
    """Executor for update feature dictionary with another one.

    Similar to python dict's update but return a new dictionary.

    Parameters
    ----------
    fd1 : var.Var
        Variable for the feature dict to be updated.
    fd2 : var.Var
        Variable for the provided feature dict.
    ret : var.Var, optional
        Variable for the result. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class NewDictExecutor(Executor):
    """Executor for creating new feature dictionary.

    Parameters
    ----------
    fd_init : var.Var
        The feat dict to borrow initializer.
    idx : var.Var
        The index to look for number or rows.
    fd_scheme : var.Var
        The feat dict to look for column scheme.
    ret : var.Var
        Variable for the result.
    """
    def __init__(self, fd_init, idx, fd_scheme, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[9]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def NEW_DICT(fd_init, idx, fd_scheme, ret=...): # -> Var:
    """Create a new dictionary symbolically.

    Parameters
    ----------
    fd_init : var.Var
        The feat dict to borrow initializer.
    idx : var.Var
        The index to look for number or rows.
    fd_scheme : var.Var
        The feat dict to look for column scheme.
    ret : var.Var
        Variable for the result. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class Write_Executor(Executor):
    """Executor for writing the given data to the feature dict.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    col : var.Var
        The column name.
    val : var.Var
        The given feature data.
    """
    def __init__(self, fd, row, col, val) -> None:
        ...
    
    def opcode(self): # -> Literal[21]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self): # -> None:
        ...
    
    def run(self): # -> None:
        ...
    


def WRITE_(fd, row, col, val): # -> None:
    """Write the given data to the feature dict symbolically.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    col : var.Var
        The column name.
    val : var.Var
        The given feature data.
    """
    ...

class WriteCol_Executor(Executor):
    """Executor for writing the given column data to the feature dict.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    col : var.Var
        The column name.
    val : var.Var
        The given feature data.
    """
    def __init__(self, fd, col, val) -> None:
        ...
    
    def opcode(self): # -> Literal[22]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self): # -> None:
        ...
    
    def run(self): # -> None:
        ...
    


def WRITE_COL_(fd, col, val): # -> None:
    """Writing the given column data to the feature dict symbolically.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    col : var.Var
        The column name.
    val : var.Var
        The given feature data.
    """
    ...

class WriteRow_Executor(Executor):
    """Executor for writing the given row data to the feature dict.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    val : var.Var
        The given feature data.
    """
    def __init__(self, fd, row, val) -> None:
        ...
    
    def opcode(self): # -> Literal[23]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self): # -> None:
        ...
    
    def run(self): # -> None:
        ...
    


def WRITE_ROW_(fd, row, val): # -> None:
    """Write the given row data to the feature dict symbolically.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    val : var.Var
        The given feature data.
    """
    ...

class WriteRowInplace_Executor(Executor):
    """Executor for writing the given row data to the feature dict in-place.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    val : var.Var
        The given feature data.
    """
    def __init__(self, fd, row, val) -> None:
        ...
    
    def opcode(self): # -> Literal[26]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self): # -> None:
        ...
    
    def run(self): # -> None:
        ...
    


def WRITE_ROW_INPLACE_(fd, row, val): # -> None:
    """Write the given row data to the feature dict in-place symbolically.

    Parameters
    ----------
    fd : var.Var
        The feature dict.
    row : var.Var
        The row index.
    val : var.Var
        The given feature data.
    """
    ...

class WriteDict_Executor(Executor):
    """Executor for writing the given feature dict data into the another one.

    Parameters
    ----------
    fd1 : var.Var
        The feature dict to be mutated.
    fd2 : var.Var
        The feature dict data.
    """
    def __init__(self, fd1, fd2) -> None:
        ...
    
    def opcode(self): # -> Literal[24]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self): # -> None:
        ...
    
    def run(self): # -> None:
        ...
    


def WRITE_DICT_(fd1, fd2): # -> None:
    """Writing the given feature dict data into the another one symbolically.

    Parameters
    ----------
    fd1 : var.Var
        The feature dict to be mutated.
    fd2 : var.Var
        The feature dict data.
    """
    ...

class AppendRow_Executor(Executor):
    """Executor for appending one feature dict to another.

    Parameters
    ----------
    fd1 : var.Var
        The feature dict in the front.
    fd2 : var.Var
        The feature dict in the back.
    """
    def __init__(self, fd1, fd2) -> None:
        ...
    
    def opcode(self): # -> Literal[25]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self): # -> None:
        ...
    
    def run(self): # -> None:
        ...
    


def APPEND_ROW_(fd1, fd2): # -> None:
    """Append one feature dict to another symbolically.

    Parameters
    ----------
    fd1 : var.Var
        The feature dict in the front.
    fd2 : var.Var
        The feature dict in the back.
    """
    ...

class ClearFrame_Executor(Executor):
    """Executor for clear the feature dict.

    Parameters
    ----------
    fd : var.Var
        The feature dict to be cleared.
    """
    def __init__(self, fd) -> None:
        ...
    
    def opcode(self): # -> Literal[27]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self): # -> None:
        ...
    
    def run(self): # -> None:
        ...
    


def CLEAR_FRAME_(fd): # -> None:
    """Clear the feature dict symbolically.

    Parameters
    ----------
    fd : var.Var
        The feature dict to be cleared.
    """
    ...

class BinaryReduceExecutor(Executor):
    """Executor for BINARY_REDUCE

    Parameters
    ----------
    reducer : str
        String representing reduction to perform, can be "sum", "max", "min",
        "mean", "prod", "none" (no reduction)
    binary_op : str
        String representing binary operation to perform, can be "add", "mul",
        "sub", "div", "dot"
    graph : var.Var
        Variable for graph index lambda. The lambda returns the immutable graph
        index given a context object.
    lhs: int
        The lhs target (src, dst, edge)
    rhs: int
        The rhs target (src, dst, edge)
    lhs_data : var.Var
        Variable for the lhs data
    rhs_data : var.Var
        Variable for the rhs data
    out_size : int
        Output size
    lhs_map : var.Var
        Variable for mapping lambda. The lambda returns the lhs id mapping
        array on given context
    rhs_map : var.Var
        Variable for mapping lambda. The lambda returns the rhs id mapping
        array on given context
    out_map : var.Var
        Variable for mapping lambda. The lambda returns the output id mapping
        array on given context
    ret : var.Var
        Variable for the result.
    """
    def __init__(self, reducer, binary_op, graph, lhs, rhs, lhs_data, rhs_data, out_size, lhs_map, rhs_map, out_map, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[50]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def BINARY_REDUCE(reducer, binary_op, graph, lhs, rhs, lhs_data, rhs_data, out_size, lhs_map, rhs_map, out_map, ret=...): # -> Var:
    """Perform BINARY_REDUCE symbolically.

    Parameters
    ----------
    reducer : str
        String representing reduction to perform, can be "sum", "max", "min",
        "mean", "prod", "none" (no reduction)
    binary_op : str
        String representing binary operation to perform, can be "add", "mul",
        "sub", "div", "dot"
    graph : var.Var
        Variable for graph index lambda. The lambda returns the immutable graph
        index given a context object.
    lhs: int
        The lhs target (src, dst, edge)
    rhs: int
        The rhs target (src, dst, edge)
    lhs_data : var.Var
        Variable for the lhs data
    rhs_data : var.Var
        Variable for the rhs data
    out_size : int
        Output size
    lhs_map : var.Var
        Variable for mapping lambda. The lambda returns the lhs id mapping
        array on given context
    rhs_map : var.Var
        Variable for mapping lambda. The lambda returns the rhs id mapping
        array on given context
    out_map : var.Var
        Variable for mapping lambda. The lambda returns the output id mapping
        array on given context
    ret : var.Var, optional
        Variable for the result. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

class CopyReduceExecutor(Executor):
    """Executor for COPY_REDUCE

    Parameters
    ----------
    reducer : str
        String representing reduction to perform, can be "sum", "max", "min",
        "mean", "prod", "none" (no reduction)
    graph : var.Var
        Variable for graph index lambda. The lambda returns the immutable graph
        index given a context object.
    target: int
        The input target (src, dst, edge)
    in_data : var.Var
        Variable for the input data
    out_size : int
        Output size
    in_map : var.Var
        Variable for mapping lambda. The lambda returns the input id mapping
        array on given context
    out_map : var.Var
        Variable for mapping lambda. The lambda returns the output id mapping
        array on given context
    ret : var.Var
        Variable for the result.
    """
    def __init__(self, reducer, graph, target, in_data, out_size, in_map, out_map, ret) -> None:
        ...
    
    def opcode(self): # -> Literal[51]:
        ...
    
    def arg_vars(self): # -> list[Unknown]:
        ...
    
    def ret_var(self):
        ...
    
    def run(self): # -> None:
        ...
    


def COPY_REDUCE(reducer, graph, target, in_data, out_size, in_map, out_map, ret=...): # -> Var:
    """Perform COPY_REDUCE symbolically.

    Parameters
    ----------
    reducer : str
        String representing reduction to perform, can be "sum", "max", "min",
        "mean", "prod", "none" (no reduction)
    graph : var.Var
        Variable for graph index lambda. The lambda returns the immutable graph
        index given a context object.
    target: int
        The input target (src, dst, edge)
    in_data : var.Var
        Variable for the input data
    out_size : int
        Output size
    in_map : var.Var
        Variable for mapping lambda. The lambda returns the input id mapping
        array on given context
    out_map : var.Var
        Variable for mapping lambda. The lambda returns the output id mapping
        array on given context
    ret : var.Var, optional
        Variable for the result. If not give, a new variable will be created.

    Returns
    -------
    var.Var
        Variable for the result.
    """
    ...

