tools/cwrap/plugins/__init__.py
def process_single_check(self, code, arg, arg_accessor):
        """Used to postprocess a type check.

        Above we defined a function get_type_check that returns a Template
        string that allows for type checking a PyObject * for a specific type.
        In this function, the passed "code" is a combination of that type check
        along with a specific arg_accessor pasted in. For example:

        '(PyObject*)Py_TYPE(PyTuple_GET_ITEM(args, 1)) == THPTensorClass'

        This function can be overridden to support modifying this check string.
        For example, if an argument can be null, we might want to check and see
        if the type is Py_None, as well.

        Args:
            code: The string code representing a type check for a specific
            argument being accessed.
            arg: dictionary containing properties of that specific argument
            arg_accessor: the arg_accessor string for that specific argument.
            Note that this is likely also embedded in code, but if you want to
            be able to access this arg and throw away the other code, you can
            do so.

        Returns:
            A string representing the processed check/access string for this
            arg. If the plugin does not know how to modify a specific input, it
            should return the original code.

        """
        return code
Used to postprocess a type check.

        Above we defined a function get_type_check that returns a Template
        string that allows for type checking a PyObject * for a specific type.
        In this function, the passed "code" is a combination of that type check
        along with a specific arg_accessor pasted in. For example:

        '(PyObject*)Py_TYPE(PyTuple_GET_ITEM(args, 1)) == THPTensorClass'

        This function can be overridden to support modifying this check string.
        For example, if an argument can be null, we might want to check and see
        if the type is Py_None, as well.

        Args:
            code: The string code representing a type check for a specific
            argument being accessed.
            arg: dictionary containing properties of that specific argument
            arg_accessor: the arg_accessor string for that specific argument.
            Note that this is likely also embedded in code, but if you want to
            be able to access this arg and throw away the other code, you can
            do so.

        Returns:
            A string representing the processed check/access string for this
            arg. If the plugin does not know how to modify a specific input, it
            should return the original code.

        
Used to postprocess a type check.
Above we defined a function get_type_check that returns a Template
string that allows for type checking a PyObject * for a specific type.
In this function, the passed "code" is a combination of that type check
along with a specific arg_accessor pasted in. For example.



This function can be overridden to support modifying this check string.
For example, if an argument can be null, we might want to check and see
if the type is Py_None, as well.

The string code representing a type check for a specific
argument being accessed.
arg: dictionary containing properties of that specific argument
arg_accessor: the arg_accessor string for that specific argument.
Note that this is likely also embedded in code, but if you want to
be able to access this arg and throw away the other code, you can
do so.

A string representing the processed check/access string for this
arg. If the plugin does not know how to modify a specific input, it
should return the original code.
Used to postprocess a type check . Above we defined a function get_type_check that returns a Template string that allows for type checking a PyObject * for a specific type . In this function the passed " code " is a combination of that type check along with a specific arg_accessor pasted in . For example . This function can be overridden to support modifying this check string . For example if an argument can be null we might want to check and see if the type is Py_None as well . The string code representing a type check for a specific argument being accessed . arg : dictionary containing properties of that specific argument arg_accessor : the arg_accessor string for that specific argument . Note that this is likely also embedded in code but if you want to be able to access this arg and throw away the other code you can do so . A string representing the processed check / access string for this arg . If the plugin does not know how to modify a specific input it should return the original code .
def process_single_check(self, code, arg, arg_accessor):
        return code
def process_single_check ( self , code , arg , arg_accessor ) : return code
Used to postprocess a type check.
Used to postprocess a type check .
"""Used to postprocess a type check.

        Above we defined a function get_type_check that returns a Template
        string that allows for type checking a PyObject * for a specific type.
        In this function, the passed "code" is a combination of that type check
        along with a specific arg_accessor pasted in. For example:

        '(PyObject*)Py_TYPE(PyTuple_GET_ITEM(args, 1)) == THPTensorClass'

        This function can be overridden to support modifying this check string.
        For example, if an argument can be null, we might want to check and see
        if the type is Py_None, as well.

        Args:
            code: The string code representing a type check for a specific
            argument being accessed.
            arg: dictionary containing properties of that specific argument
            arg_accessor: the arg_accessor string for that specific argument.
            Note that this is likely also embedded in code, but if you want to
            be able to access this arg and throw away the other code, you can
            do so.

        Returns:
            A string representing the processed check/access string for this
            arg. If the plugin does not know how to modify a specific input, it
            should return the original code.

        """
self
code
arg
arg_accessor