a
    p=icM                  2   @   s  d Z ddlZddlZddlZddlZddlmZ ddlmZ ej	Z
ej	ZddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJ ddlmKZK ddlmLZL dd	lmMZM dd
lmNZN ddlmOZO ddlmPZP i ZQi ZRdD ]ZSdeReS< qeTejUVde ZWdeXeYeW d ed d ed d ed d ed d ed d ed d ed d ed  d! ed" d# ed$ d% ed& d' ed( d) ed* d+ ed, d- ed. d/ e d0 d+d+d1g d2d3d4gd5ZZd6d7d8d9d:d;d<d=d=ed>eEed=id?
gZ[eRd@dAdBdCdDdEdFg dGedHidIdJgdKgdLZ\ddddddMdddddNddddddOd=d=d=d=d=d=dPdQd=d=d=d=dRdSdTdUdVdWdXdYd=d=d=dZd[gd\d]gd^d_d`dadbd=d=d=d=d=d=d=d=d=d=d=d=d=edceEed=idd/dedfd=eEe2dgdhdid=e2dgdjeDeEeFe2e$eEedkeDeEe2e$eEedle2d=ed=ieEeFe2e$edmeDeEe2e$eEedneDeEe2edoieDeEeFe2e$eEedpiedqgiedrie<dsiedtieEeFeeduie<dviedwigeDe:eEe;dxdjeEeFe2edyed=ieEeFe2edzedoieEeFe2ed{ieEeFe2ed|dpgied}gied~ie<dieEeFeediedie<diedige!ddjeEeFe2edyed=ieEeFe2edzedoieEeFe2edieEeFe2ed|dpgied}gied~ie<dieEeFeediedie<diedige;ddeEe'diddedigeDee9dieDeeEe9digeDe eEe!deDeEeFe2e$eEedeDeEe2e$eEeded=ieDeEeFe2e$eEedmeDeEe2e$eEednedoiedeEediediged~ie<diedieEeFeedie<diedieDeedieDeeEedigedieEedpiedie1die/digeEe'diedeEeFee'dieDe eEe9eEe!d	dkeEeFe2e$dmeDeEe2e$dniddgdddddddddedrie<dide<diedwiedidgdddg deDe9eEe!d
dddedg
Z]e0de.de-de>deBde=de@de?deCdeAde6diZ^deRidedigde^ddediedieDe5eEedddddeDe5eEee*dƜdediedɜddgdge7d͜g d΢dediediged͜deDeeEeideDeeEee)ide"d=dҜde?d=dҜdeCd=dҜdeAd=dҜded=dҜedide8d՜gZ_deRidedigdd=e^dלeDe3e)dieDe4e)die*dieDe3e)dedcigieDe4e)dedcigie*deDee'dceDee)digid=dۜddeDe)eEe3dޜdddeDe)e3ddde*de)die)die)didde)didddeEe%dige)die4die3die)die4die3diddeEe%diddgedeEe%die%didedeEe%digidgdddged=dded ie$deEe$die*dieDe5eEededieDe5eEedde4die3die4die3die(die(die(dieDe5eEee)d		ed
dd=ieDe3eEeddd=ieEe,die,digdeEe,dieDe5eEee)d=dedie^eDe5eEee'd=ded ieDe5eEed=dde$deEe$diedie*diedde4die3die4die3die(die(die(dieDee)d	edieDe3eEedidgddgeDee)d=de*dieDee'dedieDee'd=de*didgededied=dg ddݐded ieDe*eEe$d!ige*dideDe*eEe$d"ige7d#d$eEe$d%igd&dd̐d'eEe$d"ige7d=de4die3die4die3dieDe(eEe$d!ie(d(ige(die(deDe(eEe$d"ieDe7e)d)deDe7e'ied ie7d=dg d*de*d+ided,d-d.d/d0d1d2d3eDee+d4d5eDee+d=dd6d.d/d0d7d2d8eDee&d4d5eDee&d=dediediged=dҜde4die3die4die3dieDee)d9d:d;e'd<ie)d=id>ee)d?ie'd@iedAidBgigdCeEeFe*e'dDieDe'eEe*dEiedFiged=dGdeDeeEeideDeeEee)ide"d=dҜde?d=dҜdeCd=dҜdeAd=dҜded=dҜedide8d՜g*Z`edHid̐dIdJdKdLeDe5eEed=dMdNdOdPe7d=dMdQdRdSed=dTdUdVdWdXgZadYdZ Zbd[d\d]d^d^d^d^d^d^d^d_
Zcd`da ZddS (b  aG  

Rules for building C/API module with f2py2e.

Here is a skeleton of a new wrapper function (13Dec2001):

wrapper_function(args)
  declarations
  get_python_arguments, say, `a' and `b'

  get_a_from_python
  if (successful) {

    get_b_from_python
    if (successful) {

      callfortran
      if (successful) {

        put_a_to_python
        if (successful) {

          put_b_to_python
          if (successful) {

            buildvalue = ...

          }

        }

      }

    }
    cleanup_b

  }
  cleanup_a

  return buildvalue

Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.

NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
$Date: 2005/08/30 08:58:42 $
Pearu Peterson

    N)Path   )__version__)>
applyrules	debugcapi
dictappenderrmessgentitlegetargs2hascallstatementhasexternalshasinitvaluehasnotehasresultnoteisarrayisarrayofstrings	iscomplexiscomplexarrayiscomplexfunctioniscomplexfunction_warnisdummyroutine
isexternal
isfunctionisfunction_wrapisint1arrayisintent_aux
isintent_cisintent_callbackisintent_copyisintent_hideisintent_inoutisintent_nothideisintent_outisintent_overwrite	islogicalislong_complexislong_doubleislong_doublefunctionislong_longislong_longfunctionismoduleroutine
isoptional
isrequiredisscalarissigned_long_longarrayisstringisstringarrayisstringfunctionissubroutineissubroutine_wrapisthreadsafe
isunsignedisunsigned_charisunsigned_chararrayisunsigned_long_longisunsigned_long_longarrayisunsigned_shortisunsigned_shortarrayl_andl_notl_oroutmessreplace
stripcommarequiresf90wrapper)	capi_maps)cfuncs)common_rules)	use_rules)f90mod_rules)	func2subr)decl	frompyobjcleanupfrompyobjtopyarrmethod	pyobjfromclosepyobjfromfreememuserincludes	includes0includestypedefstypedefs_generated	cppmacrosrD   	callbackslatexdocrestdocroutine_defsexternroutinesinitf2pywraphookscommonhooksinitcommonhooksf90modhooksinitf90modhooks
SOURCE_DATE_EPOCHz/* File: #modulename#module.c
 * This file is auto-generated with f2py (version:#f2py_version#).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * Generation date: a  
 * Do not edit this file directly unless you know what you are doing!!!
 */

#ifdef __cplusplus
extern "C" {
#endif

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */

/* Unconditionally included */
#include <Python.h>
#include <numpy/npy_os.h>

zSee f2py2e/cfuncs.py: includesz
#includes#
#includes0#

z,See f2py2e/rules.py: mod_rules['modulebody']zM
static PyObject *#modulename#_error;
static PyObject *#modulename#_module;

zSee f2py2e/cfuncs.py: typedefsz
#typedefs#

z(See f2py2e/cfuncs.py: typedefs_generatedz
#typedefs_generated#

zSee f2py2e/cfuncs.py: cppmacrosz
#cppmacros#

zSee f2py2e/cfuncs.py: cfuncsz
#cfuncs#

z"See f2py2e/cfuncs.py: userincludesz
#userincludes#

z"See f2py2e/capi_rules.py: usercodez9
#usercode#

/* See f2py2e/rules.py */
#externroutines#

z#See f2py2e/capi_rules.py: usercode1z
#usercode1#

z%See f2py2e/cb_rules.py: buildcallbackz
#callbacks#

zSee f2py2e/rules.py: buildapiz	
#body#

z&See f2py2e/f90mod_rules.py: buildhooksz
#f90modhooks#

z/See f2py2e/rules.py: module_rules['modulebody']

z&See f2py2e/common_rules.py: buildhooksz
#commonhooks#

zSee f2py2e/rules.pya,  

static FortranDataDef f2py_routine_defs[] = {
#routine_defs#
    {NULL}
};

static PyMethodDef f2py_module_methods[] = {
#pymethoddef#
    {NULL,NULL}
};

static struct PyModuleDef moduledef = {
    PyModuleDef_HEAD_INIT,
    "#modulename#",
    NULL,
    -1,
    f2py_module_methods,
    NULL,
    NULL,
    NULL,
    NULL
};

PyMODINIT_FUNC PyInit_#modulename#(void) {
    int i;
    PyObject *m,*d, *s, *tmp;
    m = #modulename#_module = PyModule_Create(&moduledef);
    Py_SET_TYPE(&PyFortran_Type, &PyType_Type);
    import_array();
    if (PyErr_Occurred())
        {PyErr_SetString(PyExc_ImportError, "can't initialize module #modulename# (failed to import numpy)"); return m;}
    d = PyModule_GetDict(m);
    s = PyUnicode_FromString("#f2py_version#");
    PyDict_SetItemString(d, "__version__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString(
        "This module '#modulename#' is auto-generated with f2py (version:#f2py_version#).\nFunctions:\n"
#docs#".");
    PyDict_SetItemString(d, "__doc__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString("az  ");
    PyDict_SetItemString(d, "__f2py_numpy_version__", s);
    Py_DECREF(s);
    #modulename#_error = PyErr_NewException ("#modulename#.error", NULL, NULL);
    /*
     * Store the error object inside the dict, so that it could get deallocated.
     * (in practice, this is a module, so it likely will not and cannot.)
     */
    PyDict_SetItemString(d, "_#modulename#_error", #modulename#_error);
    Py_DECREF(#modulename#_error);
    for(i=0;f2py_routine_defs[i].name!=NULL;i++) {
        tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]);
        PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp);
        Py_DECREF(tmp);
    }
#initf2pywraphooks#
#initf90modhooks#
#initcommonhooks#
#interface_usercode#

#ifdef F2PY_REPORT_ATEXIT
    if (! PyErr_Occurred())
        on_exit(f2py_report_on_exit,(void*)"#modulename#");
#endif
    return m;
}
#ifdef __cplusplus
}
#endif
)rX   rY   )z*\section{Module \texttt{#texmodulename#}}
z
#modnote#
z
#latexdoc#zdModule #modulename#
================================================================================z

#restdoc#)
modulebodyseparatorsforrX   rY   z/*eof body*/z/*eof method*/z/*eof externroutines*/z/*eof routine_defs*/z/*eof initf90modhooks*/z/*eof initf2pywraphooks*/z/*eof initcommonhooks*/ z#note#)
bodyrM   r[   rZ   r`   r\   r^   rX   rY   Zmodnotea=  
#begintitle#
static char doc_#apiname#[] = "\
#docreturn##name#(#docsignatureshort#)\n\nWrapper for ``#name#``.\
\n#docstrsigns#";
/* #declfortranroutine# */
static PyObject *#apiname#(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           #functype# (*f2py_func)(#callprotoargument#)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
#decl#
    static char *capi_kwlist[] = {#kwlist##kwlistopt##kwlistxa#NULL};
#usercode#
#routdebugenter#
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "#argformat#|#keyformat##xaformat#:#pyname#",\
        capi_kwlist#args_capi##keys_capi##keys_xa#))
        return NULL;
#frompyobj#
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
#callfortranroutine#
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
        if (f2py_success) {
#pyobjfrom#
/*end of pyobjfrom*/
        CFUNCSMESS("Building return value.\n");
        capi_buildvalue = Py_BuildValue("#returnformat#"#return#);
/*closepyobjfrom*/
#closepyobjfrom#
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
#cleanupfrompyobj#
    if (capi_buildvalue == NULL) {
#routdebugfailure#
    } else {
#routdebugleave#
    }
    CFUNCSMESS("Freeing memory.\n");
#freemem#
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
    return capi_buildvalue;
}
#endtitle#
z#routine_def#z#initf2pywraphook#z#declfortranroutine#z!#docreturn##name#(#docsignature#)z&#docreturn##name#(#docsignatureshort#)z*"    #docreturn##name#(#docsignature#)\n"
)zarrayobject.h
CFUNCSMESSZMINMAXz#define DEBUGCFUNCSz1\subsection{Wrapper function \texttt{#texname#}}
zk
\noindent{{}\verb@#docreturn##name#@{}}\texttt{(#latexdocsignatureshort#)}
#routnote#

#latexdocstrsigns#
zlWrapped function ``#name#``
--------------------------------------------------------------------------------)re   rg   rZ   r\   r[   docdocshortdocsneedrV   rX   rY   z || z\n"
")callfortranroutineroutdebugenterrI   routdebugleaveroutdebugfailure	setjmpbuf	docstrreq	docstropt	docstrout	docstrcbsdocstrsignslatexdocstrsignslatexdocstrreqlatexdocstroptlatexdocstroutlatexdocstrcbsz/*decl*/z/*freemem*/z\nParameters\n----------z$\nOther Parameters\n----------------z\nReturns\n-------z'\nNotes\n-----\nCall-back functions::\nz\noindent Required arguments:z\noindent Optional arguments:z\noindent Return objects:z\noindent Call-back functions:z/*frompyobj*/z/*end of cleanupfrompyobj*/z/*pyobjfrom*/z/*end of closepyobjfrom*/z/*topyarr*/z/*routdebugleave*/z/*routdebugenter*/z/*routdebugfailure*/z/*callfortranroutine*/z
--- #note#)/re   kwlist	kwlistoptcallfortrancallfortranappenddocsign
docsignoptrI   rP   Zdocsignshortdocsignoptshortrv   rw   rr   rs   rt   ru   rx   ry   rz   r{   	args_capi	keys_capifunctyperJ   rK   rN   rO   rL   ro   rn   rp   rm   	argformat	keyformatZneed_cfuncs	docreturnreturnreturnformatZrformatkwlistxakeys_xaxaformat	docsignxadocsignxashortinitf2pywraphookZroutnotezf2py_rout_#modulename#_#name#z#modulename#.#name#)ZapinameZpynamerI   _checkz-f2py_rout_#modulename#_#f90modulename#_#name#z##modulename#.#f90modulename#.#name#voidzGextern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);z/extern void #fortranname#(#callprotoargument#);zq    {"#name#",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},zY    {"#name#",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},zH    {"#name#",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},F_FUNCzU    fprintf(stderr,"debug-capi:Fortran subroutine `#fortranname#(#callfortran#)'\n");zI        if (#setjmpbuf#) {
            f2py_success = 0;
        } else {z"            Py_BEGIN_ALLOW_THREADSzQ                #callstatement#;
                /*(*f2py_func)(#callfortran#);*/z,                (*f2py_func)(#callfortran#);z             Py_END_ALLOW_THREADSz	        })r   declfortranroutineroutine_defrl   rm   r   zFextern void #F_WRAPPEDFUNC#(#name_lower#,#NAME#)(#callprotoargument#);zp    {"#name#",-1,{{-1}},0,(char *)#F_WRAPPEDFUNC#(#name_lower#,#NAME#),(f2py_init_func)#apiname#,doc_#apiname#},a  
    {
      extern #ctype# #F_FUNC#(#name_lower#,#NAME#)(void);
      PyObject* o = PyDict_GetItemString(d,"#name#");
      tmp = F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL);
      PyObject_SetAttrString(o,"_cpointer", tmp);
      Py_DECREF(tmp);
      s = PyUnicode_FromString("#name#");
      PyObject_SetAttrString(o,"__name__", s);
      Py_DECREF(s);
    }
    ZF_WRAPPEDFUNCz\    fprintf(stderr,"debug-capi:Fortran subroutine `f2pywrap#name_lower#(#callfortran#)'\n");z=    if (#setjmpbuf#) {
        f2py_success = 0;
    } else {z    Py_BEGIN_ALLOW_THREADSz     (*f2py_func)(#callfortran#);z9    #callstatement#;
    /*(*f2py_func)(#callfortran#);*/z    Py_END_ALLOW_THREADSz    })r   r   r   r   rl   rm   r   a  
    {
      extern void #F_FUNC#(#name_lower#,#NAME#)(void);
      PyObject* o = PyDict_GetItemString(d,"#name#");
      tmp = F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL);
      PyObject_SetAttrString(o,"_cpointer", tmp);
      Py_DECREF(tmp);
      s = PyUnicode_FromString("#name#");
      PyObject_SetAttrString(o,"__name__", s);
      Py_DECREF(s);
    }
    #ctype#z#rname#,z#pydocsignout#z"\item[]{{}\verb@#pydocsignout#@{}}z--- #resultnote#z#ifdef USESCOMPAQFORTRAN
    fprintf(stderr,"debug-capi:Fortran function #ctype# #fortranname#(#callcompaqfortran#)\n");
#else
    fprintf(stderr,"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\n");
#endif
zZ    fprintf(stderr,"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\n");
)r   r   rt   rz   rm   r   zJextern #ctype# #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);z2extern #ctype# #fortranname#(#callprotoargument#);z&    #ctype# #name#_return_value={0,0};z"    #ctype# #name#_return_value=0;z1    PyObject *#name#_return_value_capi = Py_None;zP    #callstatement#;
/*    #name#_return_value = (*f2py_func)(#callfortran#);*/
z6    #name#_return_value = (*f2py_func)(#callfortran#);zY    fprintf(stderr,"#routdebugshowvalue#\n",#name#_return_value.r,#name#_return_value.i);zA    fprintf(stderr,"#routdebugshowvalue#\n",#name#_return_value);zH    #name#_return_value_capi = pyobj_from_#ctype#1(#name#_return_value);zpyobj_from_#ctype#1Z	long_longZlong_doublez	#rformat#z,#name#_return_value_capiz,#name#_return_value)	r   r   rI   rm   rN   rl   r   r   r   z'    #ctype# #name#_return_value = NULL;z$    int #name#_return_value_len = 0;z,#name#_return_value,#name#_return_value_len,z(    #name#_return_value_len = #rlength#;zS    if ((#name#_return_value = (string)malloc(#name#_return_value_len+1) == NULL) {z<        PyErr_SetString(PyExc_MemoryError, "out of memory");z        f2py_success = 0;z    } else {z>        (#name#_return_value)[#name#_return_value_len] = '\0';z    if (f2py_success) {z        Py_BEGIN_ALLOW_THREADSzv#ifdef USESCOMPAQFORTRAN
        (*f2py_func)(#callcompaqfortran#);
#else
        (*f2py_func)(#callfortran#);
#endif
z        Py_END_ALLOW_THREADSz]        fprintf(stderr,"#routdebugshowvalue#\n",#name#_return_value_len,#name#_return_value);z2    } /* if (f2py_success) after (string)malloc */z$    STRINGFREE(#name#_return_value);)r   r   
STRINGFREE)
r   r   rI   r~   rm   r   r   rP   rl   r   z]    fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#(#docsignature#)\n");zZ    fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: successful.\n");zW    fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: failure.\n");)rn   ro   rp   r   Zcomplex_long_doubleZunsigned_charZunsigned_shortZunsignedZunsigned_long_longre   z1    /* Processing auxiliary variable #varname# */z'    fprintf(stderr,"#vardebuginfo#\n");z,    /* End of cleaning variable #varname# */)rJ   rK   rl   z    #ctype# #varname# = 0;zmath.hz    #varname# = #init#;)rI   rl   rJ   r   z
,#varname#z#outvarname#,z#varrformat#)r   rt   r   r   r   z    #ctype# #varname#;z3    #varname#.r = #init.r#, #varname#.i = #init.i#;)rI   rJ   r       #ctype# #varname# = NULL;    int slen(#varname#);zlen..)rI   rl   r   )    #ctype# *#varname# = NULL;4    npy_intp #varname#_Dims[#rank#] = {#rank*[-1]#};&    const int #varname#_Rank = #rank#;Zforcombrh   r   )rl   r   _dependzflen(#varname#),string)r   rl   r   z'    /* Processing variable #varname# */)rJ   rK   r   rl   z#pydocsign#z\item[]{{}\verb@#pydocsign#@{}}z--- See above.)rs   rr   rt   ry   rx   rz   Zdependz"#varname#",z
#varname#,)r|   r   r   z#varname#=#showinit#,)r}   r   r   r   )r   r   r   z#varname#_extra_args=(),z#varname#_extra_args,z=#varname#_extra_args : input tuple, optional\n    Default: ()z
#cbdocstr#z\item[] #cblatexdocstr#z}\item[]{{}\verb@#varname#_extra_args := () input tuple@{}} --- Extra arguments for call-back function {{}\verb@#varname#@{}}.z3    #cbname#_t #varname#_cb = { Py_None, NULL, 0 };z1    #cbname#_t *#varname#_cb_ptr = &#varname#_cb;z,    PyTupleObject *#varname#_xa_capi = NULL;z$    #cbname#_typedef #varname#_cptr;z"#varname#_extra_args",OzO!z,&#varname#_cb.capiz!,&PyTuple_Type,&#varname#_xa_capiz(setjmp(#varname#_cb.jmpbuf))z#varname#_cptr,z#cbname#zsetjmp.h)r   r   rs   ru   r{   ry   rI   r   r   r   r   r   r   r   rq   r~   rl   r   zif(F2PyCapsule_Check(#varname#_cb.capi)) {
  #varname#_cptr = F2PyCapsule_AsVoidPtr(#varname#_cb.capi);
} else {
  #varname#_cptr = #cbname#;
}
a  if (#varname#_cb.capi==Py_None) {
  #varname#_cb.capi = PyObject_GetAttrString(#modulename#_module,"#varname#");
  if (#varname#_cb.capi) {
    if (#varname#_xa_capi==NULL) {
      if (PyObject_HasAttrString(#modulename#_module,"#varname#_extra_args")) {
        PyObject* capi_tmp = PyObject_GetAttrString(#modulename#_module,"#varname#_extra_args");
        if (capi_tmp) {
          #varname#_xa_capi = (PyTupleObject *)PySequence_Tuple(capi_tmp);
          Py_DECREF(capi_tmp);
        }
        else {
          #varname#_xa_capi = (PyTupleObject *)Py_BuildValue("()");
        }
        if (#varname#_xa_capi==NULL) {
          PyErr_SetString(#modulename#_error,"Failed to convert #modulename#.#varname#_extra_args to tuple.\n");
          return NULL;
        }
      }
    }
  }
  if (#varname#_cb.capi==NULL) {
    PyErr_SetString(#modulename#_error,"Callback #varname# not defined (as an argument or module #modulename# attribute).\n");
    return NULL;
  }
}
z    if (create_cb_arglist(#varname#_cb.capi,#varname#_xa_capi,#maxnofargs#,#nofoptargs#,&#varname#_cb.nofargs,&#varname#_cb.args_capi,"failed in processing argument list for call-back #varname#.")) {
z        fprintf(stderr,"debug-capi:Assuming %d arguments; at most #maxnofargs#(-#nofoptargs#) is expected.\n",#varname#_cb.nofargs);
        CFUNCSMESSPY("for #varname#=",#varname#_cb.capi);zK        fprintf(stderr,"#vardebugshowvalue# (call-back in C).\n",#cbname#);z        CFUNCSMESS("Saving callback variables for `#varname#`.\n");
        #varname#_cb_ptr = swap_active_#cbname#(#varname#_cb_ptr);z        CFUNCSMESS("Restoring callback variables for `#varname#`.\n");
        #varname#_cb_ptr = swap_active_#cbname#(#varname#_cb_ptr);
        Py_DECREF(#varname#_cb.args_capi);
    }ZSWAPZcreate_cb_arglist)rJ   rK   rl   r   r   z6    fprintf(stderr,"#vardebugshowvalue#\n",#varname#);z&#varname#,)rI   rN   r~   r   r   )rl   r   '    PyObject *#varname#_capi = Py_None;z,&#varname#_capiz]    f2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);
    if (f2py_success) {z2    } /*if (f2py_success) of #varname# pyobjfrom*/ztry_pyarr_from_#ctype#)	rI   r   r   r   r   rN   rO   rl   r   z;    if (#varname#_capi == Py_None) #varname# = #init#; elser   z"    if (#varname#_capi != Py_None)z        f2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,"#pyname#() #nth# (#varname#) can't be converted to #ctype#");
    if (f2py_success) {zo        #varname# = (#ctype#)PyObject_IsTrue(#varname#_capi);
        f2py_success = 1;
    if (f2py_success) {z(    } /*if (f2py_success) of #varname#*/z#ctype#_from_pyobj)rJ   rl   r   r   )rJ   r   r   zD    fprintf(stderr,"#vardebugshowvalue#\n",#varname#.r,#varname#.i);z,#varname#_capi)rI   r~   rN   r   r   ze        f2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);
        if (f2py_success) {z6        } /*if (f2py_success) of #varname# pyobjfrom*/)	rI   r   r   r   r   rl   rN   rO   r   zW    if (#varname#_capi==Py_None) {#varname#.r = #init.r#, #varname#.i = #init.i#;} elsez3    }  /*if (f2py_success) of #varname# frompyobj*/)rI   r   z4    #varname#_capi = pyobj_from_#ctype#1(#varname#);)rN   rl   r   )r   r   r   zslen(#varname#),zF    fprintf(stderr,"#vardebugshowvalue#\n",slen(#varname#),#varname#);z:        STRINGPADN(#varname#, slen(#varname#), ' ', '\0');Z
STRINGPADN)rI   r~   r   rN   r   rl   r   z    slen(#varname#) = #length#;
    f2py_success = #ctype#_from_pyobj(&#varname#,&slen(#varname#),#init#,#varname#_capi,"#ctype#_from_pyobj failed in converting #nth#`#varname#' of #pyname# to C #ctype#");
    if (f2py_success) {z:        STRINGPADN(#varname#, slen(#varname#), '\0', ' ');zH        STRINGFREE(#varname#);
    }  /*if (f2py_success) of #varname#*/r   z    f2py_success = try_pyarr_from_#ctype#(#varname#_capi, #varname#,
                                          slen(#varname#));
    if (f2py_success) {)r   r   r   r   rN   rO   rl   r   )r   r   r   z-    PyArrayObject *capi_#varname#_tmp = NULL;z"    int capi_#varname#_intent = 0;z,capi_#varname#_tmp)rI   r~   r   rl   r   z%    int capi_overwrite_#varname# = 1;z"overwrite_#varname#",iz,&capi_overwrite_#varname#zoverwrite_#varname#=1,zoverwrite_#varname#,z9overwrite_#varname# : input int, optional\n    Default: 1)rI   r   r   r   r   r   rs   r   zK    capi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);z%    int capi_overwrite_#varname# = 0;zoverwrite_#varname#=0,z9overwrite_#varname# : input int, optional\n    Default: 0)rI   r   r   r   r   r   z    #setdims#;z&    capi_#varname#_intent |= #intent#;zo    capi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,Py_None);zv    capi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,#varname#_capi);av      if (capi_#varname#_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : #modulename#_error,"failed in converting #nth# `#varname#' of #pyname# to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        #varname# = (#ctype# *)(PyArray_DATA(capi_#varname#_tmp));
z$    if (#varname#_capi == Py_None) {z    {z        #ctype# capi_c;ay          int *_i,capi_i=0;
        CFUNCSMESS("#name#: Initializing #varname#=#init#\n");
        if (initforcomb(PyArray_DIMS(capi_#varname#_tmp),PyArray_NDIM(capi_#varname#_tmp),1)) {
            while ((_i = nextforcomb()))
                #varname#[capi_i++] = #init#; /* fortran way */
        } else {
            PyObject *exc, *val, *tb;
            PyErr_Fetch(&exc, &val, &tb);
            PyErr_SetString(exc ? exc : #modulename#_error,"Initialization of #nth# #varname# failed (initforcomb).");
            npy_PyErr_ChainExceptionsCause(exc, val, tb);
            f2py_success = 0;
        }
    }
    if (f2py_success) {z@    }  /*if (capi_#varname#_tmp == NULL) ... else of #varname#*/zb    if((PyObject *)capi_#varname#_tmp!=#varname#_capi) {
        Py_XDECREF(capi_#varname#_tmp); }z'        Py_XDECREF(capi_#varname#_tmp);z.    }  /*if (f2py_success) of #varname# init*/)rJ   rK   r   r   z6    fprintf(stderr,"debug-capi:Checking `#check#'\n");)rJ   rl   zQ    CHECKSCALAR(#check#,"#check#","#nth# #varname#","#varshowvalue#",#varname#) {z    } /*CHECKSCALAR(#check#)*/ZCHECKSCALAR)rJ   rK   rl   r   _breakzQ    CHECKSTRING(#check#,"#check#","#nth# #varname#","#varshowvalue#",#varname#) {z    } /*CHECKSTRING(#check#)*/ZCHECKSTRINGZ
CHECKARRAYz5    CHECKARRAY(#check#,"#check#","#nth# #varname#") {z    } /*CHECKARRAY(#check#)*/)rl   rJ   rK   r   r   ZCHECKGENERICz7    CHECKGENERIC(#check#,"#check#","#nth# #varname#") {z    } /*CHECKGENERIC(#check#)*/)rl   rJ   rK   c           "      C   s  t d| d   i }tdd }t| }tdti|}g }g }| d D ]}d}	| d D ]<}
|
d dvrttd	 qZ|
d D ]}|d |kr||}	 qZq|qZ|	std
| tj	d qH|	g}d|	v r|	d 
 D ]2\}}t|	}|d= ||d< ||d< || q|D ]}	t|	}td rtd }|d }t d t| d|d    |rt d| d t| d| d  t d| d t| d| d  n(t d| d t| d| d  t|	\}}|r|r|| n
|| t||}t||}qqHt| \}}|r2|| t||}t||}t| \}}|rd|| t||}t||}|D ](}t|| d |d  }t||}q|t }|d  dd tjD 7  < i }| D ]6}g ||< || D ]}d}|tjv rtj| }n|tjv r&tj| }n|tjv r>tj| }n|tj v rVtj | }n|tj!v rntj!| }n|tj"v rtj"| }nt|tjv rtj| }n\|tj#v rtj#| }nD|tj$v rtj$| }n,|tj%v rtj%| }ntdt&|  q|| | qq|| |D ]>}d|v r:|d | sDd|vrt||| }t||}qtt'|}t(j)*td |d }||d < t+|d!&}|,|d" -d#d$ W d   n1 s0    Y  t d%| d |f  td& rbt(j)*td |d d' }t+|d!.}|,d( |,d)*|d*  W d   n1 s@0    Y  t d+td |d f  td, rt(j)*td |d d- }||d.< t+|d!Z}|,d/t  d0tvr|,d1 |,d)*|d2  d0tvr|,d3 W d   n1 s0    Y  t d4td |d f  |rpt(j)*td |d5 }||d6< t+|d!}|,d7 |,d8t  |,d9 g } d:*|d) .d)D ]}!d;|!/d<  krd=k rn n| |!d)  nf|!r|!d; d>krt0|!d=kr| |!dd= d?  |!d=d }!q| |!d)  n| |!d)  qd*| -d@d)} |,|  W d   n1 sZ0    Y  t dA|  |rt(j)*td dB|d  }||d6< t+|d!0}|,dC |,dDt  |,dE g } d:*|d) .d)D ]}!d;|!/d<  krdFk rn n| |!d)  nt0|!dFkr|!d; d>kr| |!ddF dG  |!dFd }!t0|!d=kr| |!dd= dG  |!d=d }!qT| |!d)  n| |!d)  qd*| -d@d)} |,|  W d   n1 s0    Y  t dH|  |S )Iz
    Return
    z    Building module "%s"...
nameNf2py_versionZ
interfacedrg   block)	interfacezabstract interfacez1buildmodule: Expected interface block. Skipping.
zKbuildmodule: Could not find the body of interfaced routine "%s". Skipping.
)fileentryargsZemptygenZ	buildpath
modulenamez(    Generating possibly empty wrappers"
/Zcoutputz    Maybe empty "z-f2pywrappers2.f90"
z-f2pywrappers2.f90z-f2pywrappers.f"
z-f2pywrappers.fZuserT   c                 S   s   g | ]}|t  v r|qS  )typedef_need_dictvalues).0Zcvarr   r   a/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/numpy/f2py/rules.py
<listcomp>  s   zbuildmodule.<locals>.<listcomp>rf   zbuildmodule: unknown need %s.
r   Zcsrcwrd   	z  z)    Wrote C/API module "%s" to file "%s"
Z	dorestdoczmodule.restz.. -*- rest -*-
ra   rY   z;    ReST Documentation is saved to file "%s/%smodule.rest"
Z
dolatexdocz
module.texZltxz6%% This file is auto-generated with f2py (version:%s)
Z
shortlatexzO\documentclass{article}
\usepackage{a4wide}
\begin{document}
\tableofcontents

rX   z\end{document}z5    Documentation is saved to file "%s/%smodule.tex"
Zf2py_wrapper_outputfsrczC     -*- fortran -*-
z8C     This file is autogenerated with f2py (version:%s)
z<C     It contains Fortran 77 wrappers to fortran functions.
rc   r   !B    z
     &z
     &
z*    Fortran 77 wrappers are saved to "%s"
z%s-f2pywrappers2.f90z!     -*- f90 -*-
z8!     This file is autogenerated with f2py (version:%s)
z<!     It contains Fortran 90 wrappers to fortran functions.
H   z&
     &z*    Fortran 90 wrappers are saved to "%s"
)1r?   defmod_rulesrC   Zmodsign2mapr   r   r   printsysstderritemscopydeepcopyappendrB   optionsr   touchbuildapir   rE   Z
buildhooksrG   rF   ZbuildusevarsrD   Z	get_needsZf2cmap_mappedkeysrR   rS   rQ   rT   rU   rV   rW   r_   r]   reprmodule_rulesospathjoinopenwriter@   splitfindlen)"mZumretZ	mod_rulesvrdrdZfuncwrappersZfuncwrappers2nnbbibZnb_listkaZnb1Zisf90b_pathZm_nameapiwraparcrmruZneedscodecrfnfZwnlineslr   r   r   buildmodule  sv   













"
6

4


*
"*
"*r   stndr   th)
r                        	   r   c                 C   s  t | \} }t| \}}|t_| d }t| rJtd| d | d f  ntd| d   t| }ti |}t	D ]6}d|v r|d | sd|vrrt
||| }t||}qrd\}	}
i }|D ]
}t||| }t|| rt}ntt}t|| sNt|| s(|	d }	t|	t|	d	   d
 |d< n$|
d }
t|
t|
d	   d |d< nd|d< |||< |D ]b}d|v rtqbd|v r|d || sd|vrbt
|||| }t||}d|v rb qqbq|D ]}t|| rt}nt}|| }|D ]d}d|vrqd|v r"|d || s,d|vrt
|||| }t||}d|v r qZqd|| v r|| d D ](}||d< t
t||| }t||}qtqt|d tr|d   t|d tr|d   ttd|d |d |d d|d< ttd|d |d d}|dkrBttdd|d i|d< ntd |d |d!|d< |d d"d#|d$< |d$ d%d&|d$< ttd'|d( |d) d*}t|d) dkrttd+|d( |d) d*|d,< n||d,< ||d(< t|d- trttd.d-|d- id/ |d-< g |d0< g |d1< d2D ]}||v rVt|| trV|d0 ||  |d0< d3| }||v r$t|| tr$|d1 || d4d  d5g || dd   d6g |d1< q$t
t|}t| rtd7|d8   ntd9|d8   ||fS ):Nvarsz5            Constructing wrapper function "%s.%s"...
r   r   z.        Constructing wrapper function "%s"...
r   )r   r   r   
   z	 argumentnthz keywordhiddenr   r   checkrK   rO   z #docsign##docsignopt##docsignxa#r   r   r   )r   r   r   Zdocsignaturez#docsignopt##docsignxa#r   r   )r   r   rf   z	#docsign#Zdocsignatureshortz#docsign#[#docsignopt#])r   r   _z\_Zlatexdocsignatureshort,z, z #callfortran##callfortranappend#r~   r   )r~   r   z##callfortran# 0,#callfortranappend#Zcallcompaqfortranr   z#docreturn#z = rv   rw   )rr   rs   rt   ru   latexr   z\begin{description}z\end{description}z              %s
rj   z          %s
)rH   Zassubrr
   rC   depargsr*   r?   Zroutsign2mapr   
rout_rulesr   Zsign2mapr   	aux_rules	arg_rulesr   r+   r   stndcheck_rules
isinstancelistreverserA   r@   r   routine_rules)routr   r   r   varr   r   r   r   r   ZnthkZsavevrdr   Z_rulesr   Zoptargscfsr   r   r   r   r   p  s    



&



&








r   )e__doc__r   r   timer   pathlibr   rf   r   versionr   Znumpy_versionZauxfuncsr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   r   Zsepdictr   intenvirongetZgenerationtimeasctimegmtimer   r   r  r   r   r   r   r   r   r   r   r   r   r   r   <module>   s  3   ##&&)),,225588;;>>@@CCkk 
  8R	
(''


(,   
		
X	






-9"



	%	3      8" N