class_docstr: Interface specification for `Type`\s that can be arguments to a `CLinkerOp`.
  
  A `CLinkerType` instance is mainly responsible  for providing the C code that
  interfaces python objects with a C `CLinkerOp` implementation.
class_docstr_tok: ["Interface","specification","for","`","Type","`","\\s","that","can","be","arguments","to","a","`","CLinkerOp","`",".","A","`","CLinkerType","`","instance","is","mainly","responsible","for","providing","the","C","code","that","interfaces","python","objects","with","a","C","`","CLinkerOp","`","implementation","."]
docstr: Return C code to extract a ``PyObject *`` instance.
  
  The code returned from this function must be templated using
  ``%(name)s``, representing the name that the caller wants to
  call this `Variable`. The Python object ``self.data`` is in a
  variable called ``"py_%(name)s"`` and this code must set the
  variables declared by :meth:`CLinkerType.c_declare` to something
  representative of ``py_%(name)``\s. If the data is improper, set an
  appropriate exception and insert ``"%(fail)s"``.
  
  TODO: Point out that template filling (via sub) is now performed
  by this function. --jpt
  
  Parameters
  ----------
  name
      The name of the ``PyObject *`` pointer that will store the value
      for this type.
  sub
      A dictionary of special codes. Most importantly
      ``sub['fail']``. See `CLinker` for more info on ``sub`` and
      ``fail``.
  
  Examples
  --------
  
  .. code-block: python
  
      def c_extract(self, name, sub, check_input=True, **kwargs):
          return "if (py_%(name)s == Py_None)" + \\\
                      addr_of_%(name)s = &py_%(name)s;" + \\\
              "else" + \\\
              { PyErr_SetString(PyExc_ValueError, \\\
                      'was expecting None'); %(fail)s;}"
code: def c_extract(
      self,
      name: str,
      sub: dict[str, str],
      check_input: bool = True,
      **kwargs,
  ) -> str:
      r"""Return C code to extract a ``PyObject *`` instance.
  
          The code returned from this function must be templated using
          ``%(name)s``, representing the name that the caller wants to
          call this `Variable`. The Python object ``self.data`` is in a
          variable called ``"py_%(name)s"`` and this code must set the
          variables declared by :meth:`CLinkerType.c_declare` to something
          representative of ``py_%(name)``\s. If the data is improper, set an
          appropriate exception and insert ``"%(fail)s"``.
  
          TODO: Point out that template filling (via sub) is now performed
          by this function. --jpt
  
          Parameters
          ----------
          name
              The name of the ``PyObject *`` pointer that will store the value
              for this type.
          sub
              A dictionary of special codes. Most importantly
              ``sub['fail']``. See `CLinker` for more info on ``sub`` and
              ``fail``.
  
          Examples
          --------
  
          .. code-block: python
  
              def c_extract(self, name, sub, check_input=True, **kwargs):
                  return "if (py_%(name)s == Py_None)" + \\\
                              addr_of_%(name)s = &py_%(name)s;" + \\\
                      "else" + \\\
                      { PyErr_SetString(PyExc_ValueError, \\\
                              'was expecting None'); %(fail)s;}"
  
          """
  
imports: import typing
  import warnings
  from abc import abstractmethod
  from typing import Callable, Optional
  from pytensor.graph.basic import Apply, Constant
  from pytensor.graph.utils import MethodNotDefined
label_desc: Use image node_id 3 for calling the CLinkerType obj's underlying member method code with example usage: obj.c_extract(name, sub, check_input) without return types